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

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

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

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

#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_237143[1];
static int32_t mainziid_counter_mem_realtype_237176[1];
static int32_t mainziid_counter_mem_realtype_237224[1];
static int32_t mainzicounter_mem_realtype_237463[10240];
static int32_t mainzicounter_mem_realtype_237500[10240];
static int32_t mainzicounter_mem_realtype_237616[10240];
static int32_t mainzicounter_mem_realtype_237670[10240];
static int32_t mainzicounter_mem_realtype_237810[10240];
static int32_t mainzicounter_mem_realtype_237878[10240];
static int32_t mainzicounter_mem_realtype_238002[10240];
static int32_t mainziid_counter_mem_realtype_238014[1];
static int32_t mainzicounter_mem_realtype_238039[10240];
static int32_t mainziid_counter_mem_realtype_238051[1];
static int32_t mainzicounter_mem_realtype_238076[10240];
static int32_t mainziid_counter_mem_realtype_238088[1];
static int32_t mainzicounter_mem_realtype_238132[10240];
static int32_t mainzicounter_mem_realtype_238162[10240];
static int32_t mainzicounter_mem_realtype_238218[10240];
static int32_t mainzicounter_mem_realtype_238265[10240];
static int32_t mainzicounter_mem_realtype_238333[10240];
static int32_t mainzicounter_mem_realtype_238394[10240];
static int32_t mainzicounter_mem_realtype_238552[10240];
static int32_t mainzicounter_mem_realtype_238586[10240];
static int32_t mainzicounter_mem_realtype_238667[10240];
static int32_t mainzicounter_mem_realtype_238718[10240];
static int32_t mainzicounter_mem_realtype_238811[10240];
static int32_t mainzicounter_mem_realtype_238876[10240];
static int32_t mainziid_counter_mem_realtype_239098[1];
static int32_t mainzicounter_mem_realtype_239144[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_232966(int32_t num_elems_232963,\n                                                       double val_232964,\n                                                  ",
            "     __global\n                                                       unsigned char *mem_232962)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    int32_t replicate_gtid_232966;\n    int32_t replicate_ltid_232967;\n    int32_t replicate_gid_232968;\n    \n    replicate_gtid_232966 = get_global_id(0);\n    replicate_ltid_232967 = get_local_id(0);\n    replicate_gid_232968 = get_group_id(0);\n    \n    int64_t slice_232972 = num_elems_232963;\n    int64_t rep_i_232971 = sext_i32_i64(replicate_gtid_232966);\n    int64_t remnant_232973 = sext_i32_i64(replicate_gtid_232966) - rep_i_232971;\n    \n    if (slt64(replicate_gtid_232966, num_elems_232963)) {\n        ((__global double *) mem_232962)[rep_i_232971] = val_232964;\n    }\n    \n  error_0:\n    return;\n}\n__kernel void builtinzhreplicate_i64zireplicate_232507(int32_t num_elems_232504,\n                                                       int64_t val_232505,\n                                                       __global\n                                                       unsigned char *mem_232503)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    int32_t replicate_gtid_232507;\n    int32_t replicate_ltid_232508;\n    int32_t replicate_gid_232509;\n    \n    replicate_gtid_232507 = get_global_id(0);\n    replicate_ltid_232508 = get_local_id(0);\n    replicate_gid_232509 = get_group_id(0);\n    \n    int64_t slice_232513 = num_elems_232504;\n    int64_t rep_i_232512 = sext_i32_i64(replicate_gtid_232507);\n    int64_t remnant_232514 = sext_i32_i64(replicate_gtid_232507) - rep_i_232512;\n    \n    if (slt64(replicate_gtid_232507, num_elems_232504)) {\n        ((__global int64_t *) mem_232503)[rep_i_232512] = val_232505;\n    }\n    \n  error_0:\n    return;\n}\n__kernel void builtinzhreplicate_i8zireplicate_232265(int32_t num_elems_232262,\n                                                      int8_t val_232263,\n                                                  ",
            "    __global\n                                                      unsigned char *mem_232261)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    int32_t replicate_gtid_232265;\n    int32_t replicate_ltid_232266;\n    int32_t replicate_gid_232267;\n    \n    replicate_gtid_232265 = get_global_id(0);\n    replicate_ltid_232266 = get_local_id(0);\n    replicate_gid_232267 = get_group_id(0);\n    \n    int64_t slice_232271 = num_elems_232262;\n    int64_t rep_i_232270 = sext_i32_i64(replicate_gtid_232265);\n    int64_t remnant_232272 = sext_i32_i64(replicate_gtid_232265) - rep_i_232270;\n    \n    if (slt64(replicate_gtid_232265, num_elems_232262)) {\n        ((__global int8_t *) mem_232261)[rep_i_232270] = val_232263;\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_232525(int64_t n_203490,\n                                int64_t partition_sizze_203577,\n                                int64_t i_203670, __global\n                                unsigned char *mem_229186, __global\n                                unsigned char *mem_229194)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    int32_t copy_gtid_232525;\n    int32_t copy_ltid_232526;\n    int32_t copy_gid_232527;\n    \n    copy_gtid_232525 = get_global_id(0);\n    copy_ltid_232526 = get_local_id(0);\n    copy_gid_232527 = get_group_id(0);\n    \n    int64_t slice_232531 = partition_sizze_203577;\n    int64_t copy_i_232530 = sext_i32_i64(copy_gtid_2325",
            "25);\n    int64_t remnant_232532 = sext_i32_i64(copy_gtid_232525) - copy_i_232530;\n    \n    if (slt64(sext_i32_i64(copy_gtid_232525), partition_sizze_203577)) {\n        int64_t tmp_232533;\n        \n        tmp_232533 = ((__global int64_t *) mem_229186)[i_203670 +\n                                                       copy_i_232530 *\n                                                       n_203490];\n        ((__global int64_t *) mem_229194)[copy_i_232530] = tmp_232533;\n    }\n    \n  error_0:\n    return;\n}\n__kernel void mainzicopy_232726(int64_t n_p_203492,\n                                int64_t partition_sizze_203577,\n                                int64_t defunc_0_f_res_203631, int64_t i_203718,\n                                __global unsigned char *mem_229250, __global\n                                unsigned char *mem_229260)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    int32_t copy_gtid_232726;\n    int32_t copy_ltid_232727;\n    int32_t copy_gid_232728;\n    \n    copy_gtid_232726 = get_global_id(0);\n    copy_ltid_232727 = get_local_id(0);\n    copy_gid_232728 = get_group_id(0);\n    \n    int64_t slice_232733 = n_p_203492;\n    int64_t slice_232734 = partition_sizze_203577 * slice_232733;\n    int64_t copy_i_232731 = squot64(sext_i32_i64(copy_gtid_232726),\n                                    slice_232733);\n    int64_t remnant_232735 = sext_i32_i64(copy_gtid_232726) - copy_i_232731 *\n            slice_232733;\n    int64_t copy_i_232732 = remnant_232735;\n    int64_t remnant_232736 = remnant_232735 - copy_i_232732;\n    \n    if (slt64(sext_i32_i64(copy_gtid_232726), partition_sizze_203577 *\n              n_p_203492)) {\n        int64_t tmp_232737;\n        \n        tmp_232737 = ((__global int64_t *) mem_229250)[i_203718 +\n                                                       (copy_i_232731 *\n                                                        (defunc_0_f_res_203631 *\n                                                       ",
            "  n_p_203492) +\n                                                        copy_i_232732 *\n                                                        defunc_0_f_res_203631)];\n        ((__global int64_t *) mem_229260)[copy_i_232731 * n_p_203492 +\n                                          copy_i_232732] = tmp_232737;\n    }\n    \n  error_0:\n    return;\n}\n__kernel void mainzicopy_234763(int64_t n_203490,\n                                int64_t partition_sizze_203577,\n                                int64_t ctx_param_ext_229488,\n                                int64_t ctx_param_ext_229489,\n                                int64_t ctx_param_ext_229491, __global\n                                unsigned char *mem_param_229493, __global\n                                unsigned char *mem_230564)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    int32_t copy_gtid_234763;\n    int32_t copy_ltid_234764;\n    int32_t copy_gid_234765;\n    \n    copy_gtid_234763 = get_global_id(0);\n    copy_ltid_234764 = get_local_id(0);\n    copy_gid_234765 = get_group_id(0);\n    \n    int64_t slice_234770 = n_203490;\n    int64_t slice_234771 = partition_sizze_203577 * slice_234770;\n    int64_t copy_i_234768 = squot64(sext_i32_i64(copy_gtid_234763),\n                                    slice_234770);\n    int64_t remnant_234772 = sext_i32_i64(copy_gtid_234763) - copy_i_234768 *\n            slice_234770;\n    int64_t copy_i_234769 = remnant_234772;\n    int64_t remnant_234773 = remnant_234772 - copy_i_234769;\n    \n    if (slt64(sext_i32_i64(copy_gtid_234763), partition_sizze_203577 *\n              n_203490)) {\n        double tmp_234774;\n        \n        tmp_234774 = ((__global\n                       double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                   (copy_i_234768 *\n                                                    ctx_param_ext_229489 +\n                                                    copy_i_234769 *\n             ",
            "                                       ctx_param_ext_229491)];\n        ((__global double *) mem_230564)[copy_i_234769 *\n                                         partition_sizze_203577 +\n                                         copy_i_234768] = tmp_234774;\n    }\n    \n  error_0:\n    return;\n}\n__kernel void mainzicopy_234962(int64_t n_203490,\n                                int64_t partition_sizze_203577,\n                                int64_t ctx_param_ext_229488,\n                                int64_t ctx_param_ext_229489,\n                                int64_t ctx_param_ext_229491, __global\n                                unsigned char *mem_param_229493, __global\n                                unsigned char *mem_230622)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    int32_t copy_gtid_234962;\n    int32_t copy_ltid_234963;\n    int32_t copy_gid_234964;\n    \n    copy_gtid_234962 = get_global_id(0);\n    copy_ltid_234963 = get_local_id(0);\n    copy_gid_234964 = get_group_id(0);\n    \n    int64_t slice_234969 = n_203490;\n    int64_t slice_234970 = partition_sizze_203577 * slice_234969;\n    int64_t copy_i_234967 = squot64(sext_i32_i64(copy_gtid_234962),\n                                    slice_234969);\n    int64_t remnant_234971 = sext_i32_i64(copy_gtid_234962) - copy_i_234967 *\n            slice_234969;\n    int64_t copy_i_234968 = remnant_234971;\n    int64_t remnant_234972 = remnant_234971 - copy_i_234968;\n    \n    if (slt64(sext_i32_i64(copy_gtid_234962), partition_sizze_203577 *\n              n_203490)) {\n        double tmp_234973;\n        \n        tmp_234973 = ((__global\n                       double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                   (copy_i_234967 *\n                                                    ctx_param_ext_229489 +\n                                                    copy_i_234968 *\n                                                    ctx_param_ext_22",
            "9491)];\n        ((__global double *) mem_230622)[copy_i_234968 *\n                                         partition_sizze_203577 +\n                                         copy_i_234967] = tmp_234973;\n    }\n    \n  error_0:\n    return;\n}\n__kernel void mainzicopy_235212(int64_t n_203490,\n                                int64_t partition_sizze_203577,\n                                int64_t ctx_param_ext_229488,\n                                int64_t ctx_param_ext_229489,\n                                int64_t ctx_param_ext_229491, __global\n                                unsigned char *mem_param_229493, __global\n                                unsigned char *mem_230729)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    int32_t copy_gtid_235212;\n    int32_t copy_ltid_235213;\n    int32_t copy_gid_235214;\n    \n    copy_gtid_235212 = get_global_id(0);\n    copy_ltid_235213 = get_local_id(0);\n    copy_gid_235214 = get_group_id(0);\n    \n    int64_t slice_235219 = n_203490;\n    int64_t slice_235220 = partition_sizze_203577 * slice_235219;\n    int64_t copy_i_235217 = squot64(sext_i32_i64(copy_gtid_235212),\n                                    slice_235219);\n    int64_t remnant_235221 = sext_i32_i64(copy_gtid_235212) - copy_i_235217 *\n            slice_235219;\n    int64_t copy_i_235218 = remnant_235221;\n    int64_t remnant_235222 = remnant_235221 - copy_i_235218;\n    \n    if (slt64(sext_i32_i64(copy_gtid_235212), partition_sizze_203577 *\n              n_203490)) {\n        double tmp_235223;\n        \n        tmp_235223 = ((__global\n                       double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                   (copy_i_235217 *\n                                                    ctx_param_ext_229489 +\n                                                    copy_i_235218 *\n                                                    ctx_param_ext_229491)];\n        ((__global double *) mem_230729)[copy_i",
            "_235218 *\n                                         partition_sizze_203577 +\n                                         copy_i_235217] = tmp_235223;\n    }\n    \n  error_0:\n    return;\n}\n__kernel void mainzicopy_235590(int64_t n_203490,\n                                int64_t partition_sizze_203577,\n                                int64_t ctx_param_ext_229488,\n                                int64_t ctx_param_ext_229489,\n                                int64_t ctx_param_ext_229491, __global\n                                unsigned char *mem_param_229493, __global\n                                unsigned char *mem_230939)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    int32_t copy_gtid_235590;\n    int32_t copy_ltid_235591;\n    int32_t copy_gid_235592;\n    \n    copy_gtid_235590 = get_global_id(0);\n    copy_ltid_235591 = get_local_id(0);\n    copy_gid_235592 = get_group_id(0);\n    \n    int64_t slice_235597 = n_203490;\n    int64_t slice_235598 = partition_sizze_203577 * slice_235597;\n    int64_t copy_i_235595 = squot64(sext_i32_i64(copy_gtid_235590),\n                                    slice_235597);\n    int64_t remnant_235599 = sext_i32_i64(copy_gtid_235590) - copy_i_235595 *\n            slice_235597;\n    int64_t copy_i_235596 = remnant_235599;\n    int64_t remnant_235600 = remnant_235599 - copy_i_235596;\n    \n    if (slt64(sext_i32_i64(copy_gtid_235590), partition_sizze_203577 *\n              n_203490)) {\n        double tmp_235601;\n        \n        tmp_235601 = ((__global\n                       double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                   (copy_i_235595 *\n                                                    ctx_param_ext_229489 +\n                                                    copy_i_235596 *\n                                                    ctx_param_ext_229491)];\n        ((__global double *) mem_230939)[copy_i_235596 *\n                                         part",
            "ition_sizze_203577 +\n                                         copy_i_235595] = tmp_235601;\n    }\n    \n  error_0:\n    return;\n}\n__kernel void mainzicopy_235812(int64_t n_203490,\n                                int64_t partition_sizze_203577,\n                                int64_t ctx_param_ext_229488,\n                                int64_t ctx_param_ext_229489,\n                                int64_t ctx_param_ext_229491, __global\n                                unsigned char *mem_param_229493, __global\n                                unsigned char *mem_231059)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    int32_t copy_gtid_235812;\n    int32_t copy_ltid_235813;\n    int32_t copy_gid_235814;\n    \n    copy_gtid_235812 = get_global_id(0);\n    copy_ltid_235813 = get_local_id(0);\n    copy_gid_235814 = get_group_id(0);\n    \n    int64_t slice_235819 = n_203490;\n    int64_t slice_235820 = partition_sizze_203577 * slice_235819;\n    int64_t copy_i_235817 = squot64(sext_i32_i64(copy_gtid_235812),\n                                    slice_235819);\n    int64_t remnant_235821 = sext_i32_i64(copy_gtid_235812) - copy_i_235817 *\n            slice_235819;\n    int64_t copy_i_235818 = remnant_235821;\n    int64_t remnant_235822 = remnant_235821 - copy_i_235818;\n    \n    if (slt64(sext_i32_i64(copy_gtid_235812), partition_sizze_203577 *\n              n_203490)) {\n        double tmp_235823;\n        \n        tmp_235823 = ((__global\n                       double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                   (copy_i_235817 *\n                                                    ctx_param_ext_229489 +\n                                                    copy_i_235818 *\n                                                    ctx_param_ext_229491)];\n        ((__global double *) mem_231059)[copy_i_235818 *\n                                         partition_sizze_203577 +\n                                  ",
            "       copy_i_235817] = tmp_235823;\n    }\n    \n  error_0:\n    return;\n}\n__kernel void mainzicopy_236085(int64_t n_203490,\n                                int64_t partition_sizze_203577,\n                                int64_t ctx_param_ext_229488,\n                                int64_t ctx_param_ext_229489,\n                                int64_t ctx_param_ext_229491, __global\n                                unsigned char *mem_param_229493, __global\n                                unsigned char *mem_231228)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    int32_t copy_gtid_236085;\n    int32_t copy_ltid_236086;\n    int32_t copy_gid_236087;\n    \n    copy_gtid_236085 = get_global_id(0);\n    copy_ltid_236086 = get_local_id(0);\n    copy_gid_236087 = get_group_id(0);\n    \n    int64_t slice_236092 = n_203490;\n    int64_t slice_236093 = partition_sizze_203577 * slice_236092;\n    int64_t copy_i_236090 = squot64(sext_i32_i64(copy_gtid_236085),\n                                    slice_236092);\n    int64_t remnant_236094 = sext_i32_i64(copy_gtid_236085) - copy_i_236090 *\n            slice_236092;\n    int64_t copy_i_236091 = remnant_236094;\n    int64_t remnant_236095 = remnant_236094 - copy_i_236091;\n    \n    if (slt64(sext_i32_i64(copy_gtid_236085), partition_sizze_203577 *\n              n_203490)) {\n        double tmp_236096;\n        \n        tmp_236096 = ((__global\n                       double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                   (copy_i_236090 *\n                                                    ctx_param_ext_229489 +\n                                                    copy_i_236091 *\n                                                    ctx_param_ext_229491)];\n        ((__global double *) mem_231228)[copy_i_236091 *\n                                         partition_sizze_203577 +\n                                         copy_i_236090] = tmp_236096;\n    }\n    \n  error_",
            "0:\n    return;\n}\n__kernel void mainzisegmap_206869(__global int *global_failure,\n                                  int64_t m_203489, int64_t n_203490,\n                                  int64_t num_groups_206874, __global\n                                  unsigned char *mem_229148, __global\n                                  unsigned char *mem_229152, __global\n                                  unsigned char *mem_229155, __global\n                                  unsigned char *mem_229161, __global\n                                  unsigned char *mem_229164)\n{\n    #define segmap_group_sizze_206872 (mainzisegmap_group_sizze_206871)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_232361;\n    int32_t local_tid_232362;\n    int64_t group_sizze_232365;\n    int32_t wave_sizze_232364;\n    int32_t group_tid_232363;\n    \n    global_tid_232361 = get_global_id(0);\n    local_tid_232362 = get_local_id(0);\n    group_sizze_232365 = get_local_size(0);\n    wave_sizze_232364 = LOCKSTEP_WIDTH;\n    group_tid_232363 = get_group_id(0);\n    \n    int32_t phys_tid_206869 = global_tid_232361;\n    int32_t phys_group_id_232366;\n    \n    phys_group_id_232366 = get_group_id(0);\n    for (int32_t i_232367 = 0; i_232367 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(m_203489,\n                                          segmap_group_sizze_206872)) -\n                   phys_group_id_232366, sext_i64_i32(num_groups_206874));\n         i_232367++) {\n        int32_t virt_group_id_232368 = phys_group_id_232366 + i_232367 *\n                sext_i64_i32(num_groups_206874);\n        int64_t global_tid_232369 = sext_i32_i64(virt_group_id_232368) *\n                segmap_group_sizze_206872 + sext_i32_i64(local_tid_232362);\n        int64_t slice_232370 = m_203489;\n        int64_t write_i_206868 = global_tid_232369;\n        int64_t remnant_232371 = global_tid_232369 - write_i_206868;\n        \n     ",
            "   if (slt64(write_i_206868, m_203489)) {\n            int64_t c_203583;\n            \n            c_203583 = ((__global int64_t *) mem_229155)[write_i_206868];\n            \n            int64_t offset_203584;\n            \n            offset_203584 = ((__global int64_t *) mem_229152)[write_i_206868];\n            \n            bool is_this_one_203588 = c_203583 == (int64_t) 0;\n            int64_t this_offset_203589 = (int64_t) -1 + offset_203584;\n            int64_t total_res_203590;\n            \n            if (is_this_one_203588) {\n                total_res_203590 = this_offset_203589;\n            } else {\n                total_res_203590 = (int64_t) -1;\n            }\n            if (sle64((int64_t) 0, total_res_203590) && slt64(total_res_203590,\n                                                              m_203489)) {\n                for (int64_t i_232372 = 0; i_232372 < n_203490; i_232372++) {\n                    double tmp_232373;\n                    \n                    tmp_232373 = ((__global\n                                   double *) mem_229148)[write_i_206868 +\n                                                         i_232372 * m_203489];\n                    ((__global double *) mem_229161)[total_res_203590 *\n                                                     n_203490 + i_232372] =\n                        tmp_232373;\n                }\n            }\n            if (sle64((int64_t) 0, total_res_203590) && slt64(total_res_203590,\n                                                              m_203489)) {\n                ((__global int64_t *) mem_229164)[total_res_203590] =\n                    write_i_206868;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_206872\n}\n__kernel void mainzisegmap_207045(__global int *global_failure,\n                                  int64_t n_203490,\n                                  int64_t partition_sizze_203577, __global\n          ",
            "                        unsigned char *mem_229161, __global\n                                  unsigned char *mem_229186, __global\n                                  unsigned char *mem_229190)\n{\n    #define segmap_group_sizze_207040 (mainzisegmap_group_sizze_206925)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_232515;\n    int32_t local_tid_232516;\n    int64_t group_sizze_232519;\n    int32_t wave_sizze_232518;\n    int32_t group_tid_232517;\n    \n    global_tid_232515 = get_global_id(0);\n    local_tid_232516 = get_local_id(0);\n    group_sizze_232519 = get_local_size(0);\n    wave_sizze_232518 = LOCKSTEP_WIDTH;\n    group_tid_232517 = get_group_id(0);\n    \n    int32_t phys_tid_207045 = global_tid_232515;\n    int64_t global_tid_232520 = sext_i32_i64(group_tid_232517) *\n            segmap_group_sizze_207040 + sext_i32_i64(local_tid_232516);\n    int64_t slice_232521 = n_203490;\n    int64_t slice_232522 = partition_sizze_203577 * slice_232521;\n    int64_t gtid_207043 = squot64(global_tid_232520, slice_232521);\n    int64_t remnant_232523 = global_tid_232520 - gtid_207043 * slice_232521;\n    int64_t gtid_207044 = remnant_232523;\n    int64_t remnant_232524 = remnant_232523 - gtid_207044;\n    \n    if (slt64(gtid_207043, partition_sizze_203577) && slt64(gtid_207044,\n                                                            n_203490)) {\n        double x_207046;\n        \n        x_207046 = ((__global double *) mem_229161)[gtid_207043 * n_203490 +\n                                                    gtid_207044];\n        \n        bool isnan_res_207049;\n        \n        isnan_res_207049 = futrts_isnan64(x_207046);\n        \n        bool defunc_0_p_res_207050 = !isnan_res_207049;\n        int64_t defunc_1_f_res_207051;\n        \n        if (defunc_0_p_res_207050) {\n            int64_t x_207047;\n            \n            x_207047 = ((__global int64_t *) mem_229186)",
            "[gtid_207043 *\n                                                         n_203490 +\n                                                         gtid_207044];\n            \n            int64_t defunc_1_f_res_t_res_207052 = sub64(x_207047, (int64_t) 1);\n            \n            defunc_1_f_res_207051 = defunc_1_f_res_t_res_207052;\n        } else {\n            defunc_1_f_res_207051 = (int64_t) -1;\n        }\n        if ((sle64((int64_t) 0, gtid_207043) && slt64(gtid_207043,\n                                                      partition_sizze_203577)) &&\n            (sle64((int64_t) 0, defunc_1_f_res_207051) &&\n             slt64(defunc_1_f_res_207051, n_203490))) {\n            ((__global int64_t *) mem_229190)[gtid_207043 * n_203490 +\n                                              defunc_1_f_res_207051] =\n                gtid_207044;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_207040\n}\n__kernel void mainzisegmap_207170(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203490, int64_t n_p_203492,\n                                  int64_t partition_sizze_203577,\n                                  int64_t defunc_0_f_res_203631,\n                                  int64_t i_203670, __global\n                                  unsigned char *mem_229200, __global\n                                  unsigned char *mem_229206)\n{\n    #define segmap_group_sizze_207164 (mainzisegmap_group_sizze_207082)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_232535;\n    int32_t local_tid_232536;\n    int64_t group_sizze_232539;\n    int32_t wave_sizze_232538;\n    int32_t group_tid_232537;\n    \n    global_tid_232535 = get_global_id(0);\n    local_tid_232536 = get_local_id(0);\n    group_sizze_232539 ",
            "= get_local_size(0);\n    wave_sizze_232538 = LOCKSTEP_WIDTH;\n    group_tid_232537 = get_group_id(0);\n    \n    int32_t phys_tid_207170 = global_tid_232535;\n    int64_t global_tid_232540 = sext_i32_i64(group_tid_232537) *\n            segmap_group_sizze_207164 + sext_i32_i64(local_tid_232536);\n    int64_t slice_232541 = defunc_0_f_res_203631;\n    int64_t slice_232542 = n_p_203492 * slice_232541;\n    int64_t slice_232543 = partition_sizze_203577 * slice_232542;\n    int64_t gtid_207167 = squot64(global_tid_232540, slice_232542);\n    int64_t remnant_232544 = global_tid_232540 - gtid_207167 * slice_232542;\n    int64_t gtid_207168 = squot64(remnant_232544, slice_232541);\n    int64_t remnant_232545 = remnant_232544 - gtid_207168 * slice_232541;\n    int64_t gtid_207169 = remnant_232545;\n    int64_t remnant_232546 = remnant_232545 - gtid_207169;\n    \n    if ((slt64(gtid_207167, partition_sizze_203577) && slt64(gtid_207168,\n                                                             n_p_203492)) &&\n        slt64(gtid_207169, defunc_0_f_res_203631)) {\n        int64_t y_207174 = mul64(n_p_203492, gtid_207169);\n        int64_t new_i_207175 = add64(gtid_207168, y_207174);\n        bool cond_207176 = slt64(i_203670, new_i_207175);\n        double defunc_0_f_res_207177;\n        \n        if (cond_207176) {\n            defunc_0_f_res_207177 = NAN;\n        } else {\n            bool x_207178 = sle64((int64_t) 0, new_i_207175);\n            bool y_207179 = slt64(new_i_207175, n_203490);\n            bool bounds_check_207180 = x_207178 && y_207179;\n            bool index_certs_207181;\n            \n            if (!bounds_check_207180) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 1) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) new_i_207175;\n                        global_failure_args[1] = (int64_t) n_203490;\n                        ;\n                    }\n                    return;\n                }\n  ",
            "          }\n            \n            double defunc_0_f_res_f_res_207182;\n            \n            defunc_0_f_res_f_res_207182 = ((__global\n                                            double *) mem_229200)[gtid_207167 *\n                                                                  n_203490 +\n                                                                  new_i_207175];\n            defunc_0_f_res_207177 = defunc_0_f_res_f_res_207182;\n        }\n        ((__global double *) mem_229206)[gtid_207167 * (defunc_0_f_res_203631 *\n                                                        n_p_203492) +\n                                         gtid_207168 * defunc_0_f_res_203631 +\n                                         gtid_207169] = defunc_0_f_res_207177;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_207164\n}\n__kernel void mainzisegmap_207605(__global int *global_failure,\n                                  int64_t n_p_203492,\n                                  int64_t partition_sizze_203577,\n                                  int64_t defunc_0_f_res_203631, __global\n                                  unsigned char *mem_229206, __global\n                                  unsigned char *mem_229250, __global\n                                  unsigned char *mem_229255)\n{\n    #define segmap_group_sizze_207599 (mainzisegmap_group_sizze_207350)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_232714;\n    int32_t local_tid_232715;\n    int64_t group_sizze_232718;\n    int32_t wave_sizze_232717;\n    int32_t group_tid_232716;\n    \n    global_tid_232714 = get_global_id(0);\n    local_tid_232715 = get_local_id(0);\n    group_sizze_232718 = get_local_size(0);\n    wave_sizze_232717 = LOCKSTEP_WIDTH;\n    group_tid_232716 = get_group_id(0);\n    \n    int32_t phys_tid_207605 = global_tid_232714;\n    int64_t global_tid_232719 = sext_i32_i64(group_tid_232716) *",
            "\n            segmap_group_sizze_207599 + sext_i32_i64(local_tid_232715);\n    int64_t slice_232720 = defunc_0_f_res_203631;\n    int64_t slice_232721 = n_p_203492 * slice_232720;\n    int64_t slice_232722 = partition_sizze_203577 * slice_232721;\n    int64_t gtid_207602 = squot64(global_tid_232719, slice_232721);\n    int64_t remnant_232723 = global_tid_232719 - gtid_207602 * slice_232721;\n    int64_t gtid_207603 = squot64(remnant_232723, slice_232720);\n    int64_t remnant_232724 = remnant_232723 - gtid_207603 * slice_232720;\n    int64_t gtid_207604 = remnant_232724;\n    int64_t remnant_232725 = remnant_232724 - gtid_207604;\n    \n    if ((slt64(gtid_207602, partition_sizze_203577) && slt64(gtid_207603,\n                                                             n_p_203492)) &&\n        slt64(gtid_207604, defunc_0_f_res_203631)) {\n        double x_207606;\n        \n        x_207606 = ((__global double *) mem_229206)[gtid_207602 *\n                                                    (defunc_0_f_res_203631 *\n                                                     n_p_203492) + gtid_207603 *\n                                                    defunc_0_f_res_203631 +\n                                                    gtid_207604];\n        \n        bool isnan_res_207609;\n        \n        isnan_res_207609 = futrts_isnan64(x_207606);\n        \n        bool defunc_0_p_res_207610 = !isnan_res_207609;\n        int64_t defunc_1_f_res_207611;\n        \n        if (defunc_0_p_res_207610) {\n            int64_t x_207607;\n            \n            x_207607 = ((__global int64_t *) mem_229250)[gtid_207602 *\n                                                         (defunc_0_f_res_203631 *\n                                                          n_p_203492) +\n                                                         gtid_207603 *\n                                                         defunc_0_f_res_203631 +\n                                                         gtid_207604];\n            \n       ",
            "     int64_t defunc_1_f_res_t_res_207612 = sub64(x_207607, (int64_t) 1);\n            \n            defunc_1_f_res_207611 = defunc_1_f_res_t_res_207612;\n        } else {\n            defunc_1_f_res_207611 = (int64_t) -1;\n        }\n        if (((sle64((int64_t) 0, gtid_207602) && slt64(gtid_207602,\n                                                       partition_sizze_203577)) &&\n             (sle64((int64_t) 0, gtid_207603) && slt64(gtid_207603,\n                                                       n_p_203492))) &&\n            (sle64((int64_t) 0, defunc_1_f_res_207611) &&\n             slt64(defunc_1_f_res_207611, defunc_0_f_res_203631))) {\n            ((__global int64_t *) mem_229255)[gtid_207602 *\n                                              (defunc_0_f_res_203631 *\n                                               n_p_203492) + gtid_207603 *\n                                              defunc_0_f_res_203631 +\n                                              defunc_1_f_res_207611] =\n                gtid_207604;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_207599\n}\n__kernel void mainzisegmap_208818(__global int *global_failure,\n                                  int64_t n_p_203492,\n                                  int64_t partition_sizze_203577,\n                                  int64_t defunc_0_f_res_203631, __global\n                                  unsigned char *ext_mem_229265, __global\n                                  unsigned char *mem_229331)\n{\n    #define segmap_group_sizze_208812 (mainzisegmap_group_sizze_208475)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_232799;\n    int32_t local_tid_232800;\n    int64_t group_sizze_232803;\n    int32_t wave_sizze_232802;\n    int32_t group_tid_232801;\n    \n    global_tid_232799 = get_global_id(0);\n    local_tid_232800 = get_local_id(0);\n    group_sizze_232803 = get_local_s",
            "ize(0);\n    wave_sizze_232802 = LOCKSTEP_WIDTH;\n    group_tid_232801 = get_group_id(0);\n    \n    int32_t phys_tid_208818 = global_tid_232799;\n    int64_t global_tid_232804 = sext_i32_i64(group_tid_232801) *\n            segmap_group_sizze_208812 + sext_i32_i64(local_tid_232800);\n    int64_t slice_232805 = defunc_0_f_res_203631;\n    int64_t slice_232806 = n_p_203492 * slice_232805;\n    int64_t slice_232807 = partition_sizze_203577 * slice_232806;\n    int64_t gtid_208815 = squot64(global_tid_232804, slice_232806);\n    int64_t remnant_232808 = global_tid_232804 - gtid_208815 * slice_232806;\n    int64_t gtid_208816 = squot64(remnant_232808, slice_232805);\n    int64_t remnant_232809 = remnant_232808 - gtid_208816 * slice_232805;\n    int64_t gtid_208817 = remnant_232809;\n    int64_t remnant_232810 = remnant_232809 - gtid_208817;\n    \n    if ((slt64(gtid_208815, partition_sizze_203577) && slt64(gtid_208816,\n                                                             n_p_203492)) &&\n        slt64(gtid_208817, defunc_0_f_res_203631)) {\n        int64_t x_208819;\n        \n        x_208819 = ((__global int64_t *) ext_mem_229265)[gtid_208815 *\n                                                         (defunc_0_f_res_203631 *\n                                                          n_p_203492) +\n                                                         gtid_208816 *\n                                                         defunc_0_f_res_203631 +\n                                                         gtid_208817];\n        \n        int64_t defunc_0_f_res_208820 = add64((int64_t) 1, x_208819);\n        \n        ((__global int64_t *) mem_229331)[gtid_208815 * (defunc_0_f_res_203631 *\n                                                         n_p_203492) +\n                                          gtid_208816 * defunc_0_f_res_203631 +\n                                          gtid_208817] = defunc_0_f_res_208820;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_208812\n}\n_",
            "_kernel void mainzisegmap_208832(__global int *global_failure,\n                                  int64_t n_p_203492, int64_t q_s_203493,\n                                  int64_t partition_sizze_203577,\n                                  int64_t min_res_203749, double i64_res_203755,\n                                  __global unsigned char *ext_mem_229264,\n                                  __global unsigned char *mem_229336, __global\n                                  unsigned char *mem_229340, __global\n                                  unsigned char *mem_229344, __global\n                                  unsigned char *mem_229348)\n{\n    #define segmap_group_sizze_208824 (mainzisegmap_group_sizze_208444)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_232811;\n    int32_t local_tid_232812;\n    int64_t group_sizze_232815;\n    int32_t wave_sizze_232814;\n    int32_t group_tid_232813;\n    \n    global_tid_232811 = get_global_id(0);\n    local_tid_232812 = get_local_id(0);\n    group_sizze_232815 = get_local_size(0);\n    wave_sizze_232814 = LOCKSTEP_WIDTH;\n    group_tid_232813 = get_group_id(0);\n    \n    int32_t phys_tid_208832 = global_tid_232811;\n    int64_t global_tid_232816 = sext_i32_i64(group_tid_232813) *\n            segmap_group_sizze_208824 + sext_i32_i64(local_tid_232812);\n    int64_t slice_232817 = n_p_203492;\n    int64_t slice_232818 = partition_sizze_203577 * slice_232817;\n    int64_t gtid_208830 = squot64(global_tid_232816, slice_232817);\n    int64_t remnant_232819 = global_tid_232816 - gtid_208830 * slice_232817;\n    int64_t gtid_208831 = remnant_232819;\n    int64_t remnant_232820 = remnant_232819 - gtid_208831;\n    \n    if (slt64(gtid_208830, partition_sizze_203577) && slt64(gtid_208831,\n                                                            n_p_203492)) {\n        int64_t x_208833;\n        \n        x_208833 = ((__global int64_t *) e",
            "xt_mem_229264)[gtid_208830 *\n                                                         n_p_203492 +\n                                                         gtid_208831];\n        \n        int64_t min_arg_208834 = sub64(x_208833, (int64_t) 1);\n        int64_t min_arg_208835 = sub64(x_208833, min_res_203749);\n        int64_t min_res_208836 = smin64(q_s_203493, x_208833);\n        double i64_res_208837 = sitofp_i64_f64(x_208833);\n        double x_208838 = i64_res_203755 - i64_res_208837;\n        double max_arg_208839 = x_208838 / 2.0;\n        double max_res_208840 = fmax64(0.0, max_arg_208839);\n        \n        ((__global int64_t *) mem_229336)[gtid_208830 * n_p_203492 +\n                                          gtid_208831] = min_arg_208834;\n        ((__global int64_t *) mem_229340)[gtid_208830 * n_p_203492 +\n                                          gtid_208831] = min_arg_208835;\n        ((__global int64_t *) mem_229344)[gtid_208830 * n_p_203492 +\n                                          gtid_208831] = min_res_208836;\n        ((__global double *) mem_229348)[gtid_208830 * n_p_203492 +\n                                         gtid_208831] = max_res_208840;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_208824\n}\n__kernel void mainzisegmap_208856(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_p_203492, int64_t jump_s_203499,\n                                  int64_t partition_sizze_203577,\n                                  int64_t defunc_0_f_res_203631,\n                                  int64_t pad_css_len_203632,\n                                  int64_t s_n_m_203636, int64_t i_203718,\n                                  unsigned char x_203719_bits,\n                                  int64_t min_res_203749,\n                                  unsigned char loop_cond_203754_bits, __global\n             ",
            "                     unsigned char *mem_229331, __global\n                                  unsigned char *mem_229336, __global\n                                  unsigned char *mem_229340, __global\n                                  unsigned char *mem_229344, __global\n                                  unsigned char *mem_229348, __global\n                                  unsigned char *mem_229354, __global\n                                  unsigned char *mem_229359)\n{\n    bool x_203719 = x_203719_bits;\n    bool loop_cond_203754 = loop_cond_203754_bits;\n    \n    #define segmap_group_sizze_208849 (mainzisegmap_group_sizze_208205)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_232821;\n    int32_t local_tid_232822;\n    int64_t group_sizze_232825;\n    int32_t wave_sizze_232824;\n    int32_t group_tid_232823;\n    \n    global_tid_232821 = get_global_id(0);\n    local_tid_232822 = get_local_id(0);\n    group_sizze_232825 = get_local_size(0);\n    wave_sizze_232824 = LOCKSTEP_WIDTH;\n    group_tid_232823 = get_group_id(0);\n    \n    int32_t phys_tid_208856 = global_tid_232821;\n    int64_t global_tid_232826 = sext_i32_i64(group_tid_232823) *\n            segmap_group_sizze_208849 + sext_i32_i64(local_tid_232822);\n    int64_t slice_232827 = s_n_m_203636;\n    int64_t slice_232828 = n_p_203492 * slice_232827;\n    int64_t slice_232829 = partition_sizze_203577 * slice_232828;\n    int64_t gtid_208853 = squot64(global_tid_232826, slice_232828);\n    int64_t remnant_232830 = global_tid_232826 - gtid_208853 * slice_232828;\n    int64_t gtid_208854 = squot64(remnant_232830, slice_232827);\n    int64_t remnant_232831 = remnant_232830 - gtid_208854 * slice_232827;\n    int64_t gtid_208855 = remnant_232831;\n    int64_t remnant_232832 = remnant_232831 - gtid_208855;\n    \n    if ((slt64(gtid_208853, partition_sizze_203577) && slt64(gtid_208854,\n                                   ",
            "                          n_p_203492)) &&\n        slt64(gtid_208855, s_n_m_203636)) {\n        int64_t min_arg_208858;\n        \n        min_arg_208858 = ((__global int64_t *) mem_229336)[gtid_208853 *\n                                                           n_p_203492 +\n                                                           gtid_208854];\n        \n        int64_t min_arg_208859;\n        \n        min_arg_208859 = ((__global int64_t *) mem_229340)[gtid_208853 *\n                                                           n_p_203492 +\n                                                           gtid_208854];\n        \n        int64_t min_res_208860;\n        \n        min_res_208860 = ((__global int64_t *) mem_229344)[gtid_208853 *\n                                                           n_p_203492 +\n                                                           gtid_208854];\n        \n        double max_res_208861;\n        \n        max_res_208861 = ((__global double *) mem_229348)[gtid_208853 *\n                                                          n_p_203492 +\n                                                          gtid_208854];\n        \n        bool cond_208863 = gtid_208855 == (int64_t) 0;\n        int64_t defunc_0_m_fun_res_208864;\n        \n        if (cond_208863) {\n            defunc_0_m_fun_res_208864 = (int64_t) 0;\n        } else {\n            int64_t y_208865 = sub64(s_n_m_203636, (int64_t) 1);\n            bool cond_208866 = gtid_208855 == y_208865;\n            int64_t defunc_0_m_fun_res_f_res_208867;\n            \n            if (cond_208866) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_208868 =\n                        sub64(pad_css_len_203632, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_208867 =\n                    defunc_0_m_fun_res_f_res_t_res_208868;\n            } else {\n                int64_t x_208869 = sub64(gtid_208855, (int64_t) 1);\n                int64_t x_208870 = mul64(jump_s_203499, x_208869);\n              ",
            "  int64_t min_arg_208871 = add64((int64_t) 1, x_208870);\n                int64_t min_res_208872 = smin64(defunc_0_f_res_203631,\n                                                min_arg_208871);\n                \n                defunc_0_m_fun_res_f_res_208867 = min_res_208872;\n            }\n            defunc_0_m_fun_res_208864 = defunc_0_m_fun_res_f_res_208867;\n        }\n        \n        bool init_idx_208873;\n        int64_t init_idx_208874;\n        int64_t init_idx_208875;\n        bool loop_while_208876;\n        int64_t low_208877;\n        int64_t high_208878;\n        \n        loop_while_208876 = x_203719;\n        low_208877 = (int64_t) 0;\n        high_208878 = i_203718;\n        while (loop_while_208876) {\n            int64_t x_208879 = add64(low_208877, high_208878);\n            int64_t mid_208880 = sdiv64(x_208879, (int64_t) 2);\n            bool x_208881 = sle64((int64_t) 0, mid_208880);\n            bool y_208882 = slt64(mid_208880, defunc_0_f_res_203631);\n            bool bounds_check_208883 = x_208881 && y_208882;\n            bool index_certs_208884;\n            \n            if (!bounds_check_208883) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 12) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) mid_208880;\n                        global_failure_args[1] =\n                            (int64_t) defunc_0_f_res_203631;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            int64_t mid_id_208885;\n            \n            mid_id_208885 = ((__global int64_t *) mem_229331)[gtid_208853 *\n                                                              (defunc_0_f_res_203631 *\n                                                               n_p_203492) +\n                                                              gtid_208854 *\n                                                              defunc_0_f_res_203631 +",
            "\n                                                              mid_208880];\n            \n            bool cond_208886 = slt64(mid_id_208885, (int64_t) 0);\n            int64_t mid_idx_208887;\n            \n            if (cond_208886) {\n                mid_idx_208887 = (int64_t) 9223372036854775807;\n            } else {\n                mid_idx_208887 = mid_id_208885;\n            }\n            \n            bool cond_208888 = sle64(defunc_0_m_fun_res_208864, mid_idx_208887);\n            int64_t loopres_208889;\n            int64_t loopres_208890;\n            \n            if (cond_208888) {\n                int64_t loopres_t_res_208891 = sub64(mid_208880, (int64_t) 1);\n                \n                loopres_208889 = low_208877;\n                loopres_208890 = loopres_t_res_208891;\n            } else {\n                int64_t loopres_f_res_208892 = add64((int64_t) 1, mid_208880);\n                \n                loopres_208889 = loopres_f_res_208892;\n                loopres_208890 = high_208878;\n            }\n            \n            bool loop_cond_208893 = sle64(loopres_208889, loopres_208890);\n            bool loop_while_tmp_232833 = loop_cond_208893;\n            int64_t low_tmp_232834 = loopres_208889;\n            int64_t high_tmp_232835 = loopres_208890;\n            \n            loop_while_208876 = loop_while_tmp_232833;\n            low_208877 = low_tmp_232834;\n            high_208878 = high_tmp_232835;\n        }\n        init_idx_208873 = loop_while_208876;\n        init_idx_208874 = low_208877;\n        init_idx_208875 = high_208878;\n        \n        bool idx_208894;\n        int64_t idx_208895;\n        int64_t idx_208896;\n        int64_t idx_208897;\n        bool loop_while_208898;\n        int64_t l_idx_208899;\n        int64_t r_idx_208900;\n        int64_t span_208901;\n        \n        loop_while_208898 = loop_cond_203754;\n        l_idx_208899 = init_idx_208874;\n        r_idx_208900 = init_idx_208874;\n        span_208901 = (int64_t) 1;\n        while (loop_while_208898)",
            " {\n            int64_t max_arg_208902 = sub64(l_idx_208899, (int64_t) 1);\n            int64_t max_res_208903 = smax64((int64_t) 0, max_arg_208902);\n            int64_t min_arg_208904 = add64((int64_t) 1, r_idx_208900);\n            int64_t min_res_208905 = smin64(min_arg_208858, min_arg_208904);\n            bool x_208906 = sle64((int64_t) 0, max_res_208903);\n            bool y_208907 = slt64(max_res_208903, defunc_0_f_res_203631);\n            bool bounds_check_208908 = x_208906 && y_208907;\n            bool index_certs_208909;\n            \n            if (!bounds_check_208908) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 13) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) max_res_208903;\n                        global_failure_args[1] =\n                            (int64_t) defunc_0_f_res_203631;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            int64_t x_208910;\n            \n            x_208910 = ((__global int64_t *) mem_229331)[gtid_208853 *\n                                                         (defunc_0_f_res_203631 *\n                                                          n_p_203492) +\n                                                         gtid_208854 *\n                                                         defunc_0_f_res_203631 +\n                                                         max_res_208903];\n            \n            int64_t abs_arg_208911 = sub64(x_208910, defunc_0_m_fun_res_208864);\n            int64_t abs_res_208912 = abs64(abs_arg_208911);\n            bool x_208913 = sle64((int64_t) 0, min_res_208905);\n            bool y_208914 = slt64(min_res_208905, defunc_0_f_res_203631);\n            bool bounds_check_208915 = x_208913 && y_208914;\n            bool index_certs_208916;\n            \n            if (!bounds_check_208915) {\n                {\n                    if (atomi",
            "c_cmpxchg_i32_global(global_failure, -1, 14) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) min_res_208905;\n                        global_failure_args[1] =\n                            (int64_t) defunc_0_f_res_203631;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            int64_t x_208917;\n            \n            x_208917 = ((__global int64_t *) mem_229331)[gtid_208853 *\n                                                         (defunc_0_f_res_203631 *\n                                                          n_p_203492) +\n                                                         gtid_208854 *\n                                                         defunc_0_f_res_203631 +\n                                                         min_res_208905];\n            \n            int64_t abs_arg_208918 = sub64(x_208917, defunc_0_m_fun_res_208864);\n            int64_t abs_res_208919 = abs64(abs_arg_208918);\n            bool cond_208920 = max_res_208903 == l_idx_208899;\n            int64_t loopres_208921;\n            int64_t loopres_208922;\n            int64_t loopres_208923;\n            \n            if (cond_208920) {\n                loopres_208921 = l_idx_208899;\n                loopres_208922 = r_idx_208900;\n                loopres_208923 = min_res_203749;\n            } else {\n                bool cond_208924 = slt64(abs_res_208912, abs_res_208919);\n                bool cond_f_res_208925 = min_res_208905 == r_idx_208900;\n                bool x_208926 = !cond_208924;\n                bool y_208927 = cond_f_res_208925 && x_208926;\n                bool cond_208928 = cond_208924 || y_208927;\n                int64_t loopres_f_res_208929;\n                \n                if (cond_208928) {\n                    loopres_f_res_208929 = max_res_208903;\n                } else {\n                    loopres_f_res_208929 = l_idx_208899;\n                }\n                ",
            "\n                int64_t loopres_f_res_208930;\n                \n                if (cond_208928) {\n                    loopres_f_res_208930 = r_idx_208900;\n                } else {\n                    loopres_f_res_208930 = min_res_208905;\n                }\n                \n                int64_t loopres_f_res_208931;\n                \n                if (cond_208928) {\n                    int64_t loopres_f_res_t_res_208932 = add64((int64_t) 1,\n                                                               span_208901);\n                    \n                    loopres_f_res_208931 = loopres_f_res_t_res_208932;\n                } else {\n                    int64_t loopres_f_res_f_res_208933 = add64((int64_t) 1,\n                                                               span_208901);\n                    \n                    loopres_f_res_208931 = loopres_f_res_f_res_208933;\n                }\n                loopres_208921 = loopres_f_res_208929;\n                loopres_208922 = loopres_f_res_208930;\n                loopres_208923 = loopres_f_res_208931;\n            }\n            \n            bool loop_cond_208934 = slt64(loopres_208923, min_res_203749);\n            bool loop_while_tmp_232836 = loop_cond_208934;\n            int64_t l_idx_tmp_232837 = loopres_208921;\n            int64_t r_idx_tmp_232838 = loopres_208922;\n            int64_t span_tmp_232839 = loopres_208923;\n            \n            loop_while_208898 = loop_while_tmp_232836;\n            l_idx_208899 = l_idx_tmp_232837;\n            r_idx_208900 = r_idx_tmp_232838;\n            span_208901 = span_tmp_232839;\n        }\n        idx_208894 = loop_while_208898;\n        idx_208895 = l_idx_208899;\n        idx_208896 = r_idx_208900;\n        idx_208897 = span_208901;\n        \n        int64_t min_res_208935 = smin64(min_arg_208859, idx_208895);\n        int64_t max_res_208936 = smax64((int64_t) 0, min_res_208935);\n        int64_t defunc_0_m_fun_res_208937;\n        \n        if (cond_208863) {\n            defunc_0_m",
            "_fun_res_208937 = (int64_t) 0;\n        } else {\n            int64_t y_208938 = sub64(s_n_m_203636, (int64_t) 1);\n            bool cond_208939 = gtid_208855 == y_208938;\n            int64_t defunc_0_m_fun_res_f_res_208940;\n            \n            if (cond_208939) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_208941 =\n                        sub64(pad_css_len_203632, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_208940 =\n                    defunc_0_m_fun_res_f_res_t_res_208941;\n            } else {\n                int64_t x_208942 = sub64(gtid_208855, (int64_t) 1);\n                int64_t x_208943 = mul64(jump_s_203499, x_208942);\n                int64_t min_arg_208944 = add64((int64_t) 1, x_208943);\n                int64_t min_res_208945 = smin64(defunc_0_f_res_203631,\n                                                min_arg_208944);\n                \n                defunc_0_m_fun_res_f_res_208940 = min_res_208945;\n            }\n            defunc_0_m_fun_res_208937 = defunc_0_m_fun_res_f_res_208940;\n        }\n        \n        int64_t x_208946 = add64(min_res_208860, max_res_208936);\n        int64_t r_208947 = sub64(x_208946, (int64_t) 1);\n        bool x_208948 = sle64((int64_t) 0, r_208947);\n        bool y_208949 = slt64(r_208947, defunc_0_f_res_203631);\n        bool bounds_check_208950 = x_208948 && y_208949;\n        bool index_certs_208951;\n        \n        if (!bounds_check_208950) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 15) == -1) {\n                    global_failure_args[0] = (int64_t) r_208947;\n                    global_failure_args[1] = (int64_t) defunc_0_f_res_203631;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        int64_t x_208952;\n        \n        x_208952 = ((__global int64_t *) mem_229331)[gtid_208853 *\n                                                     (defunc_0_f_res_203631 *\n                                       ",
            "               n_p_203492) +\n                                                     gtid_208854 *\n                                                     defunc_0_f_res_203631 +\n                                                     r_208947];\n        \n        int64_t abs_arg_208953 = sub64(x_208952, defunc_0_m_fun_res_208937);\n        int64_t abs_res_208954 = abs64(abs_arg_208953);\n        bool x_208955 = sle64((int64_t) 0, max_res_208936);\n        bool y_208956 = slt64(max_res_208936, defunc_0_f_res_203631);\n        bool bounds_check_208957 = x_208955 && y_208956;\n        bool index_certs_208958;\n        \n        if (!bounds_check_208957) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 16) == -1) {\n                    global_failure_args[0] = (int64_t) max_res_208936;\n                    global_failure_args[1] = (int64_t) defunc_0_f_res_203631;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        int64_t x_208959;\n        \n        x_208959 = ((__global int64_t *) mem_229331)[gtid_208853 *\n                                                     (defunc_0_f_res_203631 *\n                                                      n_p_203492) +\n                                                     gtid_208854 *\n                                                     defunc_0_f_res_203631 +\n                                                     max_res_208936];\n        \n        int64_t abs_arg_208960 = sub64(x_208959, defunc_0_m_fun_res_208937);\n        int64_t abs_res_208961 = abs64(abs_arg_208960);\n        int64_t max_res_208962 = smax64(abs_res_208954, abs_res_208961);\n        double defunc_0_f_res_208963 = sitofp_i64_f64(max_res_208962);\n        double defunc_1_f_res_208964 = max_res_208861 + defunc_0_f_res_208963;\n        \n        ((__global double *) mem_229354)[gtid_208853 * (s_n_m_203636 *\n                                                        n_p_203492) +\n                                        ",
            " gtid_208854 * s_n_m_203636 +\n                                         gtid_208855] = defunc_1_f_res_208964;\n        ((__global int64_t *) mem_229359)[gtid_208853 * (s_n_m_203636 *\n                                                         n_p_203492) +\n                                          gtid_208854 * s_n_m_203636 +\n                                          gtid_208855] = max_res_208936;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_208849\n}\n__kernel void mainzisegmap_209466(__global int *global_failure,\n                                  int64_t n_203490,\n                                  int64_t partition_sizze_203577, __global\n                                  unsigned char *ext_mem_229197, __global\n                                  unsigned char *mem_229388)\n{\n    #define segmap_group_sizze_209461 (mainzisegmap_group_sizze_209437)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_232866;\n    int32_t local_tid_232867;\n    int64_t group_sizze_232870;\n    int32_t wave_sizze_232869;\n    int32_t group_tid_232868;\n    \n    global_tid_232866 = get_global_id(0);\n    local_tid_232867 = get_local_id(0);\n    group_sizze_232870 = get_local_size(0);\n    wave_sizze_232869 = LOCKSTEP_WIDTH;\n    group_tid_232868 = get_group_id(0);\n    \n    int32_t phys_tid_209466 = global_tid_232866;\n    int64_t global_tid_232871 = sext_i32_i64(group_tid_232868) *\n            segmap_group_sizze_209461 + sext_i32_i64(local_tid_232867);\n    int64_t slice_232872 = n_203490;\n    int64_t slice_232873 = partition_sizze_203577 * slice_232872;\n    int64_t gtid_209464 = squot64(global_tid_232871, slice_232872);\n    int64_t remnant_232874 = global_tid_232871 - gtid_209464 * slice_232872;\n    int64_t gtid_209465 = remnant_232874;\n    int64_t remnant_232875 = remnant_232874 - gtid_209465;\n    \n    if (slt64(gtid_209464, partition_sizze_203577) && slt64(gtid_20946",
            "5,\n                                                            n_203490)) {\n        int64_t x_209467;\n        \n        x_209467 = ((__global int64_t *) ext_mem_229197)[gtid_209464 *\n                                                         n_203490 +\n                                                         gtid_209465];\n        \n        int64_t defunc_0_f_res_209468 = add64((int64_t) 1, x_209467);\n        \n        ((__global int64_t *) mem_229388)[gtid_209464 * n_203490 +\n                                          gtid_209465] = defunc_0_f_res_209468;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_209461\n}\n__kernel void mainzisegmap_209478(__global int *global_failure,\n                                  int64_t q_l_203495,\n                                  int64_t partition_sizze_203577,\n                                  int64_t min_res_203881, double i64_res_203887,\n                                  __global unsigned char *ext_mem_229196,\n                                  __global unsigned char *mem_229392, __global\n                                  unsigned char *mem_229395, __global\n                                  unsigned char *mem_229398, __global\n                                  unsigned char *mem_229401)\n{\n    #define segmap_group_sizze_209471 (mainzisegmap_group_sizze_209411)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_232876;\n    int32_t local_tid_232877;\n    int64_t group_sizze_232880;\n    int32_t wave_sizze_232879;\n    int32_t group_tid_232878;\n    \n    global_tid_232876 = get_global_id(0);\n    local_tid_232877 = get_local_id(0);\n    group_sizze_232880 = get_local_size(0);\n    wave_sizze_232879 = LOCKSTEP_WIDTH;\n    group_tid_232878 = get_group_id(0);\n    \n    int32_t phys_tid_209478 = global_tid_232876;\n    int64_t global_tid_232881 = sext_i32_i64(group_tid_232878) *\n            segmap_group_sizze_209471 + sex",
            "t_i32_i64(local_tid_232877);\n    int64_t slice_232882 = partition_sizze_203577;\n    int64_t gtid_209477 = global_tid_232881;\n    int64_t remnant_232883 = global_tid_232881 - gtid_209477;\n    \n    if (slt64(gtid_209477, partition_sizze_203577)) {\n        int64_t x_209479;\n        \n        x_209479 = ((__global int64_t *) ext_mem_229196)[gtid_209477];\n        \n        int64_t min_arg_209480 = sub64(x_209479, (int64_t) 1);\n        int64_t min_arg_209481 = sub64(x_209479, min_res_203881);\n        int64_t min_res_209482 = smin64(q_l_203495, x_209479);\n        double i64_res_209483 = sitofp_i64_f64(x_209479);\n        double x_209484 = i64_res_203887 - i64_res_209483;\n        double max_arg_209485 = x_209484 / 2.0;\n        double max_res_209486 = fmax64(0.0, max_arg_209485);\n        \n        ((__global int64_t *) mem_229392)[gtid_209477] = min_arg_209480;\n        ((__global int64_t *) mem_229395)[gtid_209477] = min_arg_209481;\n        ((__global int64_t *) mem_229398)[gtid_209477] = min_res_209482;\n        ((__global double *) mem_229401)[gtid_209477] = max_res_209486;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_209471\n}\n__kernel void mainzisegmap_209499(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203490, int64_t jump_l_203501,\n                                  int64_t partition_sizze_203577,\n                                  int64_t l_n_m_203643, int64_t i_203670,\n                                  unsigned char x_203671_bits,\n                                  int64_t min_res_203881,\n                                  unsigned char loop_cond_203886_bits, __global\n                                  unsigned char *ext_mem_229197, __global\n                                  unsigned char *mem_229388, __global\n                                  unsigned char *mem_229392, __global\n                     ",
            "             unsigned char *mem_229395, __global\n                                  unsigned char *mem_229398, __global\n                                  unsigned char *mem_229401, __global\n                                  unsigned char *mem_229406, __global\n                                  unsigned char *mem_229410)\n{\n    bool x_203671 = x_203671_bits;\n    bool loop_cond_203886 = loop_cond_203886_bits;\n    \n    #define segmap_group_sizze_209493 (mainzisegmap_group_sizze_209207)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_232884;\n    int32_t local_tid_232885;\n    int64_t group_sizze_232888;\n    int32_t wave_sizze_232887;\n    int32_t group_tid_232886;\n    \n    global_tid_232884 = get_global_id(0);\n    local_tid_232885 = get_local_id(0);\n    group_sizze_232888 = get_local_size(0);\n    wave_sizze_232887 = LOCKSTEP_WIDTH;\n    group_tid_232886 = get_group_id(0);\n    \n    int32_t phys_tid_209499 = global_tid_232884;\n    int64_t global_tid_232889 = sext_i32_i64(group_tid_232886) *\n            segmap_group_sizze_209493 + sext_i32_i64(local_tid_232885);\n    int64_t slice_232890 = l_n_m_203643;\n    int64_t slice_232891 = partition_sizze_203577 * slice_232890;\n    int64_t gtid_209497 = squot64(global_tid_232889, slice_232890);\n    int64_t remnant_232892 = global_tid_232889 - gtid_209497 * slice_232890;\n    int64_t gtid_209498 = remnant_232892;\n    int64_t remnant_232893 = remnant_232892 - gtid_209498;\n    \n    if (slt64(gtid_209497, partition_sizze_203577) && slt64(gtid_209498,\n                                                            l_n_m_203643)) {\n        int64_t min_arg_209502;\n        \n        min_arg_209502 = ((__global int64_t *) mem_229392)[gtid_209497];\n        \n        int64_t min_arg_209503;\n        \n        min_arg_209503 = ((__global int64_t *) mem_229395)[gtid_209497];\n        \n        int64_t min_res_209504;\n        \n        min_r",
            "es_209504 = ((__global int64_t *) mem_229398)[gtid_209497];\n        \n        double max_res_209505;\n        \n        max_res_209505 = ((__global double *) mem_229401)[gtid_209497];\n        \n        int64_t min_arg_209507 = mul64(jump_l_203501, gtid_209498);\n        int64_t min_res_209508 = smin64(i_203670, min_arg_209507);\n        int64_t defunc_0_g_res_209509 = add64((int64_t) 1, min_res_209508);\n        bool init_idx_209510;\n        int64_t init_idx_209511;\n        int64_t init_idx_209512;\n        bool loop_while_209513;\n        int64_t low_209514;\n        int64_t high_209515;\n        \n        loop_while_209513 = x_203671;\n        low_209514 = (int64_t) 0;\n        high_209515 = i_203670;\n        while (loop_while_209513) {\n            int64_t x_209516 = add64(low_209514, high_209515);\n            int64_t mid_209517 = sdiv64(x_209516, (int64_t) 2);\n            bool x_209518 = sle64((int64_t) 0, mid_209517);\n            bool y_209519 = slt64(mid_209517, n_203490);\n            bool bounds_check_209520 = x_209518 && y_209519;\n            bool index_certs_209521;\n            \n            if (!bounds_check_209520) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 22) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) mid_209517;\n                        global_failure_args[1] = (int64_t) n_203490;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            int64_t mid_id_209522;\n            \n            mid_id_209522 = ((__global int64_t *) mem_229388)[gtid_209497 *\n                                                              n_203490 +\n                                                              mid_209517];\n            \n            bool cond_209523 = slt64(mid_id_209522, (int64_t) 0);\n            int64_t mid_idx_209524;\n            \n            if (cond_209523) {\n                mid_idx_209524 = (int64_t) 9223372036",
            "854775807;\n            } else {\n                mid_idx_209524 = mid_id_209522;\n            }\n            \n            bool cond_209525 = sle64(defunc_0_g_res_209509, mid_idx_209524);\n            int64_t loopres_209526;\n            int64_t loopres_209527;\n            \n            if (cond_209525) {\n                int64_t loopres_t_res_209528 = sub64(mid_209517, (int64_t) 1);\n                \n                loopres_209526 = low_209514;\n                loopres_209527 = loopres_t_res_209528;\n            } else {\n                int64_t loopres_f_res_209529 = add64((int64_t) 1, mid_209517);\n                \n                loopres_209526 = loopres_f_res_209529;\n                loopres_209527 = high_209515;\n            }\n            \n            bool loop_cond_209530 = sle64(loopres_209526, loopres_209527);\n            bool loop_while_tmp_232894 = loop_cond_209530;\n            int64_t low_tmp_232895 = loopres_209526;\n            int64_t high_tmp_232896 = loopres_209527;\n            \n            loop_while_209513 = loop_while_tmp_232894;\n            low_209514 = low_tmp_232895;\n            high_209515 = high_tmp_232896;\n        }\n        init_idx_209510 = loop_while_209513;\n        init_idx_209511 = low_209514;\n        init_idx_209512 = high_209515;\n        \n        bool idx_209531;\n        int64_t idx_209532;\n        int64_t idx_209533;\n        int64_t idx_209534;\n        bool loop_while_209535;\n        int64_t l_idx_209536;\n        int64_t r_idx_209537;\n        int64_t span_209538;\n        \n        loop_while_209535 = loop_cond_203886;\n        l_idx_209536 = init_idx_209511;\n        r_idx_209537 = init_idx_209511;\n        span_209538 = (int64_t) 1;\n        while (loop_while_209535) {\n            int64_t max_arg_209539 = sub64(l_idx_209536, (int64_t) 1);\n            int64_t max_res_209540 = smax64((int64_t) 0, max_arg_209539);\n            int64_t min_arg_209541 = add64((int64_t) 1, r_idx_209537);\n            int64_t min_res_209542 = smin64(min_arg_209502, min_arg_20954",
            "1);\n            bool x_209543 = sle64((int64_t) 0, max_res_209540);\n            bool y_209544 = slt64(max_res_209540, n_203490);\n            bool bounds_check_209545 = x_209543 && y_209544;\n            bool index_certs_209546;\n            \n            if (!bounds_check_209545) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 23) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) max_res_209540;\n                        global_failure_args[1] = (int64_t) n_203490;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            int64_t x_209547;\n            \n            x_209547 = ((__global int64_t *) mem_229388)[gtid_209497 *\n                                                         n_203490 +\n                                                         max_res_209540];\n            \n            int64_t abs_arg_209548 = sub64(x_209547, defunc_0_g_res_209509);\n            int64_t abs_res_209549 = abs64(abs_arg_209548);\n            bool x_209550 = sle64((int64_t) 0, min_res_209542);\n            bool y_209551 = slt64(min_res_209542, n_203490);\n            bool bounds_check_209552 = x_209550 && y_209551;\n            bool index_certs_209553;\n            \n            if (!bounds_check_209552) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 24) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) min_res_209542;\n                        global_failure_args[1] = (int64_t) n_203490;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            int64_t x_209554;\n            \n            x_209554 = ((__global int64_t *) mem_229388)[gtid_209497 *\n                                                         n_203490 +\n                                                         min_res_209542];\n  ",
            "          \n            int64_t abs_arg_209555 = sub64(x_209554, defunc_0_g_res_209509);\n            int64_t abs_res_209556 = abs64(abs_arg_209555);\n            bool cond_209557 = max_res_209540 == l_idx_209536;\n            int64_t loopres_209558;\n            int64_t loopres_209559;\n            int64_t loopres_209560;\n            \n            if (cond_209557) {\n                loopres_209558 = l_idx_209536;\n                loopres_209559 = r_idx_209537;\n                loopres_209560 = min_res_203881;\n            } else {\n                bool cond_209561 = slt64(abs_res_209549, abs_res_209556);\n                bool cond_f_res_209562 = min_res_209542 == r_idx_209537;\n                bool x_209563 = !cond_209561;\n                bool y_209564 = cond_f_res_209562 && x_209563;\n                bool cond_209565 = cond_209561 || y_209564;\n                int64_t loopres_f_res_209566;\n                \n                if (cond_209565) {\n                    loopres_f_res_209566 = max_res_209540;\n                } else {\n                    loopres_f_res_209566 = l_idx_209536;\n                }\n                \n                int64_t loopres_f_res_209567;\n                \n                if (cond_209565) {\n                    loopres_f_res_209567 = r_idx_209537;\n                } else {\n                    loopres_f_res_209567 = min_res_209542;\n                }\n                \n                int64_t loopres_f_res_209568;\n                \n                if (cond_209565) {\n                    int64_t loopres_f_res_t_res_209569 = add64((int64_t) 1,\n                                                               span_209538);\n                    \n                    loopres_f_res_209568 = loopres_f_res_t_res_209569;\n                } else {\n                    int64_t loopres_f_res_f_res_209570 = add64((int64_t) 1,\n                                                               span_209538);\n                    \n                    loopres_f_res_209568 = loopres_f_res_f_res_2095",
            "70;\n                }\n                loopres_209558 = loopres_f_res_209566;\n                loopres_209559 = loopres_f_res_209567;\n                loopres_209560 = loopres_f_res_209568;\n            }\n            \n            bool loop_cond_209571 = slt64(loopres_209560, min_res_203881);\n            bool loop_while_tmp_232897 = loop_cond_209571;\n            int64_t l_idx_tmp_232898 = loopres_209558;\n            int64_t r_idx_tmp_232899 = loopres_209559;\n            int64_t span_tmp_232900 = loopres_209560;\n            \n            loop_while_209535 = loop_while_tmp_232897;\n            l_idx_209536 = l_idx_tmp_232898;\n            r_idx_209537 = r_idx_tmp_232899;\n            span_209538 = span_tmp_232900;\n        }\n        idx_209531 = loop_while_209535;\n        idx_209532 = l_idx_209536;\n        idx_209533 = r_idx_209537;\n        idx_209534 = span_209538;\n        \n        int64_t min_res_209572 = smin64(min_arg_209503, idx_209532);\n        int64_t max_res_209573 = smax64((int64_t) 0, min_res_209572);\n        int64_t x_209574 = add64(min_res_209504, max_res_209573);\n        int64_t r_209575 = sub64(x_209574, (int64_t) 1);\n        bool x_209576 = sle64((int64_t) 0, r_209575);\n        bool y_209577 = slt64(r_209575, n_203490);\n        bool bounds_check_209578 = x_209576 && y_209577;\n        bool index_certs_209579;\n        \n        if (!bounds_check_209578) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 25) == -1) {\n                    global_failure_args[0] = (int64_t) r_209575;\n                    global_failure_args[1] = (int64_t) n_203490;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        int64_t x_209580;\n        \n        x_209580 = ((__global int64_t *) ext_mem_229197)[gtid_209497 *\n                                                         n_203490 + r_209575];\n        \n        int64_t abs_arg_209581 = sub64(x_209580, min_res_209508);\n        int64_t abs_res_209582 = abs64(abs",
            "_arg_209581);\n        bool x_209583 = sle64((int64_t) 0, max_res_209573);\n        bool y_209584 = slt64(max_res_209573, n_203490);\n        bool bounds_check_209585 = x_209583 && y_209584;\n        bool index_certs_209586;\n        \n        if (!bounds_check_209585) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 26) == -1) {\n                    global_failure_args[0] = (int64_t) max_res_209573;\n                    global_failure_args[1] = (int64_t) n_203490;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        int64_t x_209587;\n        \n        x_209587 = ((__global int64_t *) ext_mem_229197)[gtid_209497 *\n                                                         n_203490 +\n                                                         max_res_209573];\n        \n        int64_t abs_arg_209588 = sub64(x_209587, min_res_209508);\n        int64_t abs_res_209589 = abs64(abs_arg_209588);\n        int64_t max_res_209590 = smax64(abs_res_209582, abs_res_209589);\n        double defunc_0_f_res_209591 = sitofp_i64_f64(max_res_209590);\n        double defunc_1_f_res_209592 = max_res_209505 + defunc_0_f_res_209591;\n        \n        ((__global double *) mem_229406)[gtid_209497 * l_n_m_203643 +\n                                         gtid_209498] = defunc_1_f_res_209592;\n        ((__global int64_t *) mem_229410)[gtid_209497 * l_n_m_203643 +\n                                          gtid_209498] = max_res_209573;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_209493\n}\n__kernel void mainzisegmap_210092(__global int *global_failure,\n                                  int64_t n_203490,\n                                  int64_t partition_sizze_203577, __global\n                                  unsigned char *ext_mem_229197, __global\n                                  unsigned char *mem_229437)\n{\n    #define segmap_group_sizze_210087 (mainzisegmap_group_sizze_210063)\n    \n    const int block_dim0 =",
            " 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_232926;\n    int32_t local_tid_232927;\n    int64_t group_sizze_232930;\n    int32_t wave_sizze_232929;\n    int32_t group_tid_232928;\n    \n    global_tid_232926 = get_global_id(0);\n    local_tid_232927 = get_local_id(0);\n    group_sizze_232930 = get_local_size(0);\n    wave_sizze_232929 = LOCKSTEP_WIDTH;\n    group_tid_232928 = get_group_id(0);\n    \n    int32_t phys_tid_210092 = global_tid_232926;\n    int64_t global_tid_232931 = sext_i32_i64(group_tid_232928) *\n            segmap_group_sizze_210087 + sext_i32_i64(local_tid_232927);\n    int64_t slice_232932 = n_203490;\n    int64_t slice_232933 = partition_sizze_203577 * slice_232932;\n    int64_t gtid_210090 = squot64(global_tid_232931, slice_232932);\n    int64_t remnant_232934 = global_tid_232931 - gtid_210090 * slice_232932;\n    int64_t gtid_210091 = remnant_232934;\n    int64_t remnant_232935 = remnant_232934 - gtid_210091;\n    \n    if (slt64(gtid_210090, partition_sizze_203577) && slt64(gtid_210091,\n                                                            n_203490)) {\n        int64_t x_210093;\n        \n        x_210093 = ((__global int64_t *) ext_mem_229197)[gtid_210090 *\n                                                         n_203490 +\n                                                         gtid_210091];\n        \n        int64_t defunc_0_f_res_210094 = add64((int64_t) 1, x_210093);\n        \n        ((__global int64_t *) mem_229437)[gtid_210090 * n_203490 +\n                                          gtid_210091] = defunc_0_f_res_210094;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_210087\n}\n__kernel void mainzisegmap_210104(__global int *global_failure,\n                                  int64_t q_t_203494,\n                                  int64_t partition_sizze_203577,\n                                  int64_t min_res_203993, double i64_res_203999,\n      ",
            "                            __global unsigned char *ext_mem_229196,\n                                  __global unsigned char *mem_229441, __global\n                                  unsigned char *mem_229444, __global\n                                  unsigned char *mem_229447, __global\n                                  unsigned char *mem_229450)\n{\n    #define segmap_group_sizze_210097 (mainzisegmap_group_sizze_210037)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_232936;\n    int32_t local_tid_232937;\n    int64_t group_sizze_232940;\n    int32_t wave_sizze_232939;\n    int32_t group_tid_232938;\n    \n    global_tid_232936 = get_global_id(0);\n    local_tid_232937 = get_local_id(0);\n    group_sizze_232940 = get_local_size(0);\n    wave_sizze_232939 = LOCKSTEP_WIDTH;\n    group_tid_232938 = get_group_id(0);\n    \n    int32_t phys_tid_210104 = global_tid_232936;\n    int64_t global_tid_232941 = sext_i32_i64(group_tid_232938) *\n            segmap_group_sizze_210097 + sext_i32_i64(local_tid_232937);\n    int64_t slice_232942 = partition_sizze_203577;\n    int64_t gtid_210103 = global_tid_232941;\n    int64_t remnant_232943 = global_tid_232941 - gtid_210103;\n    \n    if (slt64(gtid_210103, partition_sizze_203577)) {\n        int64_t x_210105;\n        \n        x_210105 = ((__global int64_t *) ext_mem_229196)[gtid_210103];\n        \n        int64_t min_arg_210106 = sub64(x_210105, (int64_t) 1);\n        int64_t min_arg_210107 = sub64(x_210105, min_res_203993);\n        int64_t min_res_210108 = smin64(q_t_203494, x_210105);\n        double i64_res_210109 = sitofp_i64_f64(x_210105);\n        double x_210110 = i64_res_203999 - i64_res_210109;\n        double max_arg_210111 = x_210110 / 2.0;\n        double max_res_210112 = fmax64(0.0, max_arg_210111);\n        \n        ((__global int64_t *) mem_229441)[gtid_210103] = min_arg_210106;\n        ((__global int64_t *) mem_22944",
            "4)[gtid_210103] = min_arg_210107;\n        ((__global int64_t *) mem_229447)[gtid_210103] = min_res_210108;\n        ((__global double *) mem_229450)[gtid_210103] = max_res_210112;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_210097\n}\n__kernel void mainzisegmap_210125(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203490, int64_t jump_t_203500,\n                                  int64_t partition_sizze_203577,\n                                  int64_t t_n_m_203650, int64_t i_203670,\n                                  unsigned char x_203671_bits,\n                                  int64_t min_res_203993,\n                                  unsigned char loop_cond_203998_bits, __global\n                                  unsigned char *ext_mem_229197, __global\n                                  unsigned char *mem_229437, __global\n                                  unsigned char *mem_229441, __global\n                                  unsigned char *mem_229444, __global\n                                  unsigned char *mem_229447, __global\n                                  unsigned char *mem_229450, __global\n                                  unsigned char *mem_229455, __global\n                                  unsigned char *mem_229459)\n{\n    bool x_203671 = x_203671_bits;\n    bool loop_cond_203998 = loop_cond_203998_bits;\n    \n    #define segmap_group_sizze_210119 (mainzisegmap_group_sizze_209833)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_232944;\n    int32_t local_tid_232945;\n    int64_t group_sizze_232948;\n    int32_t wave_sizze_232947;\n    int32_t group_tid_232946;\n    \n    global_tid_232944 = get_global_id(0);\n    local_tid_232945 = get_local_id(0);\n    group_sizze_232948 ",
            "= get_local_size(0);\n    wave_sizze_232947 = LOCKSTEP_WIDTH;\n    group_tid_232946 = get_group_id(0);\n    \n    int32_t phys_tid_210125 = global_tid_232944;\n    int64_t global_tid_232949 = sext_i32_i64(group_tid_232946) *\n            segmap_group_sizze_210119 + sext_i32_i64(local_tid_232945);\n    int64_t slice_232950 = t_n_m_203650;\n    int64_t slice_232951 = partition_sizze_203577 * slice_232950;\n    int64_t gtid_210123 = squot64(global_tid_232949, slice_232950);\n    int64_t remnant_232952 = global_tid_232949 - gtid_210123 * slice_232950;\n    int64_t gtid_210124 = remnant_232952;\n    int64_t remnant_232953 = remnant_232952 - gtid_210124;\n    \n    if (slt64(gtid_210123, partition_sizze_203577) && slt64(gtid_210124,\n                                                            t_n_m_203650)) {\n        int64_t min_arg_210128;\n        \n        min_arg_210128 = ((__global int64_t *) mem_229441)[gtid_210123];\n        \n        int64_t min_arg_210129;\n        \n        min_arg_210129 = ((__global int64_t *) mem_229444)[gtid_210123];\n        \n        int64_t min_res_210130;\n        \n        min_res_210130 = ((__global int64_t *) mem_229447)[gtid_210123];\n        \n        double max_res_210131;\n        \n        max_res_210131 = ((__global double *) mem_229450)[gtid_210123];\n        \n        int64_t min_arg_210133 = mul64(jump_t_203500, gtid_210124);\n        int64_t min_res_210134 = smin64(i_203670, min_arg_210133);\n        int64_t defunc_0_g_res_210135 = add64((int64_t) 1, min_res_210134);\n        bool init_idx_210136;\n        int64_t init_idx_210137;\n        int64_t init_idx_210138;\n        bool loop_while_210139;\n        int64_t low_210140;\n        int64_t high_210141;\n        \n        loop_while_210139 = x_203671;\n        low_210140 = (int64_t) 0;\n        high_210141 = i_203670;\n        while (loop_while_210139) {\n            int64_t x_210142 = add64(low_210140, high_210141);\n            int64_t mid_210143 = sdiv64(x_210142, (int64_t) 2);\n            bool x_210144 = sle64((int",
            "64_t) 0, mid_210143);\n            bool y_210145 = slt64(mid_210143, n_203490);\n            bool bounds_check_210146 = x_210144 && y_210145;\n            bool index_certs_210147;\n            \n            if (!bounds_check_210146) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 32) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) mid_210143;\n                        global_failure_args[1] = (int64_t) n_203490;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            int64_t mid_id_210148;\n            \n            mid_id_210148 = ((__global int64_t *) mem_229437)[gtid_210123 *\n                                                              n_203490 +\n                                                              mid_210143];\n            \n            bool cond_210149 = slt64(mid_id_210148, (int64_t) 0);\n            int64_t mid_idx_210150;\n            \n            if (cond_210149) {\n                mid_idx_210150 = (int64_t) 9223372036854775807;\n            } else {\n                mid_idx_210150 = mid_id_210148;\n            }\n            \n            bool cond_210151 = sle64(defunc_0_g_res_210135, mid_idx_210150);\n            int64_t loopres_210152;\n            int64_t loopres_210153;\n            \n            if (cond_210151) {\n                int64_t loopres_t_res_210154 = sub64(mid_210143, (int64_t) 1);\n                \n                loopres_210152 = low_210140;\n                loopres_210153 = loopres_t_res_210154;\n            } else {\n                int64_t loopres_f_res_210155 = add64((int64_t) 1, mid_210143);\n                \n                loopres_210152 = loopres_f_res_210155;\n                loopres_210153 = high_210141;\n            }\n            \n            bool loop_cond_210156 = sle64(loopres_210152, loopres_210153);\n            bool loop_while_tmp_232954 = loop_cond_210156;\n            int64_t low_t",
            "mp_232955 = loopres_210152;\n            int64_t high_tmp_232956 = loopres_210153;\n            \n            loop_while_210139 = loop_while_tmp_232954;\n            low_210140 = low_tmp_232955;\n            high_210141 = high_tmp_232956;\n        }\n        init_idx_210136 = loop_while_210139;\n        init_idx_210137 = low_210140;\n        init_idx_210138 = high_210141;\n        \n        bool idx_210157;\n        int64_t idx_210158;\n        int64_t idx_210159;\n        int64_t idx_210160;\n        bool loop_while_210161;\n        int64_t l_idx_210162;\n        int64_t r_idx_210163;\n        int64_t span_210164;\n        \n        loop_while_210161 = loop_cond_203998;\n        l_idx_210162 = init_idx_210137;\n        r_idx_210163 = init_idx_210137;\n        span_210164 = (int64_t) 1;\n        while (loop_while_210161) {\n            int64_t max_arg_210165 = sub64(l_idx_210162, (int64_t) 1);\n            int64_t max_res_210166 = smax64((int64_t) 0, max_arg_210165);\n            int64_t min_arg_210167 = add64((int64_t) 1, r_idx_210163);\n            int64_t min_res_210168 = smin64(min_arg_210128, min_arg_210167);\n            bool x_210169 = sle64((int64_t) 0, max_res_210166);\n            bool y_210170 = slt64(max_res_210166, n_203490);\n            bool bounds_check_210171 = x_210169 && y_210170;\n            bool index_certs_210172;\n            \n            if (!bounds_check_210171) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 33) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) max_res_210166;\n                        global_failure_args[1] = (int64_t) n_203490;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            int64_t x_210173;\n            \n            x_210173 = ((__global int64_t *) mem_229437)[gtid_210123 *\n                                                         n_203490 +\n                                                ",
            "         max_res_210166];\n            \n            int64_t abs_arg_210174 = sub64(x_210173, defunc_0_g_res_210135);\n            int64_t abs_res_210175 = abs64(abs_arg_210174);\n            bool x_210176 = sle64((int64_t) 0, min_res_210168);\n            bool y_210177 = slt64(min_res_210168, n_203490);\n            bool bounds_check_210178 = x_210176 && y_210177;\n            bool index_certs_210179;\n            \n            if (!bounds_check_210178) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 34) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) min_res_210168;\n                        global_failure_args[1] = (int64_t) n_203490;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            int64_t x_210180;\n            \n            x_210180 = ((__global int64_t *) mem_229437)[gtid_210123 *\n                                                         n_203490 +\n                                                         min_res_210168];\n            \n            int64_t abs_arg_210181 = sub64(x_210180, defunc_0_g_res_210135);\n            int64_t abs_res_210182 = abs64(abs_arg_210181);\n            bool cond_210183 = max_res_210166 == l_idx_210162;\n            int64_t loopres_210184;\n            int64_t loopres_210185;\n            int64_t loopres_210186;\n            \n            if (cond_210183) {\n                loopres_210184 = l_idx_210162;\n                loopres_210185 = r_idx_210163;\n                loopres_210186 = min_res_203993;\n            } else {\n                bool cond_210187 = slt64(abs_res_210175, abs_res_210182);\n                bool cond_f_res_210188 = min_res_210168 == r_idx_210163;\n                bool x_210189 = !cond_210187;\n                bool y_210190 = cond_f_res_210188 && x_210189;\n                bool cond_210191 = cond_210187 || y_210190;\n                int64_t loopres_f_res_210192;\n           ",
            "     \n                if (cond_210191) {\n                    loopres_f_res_210192 = max_res_210166;\n                } else {\n                    loopres_f_res_210192 = l_idx_210162;\n                }\n                \n                int64_t loopres_f_res_210193;\n                \n                if (cond_210191) {\n                    loopres_f_res_210193 = r_idx_210163;\n                } else {\n                    loopres_f_res_210193 = min_res_210168;\n                }\n                \n                int64_t loopres_f_res_210194;\n                \n                if (cond_210191) {\n                    int64_t loopres_f_res_t_res_210195 = add64((int64_t) 1,\n                                                               span_210164);\n                    \n                    loopres_f_res_210194 = loopres_f_res_t_res_210195;\n                } else {\n                    int64_t loopres_f_res_f_res_210196 = add64((int64_t) 1,\n                                                               span_210164);\n                    \n                    loopres_f_res_210194 = loopres_f_res_f_res_210196;\n                }\n                loopres_210184 = loopres_f_res_210192;\n                loopres_210185 = loopres_f_res_210193;\n                loopres_210186 = loopres_f_res_210194;\n            }\n            \n            bool loop_cond_210197 = slt64(loopres_210186, min_res_203993);\n            bool loop_while_tmp_232957 = loop_cond_210197;\n            int64_t l_idx_tmp_232958 = loopres_210184;\n            int64_t r_idx_tmp_232959 = loopres_210185;\n            int64_t span_tmp_232960 = loopres_210186;\n            \n            loop_while_210161 = loop_while_tmp_232957;\n            l_idx_210162 = l_idx_tmp_232958;\n            r_idx_210163 = r_idx_tmp_232959;\n            span_210164 = span_tmp_232960;\n        }\n        idx_210157 = loop_while_210161;\n        idx_210158 = l_idx_210162;\n        idx_210159 = r_idx_210163;\n        idx_210160 = span_210164;\n        \n        int64_t min_res_",
            "210198 = smin64(min_arg_210129, idx_210158);\n        int64_t max_res_210199 = smax64((int64_t) 0, min_res_210198);\n        int64_t x_210200 = add64(min_res_210130, max_res_210199);\n        int64_t r_210201 = sub64(x_210200, (int64_t) 1);\n        bool x_210202 = sle64((int64_t) 0, r_210201);\n        bool y_210203 = slt64(r_210201, n_203490);\n        bool bounds_check_210204 = x_210202 && y_210203;\n        bool index_certs_210205;\n        \n        if (!bounds_check_210204) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 35) == -1) {\n                    global_failure_args[0] = (int64_t) r_210201;\n                    global_failure_args[1] = (int64_t) n_203490;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        int64_t x_210206;\n        \n        x_210206 = ((__global int64_t *) ext_mem_229197)[gtid_210123 *\n                                                         n_203490 + r_210201];\n        \n        int64_t abs_arg_210207 = sub64(x_210206, min_res_210134);\n        int64_t abs_res_210208 = abs64(abs_arg_210207);\n        bool x_210209 = sle64((int64_t) 0, max_res_210199);\n        bool y_210210 = slt64(max_res_210199, n_203490);\n        bool bounds_check_210211 = x_210209 && y_210210;\n        bool index_certs_210212;\n        \n        if (!bounds_check_210211) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 36) == -1) {\n                    global_failure_args[0] = (int64_t) max_res_210199;\n                    global_failure_args[1] = (int64_t) n_203490;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        int64_t x_210213;\n        \n        x_210213 = ((__global int64_t *) ext_mem_229197)[gtid_210123 *\n                                                         n_203490 +\n                                                         max_res_210199];\n        \n        int64_t abs_arg_210214 = sub64(x_210213, mi",
            "n_res_210134);\n        int64_t abs_res_210215 = abs64(abs_arg_210214);\n        int64_t max_res_210216 = smax64(abs_res_210208, abs_res_210215);\n        double defunc_0_f_res_210217 = sitofp_i64_f64(max_res_210216);\n        double defunc_1_f_res_210218 = max_res_210131 + defunc_0_f_res_210217;\n        \n        ((__global double *) mem_229455)[gtid_210123 * t_n_m_203650 +\n                                         gtid_210124] = defunc_1_f_res_210218;\n        ((__global int64_t *) mem_229459)[gtid_210123 * t_n_m_203650 +\n                                          gtid_210124] = max_res_210199;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_210119\n}\n__kernel void mainzisegmap_210267(__global int *global_failure,\n                                  int64_t n_203490,\n                                  int64_t partition_sizze_203577,\n                                  int64_t ctx_param_ext_229511, __global\n                                  unsigned char *mem_229161, __global\n                                  unsigned char *mem_param_229515, __global\n                                  unsigned char *mem_229520)\n{\n    #define segmap_group_sizze_210262 (mainzisegmap_group_sizze_210236)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233001;\n    int32_t local_tid_233002;\n    int64_t group_sizze_233005;\n    int32_t wave_sizze_233004;\n    int32_t group_tid_233003;\n    \n    global_tid_233001 = get_global_id(0);\n    local_tid_233002 = get_local_id(0);\n    group_sizze_233005 = get_local_size(0);\n    wave_sizze_233004 = LOCKSTEP_WIDTH;\n    group_tid_233003 = get_group_id(0);\n    \n    int32_t phys_tid_210267 = global_tid_233001;\n    int64_t global_tid_233006 = sext_i32_i64(group_tid_233003) *\n            segmap_group_sizze_210262 + sext_i32_i64(local_tid_233002);\n    int64_t slice_233007 = n_203490;\n    int64_t slice_233008 = partition_sizze_203577 *",
            " slice_233007;\n    int64_t gtid_210265 = squot64(global_tid_233006, slice_233007);\n    int64_t remnant_233009 = global_tid_233006 - gtid_210265 * slice_233007;\n    int64_t gtid_210266 = remnant_233009;\n    int64_t remnant_233010 = remnant_233009 - gtid_210266;\n    \n    if (slt64(gtid_210265, partition_sizze_203577) && slt64(gtid_210266,\n                                                            n_203490)) {\n        double x_210268;\n        \n        x_210268 = ((__global double *) mem_229161)[gtid_210265 * n_203490 +\n                                                    gtid_210266];\n        \n        double x_210269;\n        \n        x_210269 = ((__global double *) mem_param_229515)[gtid_210265 *\n                                                          ctx_param_ext_229511 +\n                                                          gtid_210266];\n        \n        double defunc_1_f_res_210270 = x_210268 - x_210269;\n        \n        ((__global double *) mem_229520)[gtid_210265 * n_203490 + gtid_210266] =\n            defunc_1_f_res_210270;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_210262\n}\n__kernel void mainzisegmap_210412(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203490, int64_t n_p_203492,\n                                  int64_t partition_sizze_203577,\n                                  int64_t defunc_0_f_res_203631,\n                                  int64_t i_203670,\n                                  int64_t ctx_param_ext_229488,\n                                  int64_t ctx_param_ext_229489,\n                                  int64_t ctx_param_ext_229491, __global\n                                  unsigned char *ext_mem_229265, __global\n                                  unsigned char *mem_param_229493, __global\n                                  unsigned char *mem_229520, __global\n   ",
            "                               unsigned char *mem_229526, __global\n                                  unsigned char *mem_229531)\n{\n    #define segmap_group_sizze_210405 (mainzisegmap_group_sizze_210299)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233011;\n    int32_t local_tid_233012;\n    int64_t group_sizze_233015;\n    int32_t wave_sizze_233014;\n    int32_t group_tid_233013;\n    \n    global_tid_233011 = get_global_id(0);\n    local_tid_233012 = get_local_id(0);\n    group_sizze_233015 = get_local_size(0);\n    wave_sizze_233014 = LOCKSTEP_WIDTH;\n    group_tid_233013 = get_group_id(0);\n    \n    int32_t phys_tid_210412 = global_tid_233011;\n    int64_t global_tid_233016 = sext_i32_i64(group_tid_233013) *\n            segmap_group_sizze_210405 + sext_i32_i64(local_tid_233012);\n    int64_t slice_233017 = defunc_0_f_res_203631;\n    int64_t slice_233018 = n_p_203492 * slice_233017;\n    int64_t slice_233019 = partition_sizze_203577 * slice_233018;\n    int64_t gtid_210409 = squot64(global_tid_233016, slice_233018);\n    int64_t remnant_233020 = global_tid_233016 - gtid_210409 * slice_233018;\n    int64_t gtid_210410 = squot64(remnant_233020, slice_233017);\n    int64_t remnant_233021 = remnant_233020 - gtid_210410 * slice_233017;\n    int64_t gtid_210411 = remnant_233021;\n    int64_t remnant_233022 = remnant_233021 - gtid_210411;\n    \n    if ((slt64(gtid_210409, partition_sizze_203577) && slt64(gtid_210410,\n                                                             n_p_203492)) &&\n        slt64(gtid_210411, defunc_0_f_res_203631)) {\n        int64_t x_210416;\n        \n        x_210416 = ((__global int64_t *) ext_mem_229265)[gtid_210409 *\n                                                         (defunc_0_f_res_203631 *\n                                                          n_p_203492) +\n                                                         gtid_21041",
            "0 *\n                                                         defunc_0_f_res_203631 +\n                                                         gtid_210411];\n        \n        int64_t x_210417 = mul64(n_p_203492, x_210416);\n        int64_t idx_210418 = add64(gtid_210410, x_210417);\n        bool cond_210419 = slt64(i_203670, idx_210418);\n        bool cond_f_res_210420 = slt64(x_210416, (int64_t) 0);\n        bool x_210421 = !cond_210419;\n        bool y_210422 = cond_f_res_210420 && x_210421;\n        bool cond_210423 = cond_210419 || y_210422;\n        double defunc_0_f_res_210424;\n        double defunc_0_f_res_210425;\n        \n        if (cond_210423) {\n            defunc_0_f_res_210424 = 0.0;\n            defunc_0_f_res_210425 = 0.0;\n        } else {\n            bool x_210426 = sle64((int64_t) 0, idx_210418);\n            bool y_210427 = slt64(idx_210418, n_203490);\n            bool bounds_check_210428 = x_210426 && y_210427;\n            bool index_certs_210429;\n            \n            if (!bounds_check_210428) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 37) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) idx_210418;\n                        global_failure_args[1] = (int64_t) n_203490;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            double defunc_0_f_res_f_res_210430;\n            \n            defunc_0_f_res_f_res_210430 = ((__global\n                                            double *) mem_229520)[gtid_210409 *\n                                                                  n_203490 +\n                                                                  idx_210418];\n            \n            double defunc_0_f_res_f_res_210431;\n            \n            defunc_0_f_res_f_res_210431 = ((__global\n                                            double *) mem_param_229493)[ctx_param_ext_229488 +\n                   ",
            "                                                     (gtid_210409 *\n                                                                         ctx_param_ext_229489 +\n                                                                         idx_210418 *\n                                                                         ctx_param_ext_229491)];\n            defunc_0_f_res_210424 = defunc_0_f_res_f_res_210430;\n            defunc_0_f_res_210425 = defunc_0_f_res_f_res_210431;\n        }\n        ((__global double *) mem_229526)[gtid_210409 * (defunc_0_f_res_203631 *\n                                                        n_p_203492) +\n                                         gtid_210410 * defunc_0_f_res_203631 +\n                                         gtid_210411] = defunc_0_f_res_210424;\n        ((__global double *) mem_229531)[gtid_210409 * (defunc_0_f_res_203631 *\n                                                        n_p_203492) +\n                                         gtid_210410 * defunc_0_f_res_203631 +\n                                         gtid_210411] = defunc_0_f_res_210425;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_210405\n}\n__kernel void mainzisegmap_210542(__global int *global_failure,\n                                  int64_t n_p_203492, int64_t q_s_203493,\n                                  int64_t jump_s_203499,\n                                  int64_t partition_sizze_203577,\n                                  int64_t defunc_0_f_res_203631,\n                                  int64_t pad_css_len_203632,\n                                  int64_t s_n_m_203636,\n                                  int64_t num_groups_210538,\n                                  int64_t num_threads_232109, __global\n                                  unsigned char *mem_229540, __global\n                                  unsigned char *mem_229543, __global\n                                  unsigned char *mem_229547, __global\n                                  unsi",
            "gned char *mem_229551, __global\n                                  unsigned char *mem_229555, __global\n                                  unsigned char *mem_229559, __global\n                                  unsigned char *mem_229608, __global\n                                  unsigned char *color_231986)\n{\n    #define segmap_group_sizze_210537 (mainzisegmap_group_sizze_210441)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233027;\n    int32_t local_tid_233028;\n    int64_t group_sizze_233031;\n    int32_t wave_sizze_233030;\n    int32_t group_tid_233029;\n    \n    global_tid_233027 = get_global_id(0);\n    local_tid_233028 = get_local_id(0);\n    group_sizze_233031 = get_local_size(0);\n    wave_sizze_233030 = LOCKSTEP_WIDTH;\n    group_tid_233029 = get_group_id(0);\n    \n    int32_t phys_tid_210542 = global_tid_233027;\n    int32_t phys_group_id_233032;\n    \n    phys_group_id_233032 = get_group_id(0);\n    for (int32_t i_233033 = 0; i_233033 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577,\n                                          segmap_group_sizze_210537)) -\n                   phys_group_id_233032, sext_i64_i32(num_groups_210538));\n         i_233033++) {\n        int32_t virt_group_id_233034 = phys_group_id_233032 + i_233033 *\n                sext_i64_i32(num_groups_210538);\n        int64_t global_tid_233035 = sext_i32_i64(virt_group_id_233034) *\n                segmap_group_sizze_210537 + sext_i32_i64(local_tid_233028);\n        int64_t slice_233036 = partition_sizze_203577;\n        int64_t gtid_210541 = global_tid_233035;\n        int64_t remnant_233037 = global_tid_233035 - gtid_210541;\n        \n        if (slt64(gtid_210541, partition_sizze_203577)) {\n            for (int64_t i_228927 = 0; i_228927 < n_p_203492; i_228927++) {\n                int64_t x_210553;\n                \n                x_210553 = ((__global int64_t *) mem_22",
            "9543)[i_228927 *\n                                                             partition_sizze_203577 +\n                                                             gtid_210541];\n                for (int64_t i_228931 = 0; i_228931 < s_n_m_203636;\n                     i_228931++) {\n                    int64_t x_210558;\n                    \n                    x_210558 = ((__global int64_t *) mem_229551)[i_228927 *\n                                                                 (partition_sizze_203577 *\n                                                                  s_n_m_203636) +\n                                                                 i_228931 *\n                                                                 partition_sizze_203577 +\n                                                                 gtid_210541];\n                    \n                    double x_210559;\n                    \n                    x_210559 = ((__global double *) mem_229540)[i_228927 *\n                                                                (partition_sizze_203577 *\n                                                                 s_n_m_203636) +\n                                                                i_228931 *\n                                                                partition_sizze_203577 +\n                                                                gtid_210541];\n                    \n                    bool cond_210560 = i_228931 == (int64_t) 0;\n                    int64_t defunc_0_m_fun_res_210561;\n                    \n                    if (cond_210560) {\n                        defunc_0_m_fun_res_210561 = (int64_t) 0;\n                    } else {\n                        int64_t y_210562 = sub64(s_n_m_203636, (int64_t) 1);\n                        bool cond_210563 = i_228931 == y_210562;\n                        int64_t defunc_0_m_fun_res_f_res_210564;\n                        \n                        if (cond_210563) {\n                            in",
            "t64_t defunc_0_m_fun_res_f_res_t_res_210565 =\n                                    sub64(pad_css_len_203632, (int64_t) 1);\n                            \n                            defunc_0_m_fun_res_f_res_210564 =\n                                defunc_0_m_fun_res_f_res_t_res_210565;\n                        } else {\n                            int64_t x_210566 = sub64(i_228931, (int64_t) 1);\n                            int64_t x_210567 = mul64(jump_s_203499, x_210566);\n                            int64_t min_arg_210568 = add64((int64_t) 1,\n                                                           x_210567);\n                            int64_t min_res_210569 =\n                                    smin64(defunc_0_f_res_203631,\n                                           min_arg_210568);\n                            \n                            defunc_0_m_fun_res_f_res_210564 = min_res_210569;\n                        }\n                        defunc_0_m_fun_res_210561 =\n                            defunc_0_m_fun_res_f_res_210564;\n                    }\n                    \n                    double defunc_2_reduce_res_210570;\n                    double redout_228447 = 0.0;\n                    \n                    for (int64_t i_228448 = 0; i_228448 < q_s_203493;\n                         i_228448++) {\n                        bool cond_210575 = sle64(x_210553, i_228448);\n                        int64_t defunc_0_f_res_210576;\n                        \n                        if (cond_210575) {\n                            defunc_0_f_res_210576 = (int64_t) 0;\n                        } else {\n                            int64_t i_210577 = add64(x_210558, i_228448);\n                            int64_t defunc_0_add_arg_210578;\n                            \n                            defunc_0_add_arg_210578 = ((__global\n                                                        int64_t *) mem_229559)[i_228927 *\n                                                                          ",
            "     (partition_sizze_203577 *\n                                                                                defunc_0_f_res_203631) +\n                                                                               i_210577 *\n                                                                               partition_sizze_203577 +\n                                                                               gtid_210541];\n                            \n                            int64_t defunc_1_add_res_210579 = add64((int64_t) 1,\n                                                                    defunc_0_add_arg_210578);\n                            \n                            defunc_0_f_res_210576 = defunc_1_add_res_210579;\n                        }\n                        \n                        double defunc_0_f_res_210580;\n                        \n                        if (cond_210575) {\n                            defunc_0_f_res_210580 = 0.0;\n                        } else {\n                            int64_t i_210581 = add64(x_210558, i_228448);\n                            double defunc_0_add_arg_210582;\n                            \n                            defunc_0_add_arg_210582 = ((__global\n                                                        double *) mem_229547)[i_228927 *\n                                                                              (partition_sizze_203577 *\n                                                                               defunc_0_f_res_203631) +\n                                                                              i_210581 *\n                                                                              partition_sizze_203577 +\n                                                                              gtid_210541];\n                            defunc_0_f_res_210580 = defunc_0_add_arg_210582;\n                        }\n                        \n                        int64_t binop_p_210583 = sub64(defunc_0_f_r",
            "es_210576,\n                                                       defunc_0_m_fun_res_210561);\n                        double defunc_0_f_res_210584 =\n                               sitofp_i64_f64(binop_p_210583);\n                        double abs_res_210585 = fabs(defunc_0_f_res_210584);\n                        double tmp1_210586 = abs_res_210585 / x_210559;\n                        double x_210587 = tmp1_210586 * tmp1_210586;\n                        double y_210588 = tmp1_210586 * x_210587;\n                        double tmp2_210589 = 1.0 - y_210588;\n                        double x_210590 = tmp2_210589 * tmp2_210589;\n                        double tmp3_210591 = tmp2_210589 * x_210590;\n                        double w_j_210592 = defunc_0_f_res_210580 * tmp3_210591;\n                        double defunc_1_op_res_210573 = w_j_210592 +\n                               redout_228447;\n                        double redout_tmp_233040 = defunc_1_op_res_210573;\n                        \n                        redout_228447 = redout_tmp_233040;\n                    }\n                    defunc_2_reduce_res_210570 = redout_228447;\n                    \n                    double a0_210593 = 1.0 / defunc_2_reduce_res_210570;\n                    int64_t defunc_0_m_fun_res_210594;\n                    \n                    if (cond_210560) {\n                        defunc_0_m_fun_res_210594 = (int64_t) 0;\n                    } else {\n                        int64_t y_210595 = sub64(s_n_m_203636, (int64_t) 1);\n                        bool cond_210596 = i_228931 == y_210595;\n                        int64_t defunc_0_m_fun_res_f_res_210597;\n                        \n                        if (cond_210596) {\n                            int64_t defunc_0_m_fun_res_f_res_t_res_210598 =\n                                    sub64(pad_css_len_203632, (int64_t) 1);\n                            \n                            defunc_0_m_fun_res_f_res_210597 =\n                                defunc_0_m_",
            "fun_res_f_res_t_res_210598;\n                        } else {\n                            int64_t x_210599 = sub64(i_228931, (int64_t) 1);\n                            int64_t x_210600 = mul64(jump_s_203499, x_210599);\n                            int64_t min_arg_210601 = add64((int64_t) 1,\n                                                           x_210600);\n                            int64_t min_res_210602 =\n                                    smin64(defunc_0_f_res_203631,\n                                           min_arg_210601);\n                            \n                            defunc_0_m_fun_res_f_res_210597 = min_res_210602;\n                        }\n                        defunc_0_m_fun_res_210594 =\n                            defunc_0_m_fun_res_f_res_210597;\n                    }\n                    \n                    double defunc_2_reduce_res_210603;\n                    double redout_228449 = 0.0;\n                    \n                    for (int64_t i_228450 = 0; i_228450 < q_s_203493;\n                         i_228450++) {\n                        bool cond_210608 = sle64(x_210553, i_228450);\n                        int64_t defunc_0_f_res_210609;\n                        \n                        if (cond_210608) {\n                            defunc_0_f_res_210609 = (int64_t) 0;\n                        } else {\n                            int64_t i_210610 = add64(x_210558, i_228450);\n                            int64_t defunc_0_add_arg_210611;\n                            \n                            defunc_0_add_arg_210611 = ((__global\n                                                        int64_t *) mem_229559)[i_228927 *\n                                                                               (partition_sizze_203577 *\n                                                                                defunc_0_f_res_203631) +\n                                                                               i_210610 *\n                              ",
            "                                                 partition_sizze_203577 +\n                                                                               gtid_210541];\n                            \n                            int64_t defunc_1_add_res_210612 = add64((int64_t) 1,\n                                                                    defunc_0_add_arg_210611);\n                            \n                            defunc_0_f_res_210609 = defunc_1_add_res_210612;\n                        }\n                        \n                        double defunc_0_f_res_210613;\n                        \n                        if (cond_210608) {\n                            defunc_0_f_res_210613 = 0.0;\n                        } else {\n                            int64_t i_210614 = add64(x_210558, i_228450);\n                            double defunc_0_add_arg_210615;\n                            \n                            defunc_0_add_arg_210615 = ((__global\n                                                        double *) mem_229547)[i_228927 *\n                                                                              (partition_sizze_203577 *\n                                                                               defunc_0_f_res_203631) +\n                                                                              i_210614 *\n                                                                              partition_sizze_203577 +\n                                                                              gtid_210541];\n                            defunc_0_f_res_210613 = defunc_0_add_arg_210615;\n                        }\n                        \n                        int64_t binop_p_210616 = sub64(defunc_0_f_res_210609,\n                                                       defunc_0_m_fun_res_210594);\n                        double defunc_0_f_res_210617 =\n                               sitofp_i64_f64(binop_p_210616);\n                        double abs_res_21061",
            "8 = fabs(defunc_0_f_res_210617);\n                        double tmp1_210619 = abs_res_210618 / x_210559;\n                        double x_210620 = tmp1_210619 * tmp1_210619;\n                        double y_210621 = tmp1_210619 * x_210620;\n                        double tmp2_210622 = 1.0 - y_210621;\n                        double x_210623 = tmp2_210622 * tmp2_210622;\n                        double tmp3_210624 = tmp2_210622 * x_210623;\n                        double tmp4_210625 = defunc_0_f_res_210613 *\n                               tmp3_210624;\n                        double defunc_0_f_res_210626;\n                        \n                        if (cond_210608) {\n                            defunc_0_f_res_210626 = 0.0;\n                        } else {\n                            int64_t i_210627 = add64(x_210558, i_228450);\n                            double defunc_0_add_arg_210628;\n                            \n                            defunc_0_add_arg_210628 = ((__global\n                                                        double *) mem_229555)[i_228927 *\n                                                                              (partition_sizze_203577 *\n                                                                               defunc_0_f_res_203631) +\n                                                                              i_210627 *\n                                                                              partition_sizze_203577 +\n                                                                              gtid_210541];\n                            defunc_0_f_res_210626 = defunc_0_add_arg_210628;\n                        }\n                        \n                        double x_210629 = a0_210593 * tmp4_210625;\n                        double defunc_9_fit_fun_res_210630 =\n                               defunc_0_f_res_210626 * x_210629;\n                        double defunc_1_op_res_210606 =\n                               defunc_9_fit_fun_re",
            "s_210630 + redout_228449;\n                        double redout_tmp_233041 = defunc_1_op_res_210606;\n                        \n                        redout_228449 = redout_tmp_233041;\n                    }\n                    defunc_2_reduce_res_210603 = redout_228449;\n                    ((__global double *) color_231986)[phys_tid_210542 +\n                                                       (i_228927 *\n                                                        (num_threads_232109 *\n                                                         s_n_m_203636) +\n                                                        i_228931 *\n                                                        num_threads_232109)] =\n                        defunc_2_reduce_res_210603;\n                }\n            }\n            for (int64_t i_233042 = 0; i_233042 < n_p_203492; i_233042++) {\n                for (int64_t i_233043 = 0; i_233043 < s_n_m_203636;\n                     i_233043++) {\n                    double tmp_233044;\n                    \n                    tmp_233044 = ((__global\n                                   double *) color_231986)[phys_tid_210542 +\n                                                           (i_233042 *\n                                                            (num_threads_232109 *\n                                                             s_n_m_203636) +\n                                                            i_233043 *\n                                                            num_threads_232109)];\n                    ((__global double *) mem_229608)[gtid_210541 + (i_233042 *\n                                                                    (partition_sizze_203577 *\n                                                                     s_n_m_203636) +\n                                                                    i_233043 *\n                                                                    partition_sizze_203577)] =\n                        tmp_23304",
            "4;\n                }\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_210537\n}\n__kernel void mainzisegmap_211682(__global int *global_failure,\n                                  int64_t n_p_203492, int64_t q_s_203493,\n                                  int64_t jump_s_203499,\n                                  int64_t partition_sizze_203577,\n                                  int64_t defunc_0_f_res_203631,\n                                  int64_t pad_css_len_203632,\n                                  int64_t s_n_m_203636,\n                                  int64_t num_groups_211662,\n                                  int64_t num_threads_232111, __global\n                                  unsigned char *ext_mem_229264, __global\n                                  unsigned char *mem_229612, __global\n                                  unsigned char *mem_229616, __global\n                                  unsigned char *mem_229620, __global\n                                  unsigned char *mem_229624, __global\n                                  unsigned char *mem_229628, __global\n                                  unsigned char *mem_229648, __global\n                                  unsigned char *color_231987)\n{\n    #define segmap_group_sizze_211661 (mainzisegmap_group_sizze_210636)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233045;\n    int32_t local_tid_233046;\n    int64_t group_sizze_233049;\n    int32_t wave_sizze_233048;\n    int32_t group_tid_233047;\n    \n    global_tid_233045 = get_global_id(0);\n    local_tid_233046 = get_local_id(0);\n    group_sizze_233049 = get_local_size(0);\n    wave_sizze_233048 = LOCKSTEP_WIDTH;\n    group_tid_233047 = get_group_id(0);\n    \n    int32_t phys_tid_211682 = global_tid_233045;\n    int32_t phys_group_id_233050;\n    \n    p",
            "hys_group_id_233050 = get_group_id(0);\n    for (int32_t i_233051 = 0; i_233051 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577 * n_p_203492,\n                                          segmap_group_sizze_211661)) -\n                   phys_group_id_233050, sext_i64_i32(num_groups_211662));\n         i_233051++) {\n        int32_t virt_group_id_233052 = phys_group_id_233050 + i_233051 *\n                sext_i64_i32(num_groups_211662);\n        int64_t global_tid_233053 = sext_i32_i64(virt_group_id_233052) *\n                segmap_group_sizze_211661 + sext_i32_i64(local_tid_233046);\n        int64_t slice_233054 = n_p_203492;\n        int64_t slice_233055 = partition_sizze_203577 * slice_233054;\n        int64_t gtid_211680 = squot64(global_tid_233053, slice_233054);\n        int64_t remnant_233056 = global_tid_233053 - gtid_211680 * slice_233054;\n        int64_t gtid_211681 = remnant_233056;\n        int64_t remnant_233057 = remnant_233056 - gtid_211681;\n        \n        if (slt64(gtid_211680, partition_sizze_203577) && slt64(gtid_211681,\n                                                                n_p_203492)) {\n            int64_t x_211686;\n            \n            x_211686 = ((__global int64_t *) ext_mem_229264)[gtid_211680 *\n                                                             n_p_203492 +\n                                                             gtid_211681];\n            for (int64_t i_228935 = 0; i_228935 < s_n_m_203636; i_228935++) {\n                int64_t x_211691;\n                \n                x_211691 = ((__global int64_t *) mem_229612)[i_228935 *\n                                                             (n_p_203492 *\n                                                              partition_sizze_203577) +\n                                                             gtid_211680 *\n                                                             n_p_203492 +\n                                                             gtid_211681];\n    ",
            "            \n                double x_211692;\n                \n                x_211692 = ((__global double *) mem_229616)[i_228935 *\n                                                            (n_p_203492 *\n                                                             partition_sizze_203577) +\n                                                            gtid_211680 *\n                                                            n_p_203492 +\n                                                            gtid_211681];\n                \n                bool cond_211693 = i_228935 == (int64_t) 0;\n                int64_t defunc_0_m_fun_res_211694;\n                \n                if (cond_211693) {\n                    defunc_0_m_fun_res_211694 = (int64_t) 0;\n                } else {\n                    int64_t y_211695 = sub64(s_n_m_203636, (int64_t) 1);\n                    bool cond_211696 = i_228935 == y_211695;\n                    int64_t defunc_0_m_fun_res_f_res_211697;\n                    \n                    if (cond_211696) {\n                        int64_t defunc_0_m_fun_res_f_res_t_res_211698 =\n                                sub64(pad_css_len_203632, (int64_t) 1);\n                        \n                        defunc_0_m_fun_res_f_res_211697 =\n                            defunc_0_m_fun_res_f_res_t_res_211698;\n                    } else {\n                        int64_t x_211699 = sub64(i_228935, (int64_t) 1);\n                        int64_t x_211700 = mul64(jump_s_203499, x_211699);\n                        int64_t min_arg_211701 = add64((int64_t) 1, x_211700);\n                        int64_t min_res_211702 = smin64(defunc_0_f_res_203631,\n                                                        min_arg_211701);\n                        \n                        defunc_0_m_fun_res_f_res_211697 = min_res_211702;\n                    }\n                    defunc_0_m_fun_res_211694 = defunc_0_m_fun_res_f_res_211697;\n                }\n                \n                double d",
            "efunc_2_reduce_res_211703;\n                double redout_228455 = 0.0;\n                \n                for (int64_t i_228456 = 0; i_228456 < q_s_203493; i_228456++) {\n                    bool cond_211708 = sle64(x_211686, i_228456);\n                    int64_t defunc_0_f_res_211709;\n                    \n                    if (cond_211708) {\n                        defunc_0_f_res_211709 = (int64_t) 0;\n                    } else {\n                        int64_t i_211710 = add64(x_211691, i_228456);\n                        int64_t defunc_0_add_arg_211711;\n                        \n                        defunc_0_add_arg_211711 = ((__global\n                                                    int64_t *) mem_229620)[i_211710 *\n                                                                           (n_p_203492 *\n                                                                            partition_sizze_203577) +\n                                                                           gtid_211680 *\n                                                                           n_p_203492 +\n                                                                           gtid_211681];\n                        \n                        int64_t defunc_1_add_res_211712 = add64((int64_t) 1,\n                                                                defunc_0_add_arg_211711);\n                        \n                        defunc_0_f_res_211709 = defunc_1_add_res_211712;\n                    }\n                    \n                    double defunc_0_f_res_211713;\n                    \n                    if (cond_211708) {\n                        defunc_0_f_res_211713 = 0.0;\n                    } else {\n                        int64_t i_211714 = add64(x_211691, i_228456);\n                        double defunc_0_add_arg_211715;\n                        \n                        defunc_0_add_arg_211715 = ((__global\n                                                    double *) mem_229624",
            ")[i_211714 *\n                                                                          (n_p_203492 *\n                                                                           partition_sizze_203577) +\n                                                                          gtid_211680 *\n                                                                          n_p_203492 +\n                                                                          gtid_211681];\n                        defunc_0_f_res_211713 = defunc_0_add_arg_211715;\n                    }\n                    \n                    int64_t binop_p_211716 = sub64(defunc_0_f_res_211709,\n                                                   defunc_0_m_fun_res_211694);\n                    double defunc_0_f_res_211717 =\n                           sitofp_i64_f64(binop_p_211716);\n                    double abs_res_211718 = fabs(defunc_0_f_res_211717);\n                    double tmp1_211719 = abs_res_211718 / x_211692;\n                    double x_211720 = tmp1_211719 * tmp1_211719;\n                    double y_211721 = tmp1_211719 * x_211720;\n                    double tmp2_211722 = 1.0 - y_211721;\n                    double x_211723 = tmp2_211722 * tmp2_211722;\n                    double tmp3_211724 = tmp2_211722 * x_211723;\n                    double w_j_211725 = defunc_0_f_res_211713 * tmp3_211724;\n                    double defunc_1_op_res_211706 = w_j_211725 + redout_228455;\n                    double redout_tmp_233059 = defunc_1_op_res_211706;\n                    \n                    redout_228455 = redout_tmp_233059;\n                }\n                defunc_2_reduce_res_211703 = redout_228455;\n                \n                double a0_211726 = 1.0 / defunc_2_reduce_res_211703;\n                int64_t defunc_0_m_fun_res_211727;\n                \n                if (cond_211693) {\n                    defunc_0_m_fun_res_211727 = (int64_t) 0;\n                } else {\n                    int64_t y_211728 = sub64",
            "(s_n_m_203636, (int64_t) 1);\n                    bool cond_211729 = i_228935 == y_211728;\n                    int64_t defunc_0_m_fun_res_f_res_211730;\n                    \n                    if (cond_211729) {\n                        int64_t defunc_0_m_fun_res_f_res_t_res_211731 =\n                                sub64(pad_css_len_203632, (int64_t) 1);\n                        \n                        defunc_0_m_fun_res_f_res_211730 =\n                            defunc_0_m_fun_res_f_res_t_res_211731;\n                    } else {\n                        int64_t x_211732 = sub64(i_228935, (int64_t) 1);\n                        int64_t x_211733 = mul64(jump_s_203499, x_211732);\n                        int64_t min_arg_211734 = add64((int64_t) 1, x_211733);\n                        int64_t min_res_211735 = smin64(defunc_0_f_res_203631,\n                                                        min_arg_211734);\n                        \n                        defunc_0_m_fun_res_f_res_211730 = min_res_211735;\n                    }\n                    defunc_0_m_fun_res_211727 = defunc_0_m_fun_res_f_res_211730;\n                }\n                \n                double defunc_2_reduce_res_211736;\n                double redout_228457 = 0.0;\n                \n                for (int64_t i_228458 = 0; i_228458 < q_s_203493; i_228458++) {\n                    bool cond_211741 = sle64(x_211686, i_228458);\n                    int64_t defunc_0_f_res_211742;\n                    \n                    if (cond_211741) {\n                        defunc_0_f_res_211742 = (int64_t) 0;\n                    } else {\n                        int64_t i_211743 = add64(x_211691, i_228458);\n                        int64_t defunc_0_add_arg_211744;\n                        \n                        defunc_0_add_arg_211744 = ((__global\n                                                    int64_t *) mem_229620)[i_211743 *\n                                                                           (n_p_203492 *\n   ",
            "                                                                         partition_sizze_203577) +\n                                                                           gtid_211680 *\n                                                                           n_p_203492 +\n                                                                           gtid_211681];\n                        \n                        int64_t defunc_1_add_res_211745 = add64((int64_t) 1,\n                                                                defunc_0_add_arg_211744);\n                        \n                        defunc_0_f_res_211742 = defunc_1_add_res_211745;\n                    }\n                    \n                    double defunc_0_f_res_211746;\n                    \n                    if (cond_211741) {\n                        defunc_0_f_res_211746 = 0.0;\n                    } else {\n                        int64_t i_211747 = add64(x_211691, i_228458);\n                        double defunc_0_add_arg_211748;\n                        \n                        defunc_0_add_arg_211748 = ((__global\n                                                    double *) mem_229624)[i_211747 *\n                                                                          (n_p_203492 *\n                                                                           partition_sizze_203577) +\n                                                                          gtid_211680 *\n                                                                          n_p_203492 +\n                                                                          gtid_211681];\n                        defunc_0_f_res_211746 = defunc_0_add_arg_211748;\n                    }\n                    \n                    int64_t binop_p_211749 = sub64(defunc_0_f_res_211742,\n                                                   defunc_0_m_fun_res_211727);\n                    double defunc_0_f_res_211750 =\n                           sitofp_i64_f64",
            "(binop_p_211749);\n                    double abs_res_211751 = fabs(defunc_0_f_res_211750);\n                    double tmp1_211752 = abs_res_211751 / x_211692;\n                    double x_211753 = tmp1_211752 * tmp1_211752;\n                    double y_211754 = tmp1_211752 * x_211753;\n                    double tmp2_211755 = 1.0 - y_211754;\n                    double x_211756 = tmp2_211755 * tmp2_211755;\n                    double tmp3_211757 = tmp2_211755 * x_211756;\n                    double tmp4_211758 = defunc_0_f_res_211746 * tmp3_211757;\n                    double defunc_0_f_res_211759;\n                    \n                    if (cond_211741) {\n                        defunc_0_f_res_211759 = 0.0;\n                    } else {\n                        int64_t i_211760 = add64(x_211691, i_228458);\n                        double defunc_0_add_arg_211761;\n                        \n                        defunc_0_add_arg_211761 = ((__global\n                                                    double *) mem_229628)[i_211760 *\n                                                                          (n_p_203492 *\n                                                                           partition_sizze_203577) +\n                                                                          gtid_211680 *\n                                                                          n_p_203492 +\n                                                                          gtid_211681];\n                        defunc_0_f_res_211759 = defunc_0_add_arg_211761;\n                    }\n                    \n                    double x_211762 = a0_211726 * tmp4_211758;\n                    double defunc_9_fit_fun_res_211763 = defunc_0_f_res_211759 *\n                           x_211762;\n                    double defunc_1_op_res_211739 =\n                           defunc_9_fit_fun_res_211763 + redout_228457;\n                    double redout_tmp_233060 = defunc_1_op_res_211739;\n                ",
            "    \n                    redout_228457 = redout_tmp_233060;\n                }\n                defunc_2_reduce_res_211736 = redout_228457;\n                ((__global double *) color_231987)[phys_tid_211682 + i_228935 *\n                                                   num_threads_232111] =\n                    defunc_2_reduce_res_211736;\n            }\n            for (int64_t i_233061 = 0; i_233061 < s_n_m_203636; i_233061++) {\n                double tmp_233062;\n                \n                tmp_233062 = ((__global\n                               double *) color_231987)[phys_tid_211682 +\n                                                       i_233061 *\n                                                       num_threads_232111];\n                ((__global double *) mem_229648)[gtid_211680 * n_p_203492 +\n                                                 gtid_211681 + i_233061 *\n                                                 (n_p_203492 *\n                                                  partition_sizze_203577)] =\n                    tmp_233062;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_211661\n}\n__kernel void mainzisegmap_211890(__global int *global_failure,\n                                  int64_t n_p_203492, int64_t q_s_203493,\n                                  int64_t jump_s_203499,\n                                  int64_t partition_sizze_203577,\n                                  int64_t defunc_0_f_res_203631,\n                                  int64_t pad_css_len_203632,\n                                  int64_t s_n_m_203636, __global\n                                  unsigned char *ext_mem_229264, __global\n                                  unsigned char *ext_mem_229265, __global\n                                  unsigned char *ext_mem_229362, __global\n                                  unsigned char *ext_mem_229363, __global\n                                 ",
            " unsigned char *mem_229526, __global\n                                  unsigned char *mem_229531, __global\n                                  unsigned char *mem_229681)\n{\n    #define segmap_group_sizze_211879 (mainzisegmap_group_sizze_210971)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233119;\n    int32_t local_tid_233120;\n    int64_t group_sizze_233123;\n    int32_t wave_sizze_233122;\n    int32_t group_tid_233121;\n    \n    global_tid_233119 = get_global_id(0);\n    local_tid_233120 = get_local_id(0);\n    group_sizze_233123 = get_local_size(0);\n    wave_sizze_233122 = LOCKSTEP_WIDTH;\n    group_tid_233121 = get_group_id(0);\n    \n    int32_t phys_tid_211890 = global_tid_233119;\n    int64_t global_tid_233124 = sext_i32_i64(group_tid_233121) *\n            segmap_group_sizze_211879 + sext_i32_i64(local_tid_233120);\n    int64_t slice_233125 = s_n_m_203636;\n    int64_t slice_233126 = n_p_203492 * slice_233125;\n    int64_t slice_233127 = partition_sizze_203577 * slice_233126;\n    int64_t gtid_211887 = squot64(global_tid_233124, slice_233126);\n    int64_t remnant_233128 = global_tid_233124 - gtid_211887 * slice_233126;\n    int64_t gtid_211888 = squot64(remnant_233128, slice_233125);\n    int64_t remnant_233129 = remnant_233128 - gtid_211888 * slice_233125;\n    int64_t gtid_211889 = remnant_233129;\n    int64_t remnant_233130 = remnant_233129 - gtid_211889;\n    \n    if ((slt64(gtid_211887, partition_sizze_203577) && slt64(gtid_211888,\n                                                             n_p_203492)) &&\n        slt64(gtid_211889, s_n_m_203636)) {\n        int64_t x_211894;\n        \n        x_211894 = ((__global int64_t *) ext_mem_229264)[gtid_211887 *\n                                                         n_p_203492 +\n                                                         gtid_211888];\n        \n        int64_t x_211896;\n        \n        x_2118",
            "96 = ((__global int64_t *) ext_mem_229363)[gtid_211887 *\n                                                         (s_n_m_203636 *\n                                                          n_p_203492) +\n                                                         gtid_211888 *\n                                                         s_n_m_203636 +\n                                                         gtid_211889];\n        \n        double x_211897;\n        \n        x_211897 = ((__global double *) ext_mem_229362)[gtid_211887 *\n                                                        (s_n_m_203636 *\n                                                         n_p_203492) +\n                                                        gtid_211888 *\n                                                        s_n_m_203636 +\n                                                        gtid_211889];\n        \n        bool cond_211898 = gtid_211889 == (int64_t) 0;\n        int64_t defunc_0_m_fun_res_211899;\n        \n        if (cond_211898) {\n            defunc_0_m_fun_res_211899 = (int64_t) 0;\n        } else {\n            int64_t y_211900 = sub64(s_n_m_203636, (int64_t) 1);\n            bool cond_211901 = gtid_211889 == y_211900;\n            int64_t defunc_0_m_fun_res_f_res_211902;\n            \n            if (cond_211901) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_211903 =\n                        sub64(pad_css_len_203632, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_211902 =\n                    defunc_0_m_fun_res_f_res_t_res_211903;\n            } else {\n                int64_t x_211904 = sub64(gtid_211889, (int64_t) 1);\n                int64_t x_211905 = mul64(jump_s_203499, x_211904);\n                int64_t min_arg_211906 = add64((int64_t) 1, x_211905);\n                int64_t min_res_211907 = smin64(defunc_0_f_res_203631,\n                                                min_arg_211906);\n                \n                defunc_0_m_fun_res_f_res_211902 = mi",
            "n_res_211907;\n            }\n            defunc_0_m_fun_res_211899 = defunc_0_m_fun_res_f_res_211902;\n        }\n        \n        double defunc_2_reduce_res_211908;\n        double redout_228471 = 0.0;\n        \n        for (int64_t i_228472 = 0; i_228472 < q_s_203493; i_228472++) {\n            bool cond_211913 = sle64(x_211894, i_228472);\n            int64_t defunc_0_f_res_211914;\n            \n            if (cond_211913) {\n                defunc_0_f_res_211914 = (int64_t) 0;\n            } else {\n                int64_t i_211915 = add64(x_211896, i_228472);\n                int64_t defunc_0_add_arg_211916;\n                \n                defunc_0_add_arg_211916 = ((__global\n                                            int64_t *) ext_mem_229265)[gtid_211887 *\n                                                                       (defunc_0_f_res_203631 *\n                                                                        n_p_203492) +\n                                                                       gtid_211888 *\n                                                                       defunc_0_f_res_203631 +\n                                                                       i_211915];\n                \n                int64_t defunc_1_add_res_211917 = add64((int64_t) 1,\n                                                        defunc_0_add_arg_211916);\n                \n                defunc_0_f_res_211914 = defunc_1_add_res_211917;\n            }\n            \n            double defunc_0_f_res_211918;\n            \n            if (cond_211913) {\n                defunc_0_f_res_211918 = 0.0;\n            } else {\n                int64_t i_211919 = add64(x_211896, i_228472);\n                double defunc_0_add_arg_211920;\n                \n                defunc_0_add_arg_211920 = ((__global\n                                            double *) mem_229531)[gtid_211887 *\n                                                                  (defunc_0_f_res_203631 *\n           ",
            "                                                        n_p_203492) +\n                                                                  gtid_211888 *\n                                                                  defunc_0_f_res_203631 +\n                                                                  i_211919];\n                defunc_0_f_res_211918 = defunc_0_add_arg_211920;\n            }\n            \n            int64_t binop_p_211921 = sub64(defunc_0_f_res_211914,\n                                           defunc_0_m_fun_res_211899);\n            double defunc_0_f_res_211922 = sitofp_i64_f64(binop_p_211921);\n            double abs_res_211923 = fabs(defunc_0_f_res_211922);\n            double tmp1_211924 = abs_res_211923 / x_211897;\n            double x_211925 = tmp1_211924 * tmp1_211924;\n            double y_211926 = tmp1_211924 * x_211925;\n            double tmp2_211927 = 1.0 - y_211926;\n            double x_211928 = tmp2_211927 * tmp2_211927;\n            double tmp3_211929 = tmp2_211927 * x_211928;\n            double w_j_211930 = defunc_0_f_res_211918 * tmp3_211929;\n            double defunc_1_op_res_211911 = w_j_211930 + redout_228471;\n            double redout_tmp_233131 = defunc_1_op_res_211911;\n            \n            redout_228471 = redout_tmp_233131;\n        }\n        defunc_2_reduce_res_211908 = redout_228471;\n        \n        double a0_211931 = 1.0 / defunc_2_reduce_res_211908;\n        int64_t defunc_0_m_fun_res_211932;\n        \n        if (cond_211898) {\n            defunc_0_m_fun_res_211932 = (int64_t) 0;\n        } else {\n            int64_t y_211933 = sub64(s_n_m_203636, (int64_t) 1);\n            bool cond_211934 = gtid_211889 == y_211933;\n            int64_t defunc_0_m_fun_res_f_res_211935;\n            \n            if (cond_211934) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_211936 =\n                        sub64(pad_css_len_203632, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_211935 =\n                    de",
            "func_0_m_fun_res_f_res_t_res_211936;\n            } else {\n                int64_t x_211937 = sub64(gtid_211889, (int64_t) 1);\n                int64_t x_211938 = mul64(jump_s_203499, x_211937);\n                int64_t min_arg_211939 = add64((int64_t) 1, x_211938);\n                int64_t min_res_211940 = smin64(defunc_0_f_res_203631,\n                                                min_arg_211939);\n                \n                defunc_0_m_fun_res_f_res_211935 = min_res_211940;\n            }\n            defunc_0_m_fun_res_211932 = defunc_0_m_fun_res_f_res_211935;\n        }\n        \n        double defunc_2_reduce_res_211941;\n        double redout_228473 = 0.0;\n        \n        for (int64_t i_228474 = 0; i_228474 < q_s_203493; i_228474++) {\n            bool cond_211946 = sle64(x_211894, i_228474);\n            int64_t defunc_0_f_res_211947;\n            \n            if (cond_211946) {\n                defunc_0_f_res_211947 = (int64_t) 0;\n            } else {\n                int64_t i_211948 = add64(x_211896, i_228474);\n                int64_t defunc_0_add_arg_211949;\n                \n                defunc_0_add_arg_211949 = ((__global\n                                            int64_t *) ext_mem_229265)[gtid_211887 *\n                                                                       (defunc_0_f_res_203631 *\n                                                                        n_p_203492) +\n                                                                       gtid_211888 *\n                                                                       defunc_0_f_res_203631 +\n                                                                       i_211948];\n                \n                int64_t defunc_1_add_res_211950 = add64((int64_t) 1,\n                                                        defunc_0_add_arg_211949);\n                \n                defunc_0_f_res_211947 = defunc_1_add_res_211950;\n            }\n            \n            double defunc_0_f_res_211951;\n   ",
            "         \n            if (cond_211946) {\n                defunc_0_f_res_211951 = 0.0;\n            } else {\n                int64_t i_211952 = add64(x_211896, i_228474);\n                double defunc_0_add_arg_211953;\n                \n                defunc_0_add_arg_211953 = ((__global\n                                            double *) mem_229531)[gtid_211887 *\n                                                                  (defunc_0_f_res_203631 *\n                                                                   n_p_203492) +\n                                                                  gtid_211888 *\n                                                                  defunc_0_f_res_203631 +\n                                                                  i_211952];\n                defunc_0_f_res_211951 = defunc_0_add_arg_211953;\n            }\n            \n            int64_t binop_p_211954 = sub64(defunc_0_f_res_211947,\n                                           defunc_0_m_fun_res_211932);\n            double defunc_0_f_res_211955 = sitofp_i64_f64(binop_p_211954);\n            double abs_res_211956 = fabs(defunc_0_f_res_211955);\n            double tmp1_211957 = abs_res_211956 / x_211897;\n            double x_211958 = tmp1_211957 * tmp1_211957;\n            double y_211959 = tmp1_211957 * x_211958;\n            double tmp2_211960 = 1.0 - y_211959;\n            double x_211961 = tmp2_211960 * tmp2_211960;\n            double tmp3_211962 = tmp2_211960 * x_211961;\n            double tmp4_211963 = defunc_0_f_res_211951 * tmp3_211962;\n            double defunc_0_f_res_211964;\n            \n            if (cond_211946) {\n                defunc_0_f_res_211964 = 0.0;\n            } else {\n                int64_t i_211965 = add64(x_211896, i_228474);\n                double defunc_0_add_arg_211966;\n                \n                defunc_0_add_arg_211966 = ((__global\n                                            double *) mem_229526)[gtid_211887 *\n                             ",
            "                                     (defunc_0_f_res_203631 *\n                                                                   n_p_203492) +\n                                                                  gtid_211888 *\n                                                                  defunc_0_f_res_203631 +\n                                                                  i_211965];\n                defunc_0_f_res_211964 = defunc_0_add_arg_211966;\n            }\n            \n            double x_211967 = a0_211931 * tmp4_211963;\n            double defunc_9_fit_fun_res_211968 = defunc_0_f_res_211964 *\n                   x_211967;\n            double defunc_1_op_res_211944 = defunc_9_fit_fun_res_211968 +\n                   redout_228473;\n            double redout_tmp_233132 = defunc_1_op_res_211944;\n            \n            redout_228473 = redout_tmp_233132;\n        }\n        defunc_2_reduce_res_211941 = redout_228473;\n        ((__global double *) mem_229681)[gtid_211887 * (s_n_m_203636 *\n                                                        n_p_203492) +\n                                         gtid_211888 * s_n_m_203636 +\n                                         gtid_211889] =\n            defunc_2_reduce_res_211941;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_211879\n}\n__kernel void mainzisegmap_211979(__global int *global_failure,\n                                  int64_t n_p_203492, int64_t jump_s_203499,\n                                  int64_t partition_sizze_203577,\n                                  int64_t defunc_0_f_res_203631,\n                                  int64_t pad_css_len_203632,\n                                  int64_t s_n_m_203636, __global\n                                  unsigned char *mem_229687, __global\n                                  unsigned char *mem_229691)\n{\n    #define segmap_group_sizze_211972 (mainzisegmap_group_sizze_211232)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block",
            "_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233133;\n    int32_t local_tid_233134;\n    int64_t group_sizze_233137;\n    int32_t wave_sizze_233136;\n    int32_t group_tid_233135;\n    \n    global_tid_233133 = get_global_id(0);\n    local_tid_233134 = get_local_id(0);\n    group_sizze_233137 = get_local_size(0);\n    wave_sizze_233136 = LOCKSTEP_WIDTH;\n    group_tid_233135 = get_group_id(0);\n    \n    int32_t phys_tid_211979 = global_tid_233133;\n    int64_t global_tid_233138 = sext_i32_i64(group_tid_233135) *\n            segmap_group_sizze_211972 + sext_i32_i64(local_tid_233134);\n    int64_t slice_233139 = s_n_m_203636;\n    int64_t slice_233140 = n_p_203492 * slice_233139;\n    int64_t slice_233141 = partition_sizze_203577 * slice_233140;\n    int64_t gtid_211976 = squot64(global_tid_233138, slice_233140);\n    int64_t remnant_233142 = global_tid_233138 - gtid_211976 * slice_233140;\n    int64_t gtid_211977 = squot64(remnant_233142, slice_233139);\n    int64_t remnant_233143 = remnant_233142 - gtid_211977 * slice_233139;\n    int64_t gtid_211978 = remnant_233143;\n    int64_t remnant_233144 = remnant_233143 - gtid_211978;\n    \n    if ((slt64(gtid_211976, partition_sizze_203577) && slt64(gtid_211977,\n                                                             n_p_203492)) &&\n        slt64(gtid_211978, s_n_m_203636)) {\n        bool cond_211981 = gtid_211978 == (int64_t) 0;\n        int64_t defunc_0_m_fun_res_211982;\n        \n        if (cond_211981) {\n            defunc_0_m_fun_res_211982 = (int64_t) 0;\n        } else {\n            int64_t y_211983 = sub64(s_n_m_203636, (int64_t) 1);\n            bool cond_211984 = gtid_211978 == y_211983;\n            int64_t defunc_0_m_fun_res_f_res_211985;\n            \n            if (cond_211984) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_211986 =\n                        sub64(pad_css_len_203632, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_211985 =\n              ",
            "      defunc_0_m_fun_res_f_res_t_res_211986;\n            } else {\n                int64_t x_211987 = sub64(gtid_211978, (int64_t) 1);\n                int64_t x_211988 = mul64(jump_s_203499, x_211987);\n                int64_t min_arg_211989 = add64((int64_t) 1, x_211988);\n                int64_t min_res_211990 = smin64(defunc_0_f_res_203631,\n                                                min_arg_211989);\n                \n                defunc_0_m_fun_res_f_res_211985 = min_res_211990;\n            }\n            defunc_0_m_fun_res_211982 = defunc_0_m_fun_res_f_res_211985;\n        }\n        ((__global int64_t *) mem_229687)[gtid_211976 * (s_n_m_203636 *\n                                                         n_p_203492) +\n                                          gtid_211977 * s_n_m_203636 +\n                                          gtid_211978] =\n            defunc_0_m_fun_res_211982;\n        ((__global bool *) mem_229691)[gtid_211976 * (s_n_m_203636 *\n                                                      n_p_203492) +\n                                       gtid_211977 * s_n_m_203636 +\n                                       gtid_211978] = cond_211981;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_211972\n}\n__kernel void mainzisegmap_212051(__global int *global_failure,\n                                  int64_t n_p_203492, int64_t jump_s_203499,\n                                  int64_t partition_sizze_203577,\n                                  int64_t defunc_0_f_res_203631,\n                                  int64_t pad_css_len_203632,\n                                  int64_t s_n_m_203636, __global\n                                  unsigned char *mem_229697, __global\n                                  unsigned char *mem_229703, __global\n                                  unsigned char *mem_229708)\n{\n    #define segmap_group_sizze_212044 (mainzisegmap_group_sizze_211146)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int bloc",
            "k_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233221;\n    int32_t local_tid_233222;\n    int64_t group_sizze_233225;\n    int32_t wave_sizze_233224;\n    int32_t group_tid_233223;\n    \n    global_tid_233221 = get_global_id(0);\n    local_tid_233222 = get_local_id(0);\n    group_sizze_233225 = get_local_size(0);\n    wave_sizze_233224 = LOCKSTEP_WIDTH;\n    group_tid_233223 = get_group_id(0);\n    \n    int32_t phys_tid_212051 = global_tid_233221;\n    int64_t global_tid_233226 = sext_i32_i64(group_tid_233223) *\n            segmap_group_sizze_212044 + sext_i32_i64(local_tid_233222);\n    int64_t slice_233227 = s_n_m_203636;\n    int64_t slice_233228 = n_p_203492 * slice_233227;\n    int64_t slice_233229 = partition_sizze_203577 * slice_233228;\n    int64_t gtid_212048 = squot64(global_tid_233226, slice_233228);\n    int64_t remnant_233230 = global_tid_233226 - gtid_212048 * slice_233228;\n    int64_t gtid_212049 = squot64(remnant_233230, slice_233227);\n    int64_t remnant_233231 = remnant_233230 - gtid_212049 * slice_233227;\n    int64_t gtid_212050 = remnant_233231;\n    int64_t remnant_233232 = remnant_233231 - gtid_212050;\n    \n    if ((slt64(gtid_212048, partition_sizze_203577) && slt64(gtid_212049,\n                                                             n_p_203492)) &&\n        slt64(gtid_212050, s_n_m_203636)) {\n        bool index_primexp_228722 = gtid_212050 == (int64_t) 0;\n        double defunc_2_reduce_res_212054;\n        \n        defunc_2_reduce_res_212054 = ((__global\n                                       double *) mem_229697)[gtid_212048 *\n                                                             (s_n_m_203636 *\n                                                              n_p_203492) +\n                                                             gtid_212049 *\n                                                             s_n_m_203636 +\n                                                             gtid_212050];\n        \n   ",
            "     double a0_212055 = 1.0 / defunc_2_reduce_res_212054;\n        int64_t defunc_0_m_fun_res_212056;\n        \n        if (index_primexp_228722) {\n            defunc_0_m_fun_res_212056 = (int64_t) 0;\n        } else {\n            int64_t y_212057 = sub64(s_n_m_203636, (int64_t) 1);\n            bool cond_212058 = gtid_212050 == y_212057;\n            int64_t defunc_0_m_fun_res_f_res_212059;\n            \n            if (cond_212058) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_212060 =\n                        sub64(pad_css_len_203632, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_212059 =\n                    defunc_0_m_fun_res_f_res_t_res_212060;\n            } else {\n                int64_t x_212061 = sub64(gtid_212050, (int64_t) 1);\n                int64_t x_212062 = mul64(jump_s_203499, x_212061);\n                int64_t min_arg_212063 = add64((int64_t) 1, x_212062);\n                int64_t min_res_212064 = smin64(defunc_0_f_res_203631,\n                                                min_arg_212063);\n                \n                defunc_0_m_fun_res_f_res_212059 = min_res_212064;\n            }\n            defunc_0_m_fun_res_212056 = defunc_0_m_fun_res_f_res_212059;\n        }\n        ((__global double *) mem_229703)[gtid_212048 * (s_n_m_203636 *\n                                                        n_p_203492) +\n                                         gtid_212049 * s_n_m_203636 +\n                                         gtid_212050] = a0_212055;\n        ((__global int64_t *) mem_229708)[gtid_212048 * (s_n_m_203636 *\n                                                         n_p_203492) +\n                                          gtid_212049 * s_n_m_203636 +\n                                          gtid_212050] =\n            defunc_0_m_fun_res_212056;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_212044\n}\n__kernel void mainzisegmap_212265(__global int *global_failure,\n                                  int64_t n_",
            "p_203492, int64_t q_s_203493,\n                                  int64_t jump_s_203499,\n                                  int64_t partition_sizze_203577,\n                                  int64_t defunc_0_f_res_203631,\n                                  int64_t pad_css_len_203632,\n                                  int64_t s_n_m_203636,\n                                  int64_t num_groups_212260,\n                                  int64_t num_threads_232119, __global\n                                  unsigned char *mem_229734, __global\n                                  unsigned char *mem_229737, __global\n                                  unsigned char *mem_229741, __global\n                                  unsigned char *mem_229745, __global\n                                  unsigned char *mem_229749, __global\n                                  unsigned char *mem_229753, __global\n                                  unsigned char *mem_229846, __global\n                                  unsigned char *mem_229850, __global\n                                  unsigned char *color_231992, __global\n                                  unsigned char *color_231993)\n{\n    #define segmap_group_sizze_212259 (mainzisegmap_group_sizze_212133)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233317;\n    int32_t local_tid_233318;\n    int64_t group_sizze_233321;\n    int32_t wave_sizze_233320;\n    int32_t group_tid_233319;\n    \n    global_tid_233317 = get_global_id(0);\n    local_tid_233318 = get_local_id(0);\n    group_sizze_233321 = get_local_size(0);\n    wave_sizze_233320 = LOCKSTEP_WIDTH;\n    group_tid_233319 = get_group_id(0);\n    \n    int32_t phys_tid_212265 = global_tid_233317;\n    int32_t phys_group_id_233322;\n    \n    phys_group_id_233322 = get_group_id(0);\n    for (int32_t i_233323 = 0; i_233323 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577,\n  ",
            "                                        segmap_group_sizze_212259)) -\n                   phys_group_id_233322, sext_i64_i32(num_groups_212260));\n         i_233323++) {\n        int32_t virt_group_id_233324 = phys_group_id_233322 + i_233323 *\n                sext_i64_i32(num_groups_212260);\n        int64_t global_tid_233325 = sext_i32_i64(virt_group_id_233324) *\n                segmap_group_sizze_212259 + sext_i32_i64(local_tid_233318);\n        int64_t slice_233326 = partition_sizze_203577;\n        int64_t gtid_212264 = global_tid_233325;\n        int64_t remnant_233327 = global_tid_233325 - gtid_212264;\n        \n        if (slt64(gtid_212264, partition_sizze_203577)) {\n            for (int64_t i_228941 = 0; i_228941 < n_p_203492; i_228941++) {\n                int64_t x_212277;\n                \n                x_212277 = ((__global int64_t *) mem_229737)[i_228941 *\n                                                             partition_sizze_203577 +\n                                                             gtid_212264];\n                for (int64_t i_228948 = 0; i_228948 < s_n_m_203636;\n                     i_228948++) {\n                    int64_t x_212283;\n                    \n                    x_212283 = ((__global int64_t *) mem_229745)[i_228941 *\n                                                                 (partition_sizze_203577 *\n                                                                  s_n_m_203636) +\n                                                                 i_228948 *\n                                                                 partition_sizze_203577 +\n                                                                 gtid_212264];\n                    \n                    double x_212284;\n                    \n                    x_212284 = ((__global double *) mem_229734)[i_228941 *\n                                                                (partition_sizze_203577 *\n                                                                ",
            " s_n_m_203636) +\n                                                                i_228948 *\n                                                                partition_sizze_203577 +\n                                                                gtid_212264];\n                    \n                    bool cond_212285 = i_228948 == (int64_t) 0;\n                    int64_t defunc_0_m_fun_res_212286;\n                    \n                    if (cond_212285) {\n                        defunc_0_m_fun_res_212286 = (int64_t) 0;\n                    } else {\n                        int64_t y_212287 = sub64(s_n_m_203636, (int64_t) 1);\n                        bool cond_212288 = i_228948 == y_212287;\n                        int64_t defunc_0_m_fun_res_f_res_212289;\n                        \n                        if (cond_212288) {\n                            int64_t defunc_0_m_fun_res_f_res_t_res_212290 =\n                                    sub64(pad_css_len_203632, (int64_t) 1);\n                            \n                            defunc_0_m_fun_res_f_res_212289 =\n                                defunc_0_m_fun_res_f_res_t_res_212290;\n                        } else {\n                            int64_t x_212291 = sub64(i_228948, (int64_t) 1);\n                            int64_t x_212292 = mul64(jump_s_203499, x_212291);\n                            int64_t min_arg_212293 = add64((int64_t) 1,\n                                                           x_212292);\n                            int64_t min_res_212294 =\n                                    smin64(defunc_0_f_res_203631,\n                                           min_arg_212293);\n                            \n                            defunc_0_m_fun_res_f_res_212289 = min_res_212294;\n                        }\n                        defunc_0_m_fun_res_212286 =\n                            defunc_0_m_fun_res_f_res_212289;\n                    }\n                    \n                    double defunc_2_reduce_res_212295;\n    ",
            "                double defunc_2_reduce_res_212296;\n                    double defunc_2_reduce_res_212297;\n                    double redout_228489;\n                    double redout_228490;\n                    double redout_228491;\n                    \n                    redout_228489 = 0.0;\n                    redout_228490 = 0.0;\n                    redout_228491 = 0.0;\n                    for (int64_t i_228492 = 0; i_228492 < q_s_203493;\n                         i_228492++) {\n                        bool cond_212308 = sle64(x_212277, i_228492);\n                        int64_t defunc_0_f_res_212309;\n                        \n                        if (cond_212308) {\n                            defunc_0_f_res_212309 = (int64_t) 0;\n                        } else {\n                            int64_t i_212310 = add64(x_212283, i_228492);\n                            int64_t defunc_0_add_arg_212311;\n                            \n                            defunc_0_add_arg_212311 = ((__global\n                                                        int64_t *) mem_229753)[i_228941 *\n                                                                               (partition_sizze_203577 *\n                                                                                defunc_0_f_res_203631) +\n                                                                               i_212310 *\n                                                                               partition_sizze_203577 +\n                                                                               gtid_212264];\n                            \n                            int64_t defunc_1_add_res_212312 = add64((int64_t) 1,\n                                                                    defunc_0_add_arg_212311);\n                            \n                            defunc_0_f_res_212309 = defunc_1_add_res_212312;\n                        }\n                        \n                        double defunc_0_f_res_2",
            "12313;\n                        \n                        if (cond_212308) {\n                            defunc_0_f_res_212313 = 0.0;\n                        } else {\n                            int64_t i_212314 = add64(x_212283, i_228492);\n                            double defunc_0_add_arg_212315;\n                            \n                            defunc_0_add_arg_212315 = ((__global\n                                                        double *) mem_229741)[i_228941 *\n                                                                              (partition_sizze_203577 *\n                                                                               defunc_0_f_res_203631) +\n                                                                              i_212314 *\n                                                                              partition_sizze_203577 +\n                                                                              gtid_212264];\n                            defunc_0_f_res_212313 = defunc_0_add_arg_212315;\n                        }\n                        \n                        int64_t binop_p_212316 = sub64(defunc_0_f_res_212309,\n                                                       defunc_0_m_fun_res_212286);\n                        double defunc_0_f_res_212317 =\n                               sitofp_i64_f64(binop_p_212316);\n                        double abs_res_212318 = fabs(defunc_0_f_res_212317);\n                        double tmp1_212319 = abs_res_212318 / x_212284;\n                        double x_212320 = tmp1_212319 * tmp1_212319;\n                        double y_212321 = tmp1_212319 * x_212320;\n                        double tmp2_212322 = 1.0 - y_212321;\n                        double x_212323 = tmp2_212322 * tmp2_212322;\n                        double tmp3_212324 = tmp2_212322 * x_212323;\n                        double w_j_212325 = defunc_0_f_res_212313 * tmp3_212324;\n                        double xw_j_212326 = defunc_0_f",
            "_res_212317 * w_j_212325;\n                        double x2w_j_212327 = defunc_0_f_res_212317 *\n                               xw_j_212326;\n                        double defunc_1_op_res_212300 = w_j_212325 +\n                               redout_228489;\n                        double defunc_1_op_res_212303 = xw_j_212326 +\n                               redout_228490;\n                        double defunc_1_op_res_212306 = x2w_j_212327 +\n                               redout_228491;\n                        double redout_tmp_233332 = defunc_1_op_res_212300;\n                        double redout_tmp_233333 = defunc_1_op_res_212303;\n                        double redout_tmp_233334 = defunc_1_op_res_212306;\n                        \n                        redout_228489 = redout_tmp_233332;\n                        redout_228490 = redout_tmp_233333;\n                        redout_228491 = redout_tmp_233334;\n                    }\n                    defunc_2_reduce_res_212295 = redout_228489;\n                    defunc_2_reduce_res_212296 = redout_228490;\n                    defunc_2_reduce_res_212297 = redout_228491;\n                    \n                    double x_212328 = defunc_2_reduce_res_212295 *\n                           defunc_2_reduce_res_212297;\n                    double y_212329 = defunc_2_reduce_res_212296 *\n                           defunc_2_reduce_res_212296;\n                    double y_212330 = x_212328 - y_212329;\n                    double det1_212331 = 1.0 / y_212330;\n                    double a11_212332 = defunc_2_reduce_res_212297 *\n                           det1_212331;\n                    double x_212333 = 0.0 - defunc_2_reduce_res_212296;\n                    double b11_212334 = det1_212331 * x_212333;\n                    double c11_212335 = defunc_2_reduce_res_212295 *\n                           det1_212331;\n                    int64_t defunc_0_m_fun_res_212336;\n                    \n                    if (cond_212285) {\n                     ",
            "   defunc_0_m_fun_res_212336 = (int64_t) 0;\n                    } else {\n                        int64_t y_212337 = sub64(s_n_m_203636, (int64_t) 1);\n                        bool cond_212338 = i_228948 == y_212337;\n                        int64_t defunc_0_m_fun_res_f_res_212339;\n                        \n                        if (cond_212338) {\n                            int64_t defunc_0_m_fun_res_f_res_t_res_212340 =\n                                    sub64(pad_css_len_203632, (int64_t) 1);\n                            \n                            defunc_0_m_fun_res_f_res_212339 =\n                                defunc_0_m_fun_res_f_res_t_res_212340;\n                        } else {\n                            int64_t x_212341 = sub64(i_228948, (int64_t) 1);\n                            int64_t x_212342 = mul64(jump_s_203499, x_212341);\n                            int64_t min_arg_212343 = add64((int64_t) 1,\n                                                           x_212342);\n                            int64_t min_res_212344 =\n                                    smin64(defunc_0_f_res_203631,\n                                           min_arg_212343);\n                            \n                            defunc_0_m_fun_res_f_res_212339 = min_res_212344;\n                        }\n                        defunc_0_m_fun_res_212336 =\n                            defunc_0_m_fun_res_f_res_212339;\n                    }\n                    \n                    double defunc_2_reduce_res_212345;\n                    double defunc_2_reduce_res_212346;\n                    double redout_228493;\n                    double redout_228494;\n                    \n                    redout_228493 = 0.0;\n                    redout_228494 = 0.0;\n                    for (int64_t i_228495 = 0; i_228495 < q_s_203493;\n                         i_228495++) {\n                        bool cond_212354 = sle64(x_212277, i_228495);\n                        int64_t defunc_0_f_res_212355;\n        ",
            "                \n                        if (cond_212354) {\n                            defunc_0_f_res_212355 = (int64_t) 0;\n                        } else {\n                            int64_t i_212356 = add64(x_212283, i_228495);\n                            int64_t defunc_0_add_arg_212357;\n                            \n                            defunc_0_add_arg_212357 = ((__global\n                                                        int64_t *) mem_229753)[i_228941 *\n                                                                               (partition_sizze_203577 *\n                                                                                defunc_0_f_res_203631) +\n                                                                               i_212356 *\n                                                                               partition_sizze_203577 +\n                                                                               gtid_212264];\n                            \n                            int64_t defunc_1_add_res_212358 = add64((int64_t) 1,\n                                                                    defunc_0_add_arg_212357);\n                            \n                            defunc_0_f_res_212355 = defunc_1_add_res_212358;\n                        }\n                        \n                        double defunc_0_f_res_212359;\n                        \n                        if (cond_212354) {\n                            defunc_0_f_res_212359 = 0.0;\n                        } else {\n                            int64_t i_212360 = add64(x_212283, i_228495);\n                            double defunc_0_add_arg_212361;\n                            \n                            defunc_0_add_arg_212361 = ((__global\n                                                        double *) mem_229741)[i_228941 *\n                                                                              (partition_sizze_203577 *\n                                ",
            "                                               defunc_0_f_res_203631) +\n                                                                              i_212360 *\n                                                                              partition_sizze_203577 +\n                                                                              gtid_212264];\n                            defunc_0_f_res_212359 = defunc_0_add_arg_212361;\n                        }\n                        \n                        int64_t binop_p_212362 = sub64(defunc_0_f_res_212355,\n                                                       defunc_0_m_fun_res_212336);\n                        double defunc_0_f_res_212363 =\n                               sitofp_i64_f64(binop_p_212362);\n                        double abs_res_212364 = fabs(defunc_0_f_res_212363);\n                        double tmp1_212365 = abs_res_212364 / x_212284;\n                        double x_212366 = tmp1_212365 * tmp1_212365;\n                        double y_212367 = tmp1_212365 * x_212366;\n                        double tmp2_212368 = 1.0 - y_212367;\n                        double x_212369 = tmp2_212368 * tmp2_212368;\n                        double tmp3_212370 = tmp2_212368 * x_212369;\n                        double tmp4_212371 = defunc_0_f_res_212359 *\n                               tmp3_212370;\n                        double defunc_1_f_res_212372 = defunc_0_f_res_212363 *\n                               tmp4_212371;\n                        double defunc_0_f_res_212373;\n                        \n                        if (cond_212354) {\n                            defunc_0_f_res_212373 = 0.0;\n                        } else {\n                            int64_t i_212374 = add64(x_212283, i_228495);\n                            double defunc_0_add_arg_212375;\n                            \n                            defunc_0_add_arg_212375 = ((__global\n                                                        double *) mem_229749)[",
            "i_228941 *\n                                                                              (partition_sizze_203577 *\n                                                                               defunc_0_f_res_203631) +\n                                                                              i_212374 *\n                                                                              partition_sizze_203577 +\n                                                                              gtid_212264];\n                            defunc_0_f_res_212373 = defunc_0_add_arg_212375;\n                        }\n                        \n                        double x_212376 = a11_212332 * tmp4_212371;\n                        double y_212377 = b11_212334 * defunc_1_f_res_212372;\n                        double x_212378 = x_212376 + y_212377;\n                        double defunc_9_fit_fun_res_212379 =\n                               defunc_0_f_res_212373 * x_212378;\n                        double x_212380 = b11_212334 * tmp4_212371;\n                        double y_212381 = c11_212335 * defunc_1_f_res_212372;\n                        double x_212382 = x_212380 + y_212381;\n                        double defunc_9_slope_fun_res_212383 =\n                               defunc_0_f_res_212373 * x_212382;\n                        double defunc_1_op_res_212349 =\n                               defunc_9_fit_fun_res_212379 + redout_228493;\n                        double defunc_1_op_res_212352 =\n                               defunc_9_slope_fun_res_212383 + redout_228494;\n                        double redout_tmp_233335 = defunc_1_op_res_212349;\n                        double redout_tmp_233336 = defunc_1_op_res_212352;\n                        \n                        redout_228493 = redout_tmp_233335;\n                        redout_228494 = redout_tmp_233336;\n                    }\n                    defunc_2_reduce_res_212345 = redout_228493;\n                    defunc_2_reduce_res_212346 = red",
            "out_228494;\n                    ((__global double *) color_231993)[phys_tid_212265 +\n                                                       (i_228941 *\n                                                        (num_threads_232119 *\n                                                         s_n_m_203636) +\n                                                        i_228948 *\n                                                        num_threads_232119)] =\n                        defunc_2_reduce_res_212345;\n                    ((__global double *) color_231992)[phys_tid_212265 +\n                                                       (i_228941 *\n                                                        (num_threads_232119 *\n                                                         s_n_m_203636) +\n                                                        i_228948 *\n                                                        num_threads_232119)] =\n                        defunc_2_reduce_res_212346;\n                }\n            }\n            for (int64_t i_233337 = 0; i_233337 < n_p_203492; i_233337++) {\n                for (int64_t i_233338 = 0; i_233338 < s_n_m_203636;\n                     i_233338++) {\n                    double tmp_233339;\n                    \n                    tmp_233339 = ((__global\n                                   double *) color_231993)[phys_tid_212265 +\n                                                           (i_233337 *\n                                                            (num_threads_232119 *\n                                                             s_n_m_203636) +\n                                                            i_233338 *\n                                                            num_threads_232119)];\n                    ((__global double *) mem_229846)[gtid_212264 + (i_233337 *\n                                                                    (partition_sizze_203577 *\n                                                              ",
            "       s_n_m_203636) +\n                                                                    i_233338 *\n                                                                    partition_sizze_203577)] =\n                        tmp_233339;\n                }\n            }\n            for (int64_t i_233340 = 0; i_233340 < n_p_203492; i_233340++) {\n                for (int64_t i_233341 = 0; i_233341 < s_n_m_203636;\n                     i_233341++) {\n                    double tmp_233342;\n                    \n                    tmp_233342 = ((__global\n                                   double *) color_231992)[phys_tid_212265 +\n                                                           (i_233340 *\n                                                            (num_threads_232119 *\n                                                             s_n_m_203636) +\n                                                            i_233341 *\n                                                            num_threads_232119)];\n                    ((__global double *) mem_229850)[gtid_212264 + (i_233340 *\n                                                                    (partition_sizze_203577 *\n                                                                     s_n_m_203636) +\n                                                                    i_233341 *\n                                                                    partition_sizze_203577)] =\n                        tmp_233342;\n                }\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_212259\n}\n__kernel void mainzisegmap_213719(__global int *global_failure,\n                                  int64_t n_p_203492, int64_t q_s_203493,\n                                  int64_t jump_s_203499,\n                                  int64_t partition_sizze_203577,\n                                  int64_t defunc_0_f_res_203631,\n                      ",
            "            int64_t pad_css_len_203632,\n                                  int64_t s_n_m_203636,\n                                  int64_t num_groups_213697,\n                                  int64_t num_threads_232122, __global\n                                  unsigned char *ext_mem_229264, __global\n                                  unsigned char *mem_229854, __global\n                                  unsigned char *mem_229858, __global\n                                  unsigned char *mem_229862, __global\n                                  unsigned char *mem_229866, __global\n                                  unsigned char *mem_229870, __global\n                                  unsigned char *mem_229905, __global\n                                  unsigned char *mem_229909, __global\n                                  unsigned char *color_231994, __global\n                                  unsigned char *color_231995)\n{\n    #define segmap_group_sizze_213696 (mainzisegmap_group_sizze_212389)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233343;\n    int32_t local_tid_233344;\n    int64_t group_sizze_233347;\n    int32_t wave_sizze_233346;\n    int32_t group_tid_233345;\n    \n    global_tid_233343 = get_global_id(0);\n    local_tid_233344 = get_local_id(0);\n    group_sizze_233347 = get_local_size(0);\n    wave_sizze_233346 = LOCKSTEP_WIDTH;\n    group_tid_233345 = get_group_id(0);\n    \n    int32_t phys_tid_213719 = global_tid_233343;\n    int32_t phys_group_id_233348;\n    \n    phys_group_id_233348 = get_group_id(0);\n    for (int32_t i_233349 = 0; i_233349 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577 * n_p_203492,\n                                          segmap_group_sizze_213696)) -\n                   phys_group_id_233348, sext_i64_i32(num_groups_213697));\n         i_233349++) {\n        int32_t virt_group_id_233350 = phys_group_id_23",
            "3348 + i_233349 *\n                sext_i64_i32(num_groups_213697);\n        int64_t global_tid_233351 = sext_i32_i64(virt_group_id_233350) *\n                segmap_group_sizze_213696 + sext_i32_i64(local_tid_233344);\n        int64_t slice_233352 = n_p_203492;\n        int64_t slice_233353 = partition_sizze_203577 * slice_233352;\n        int64_t gtid_213717 = squot64(global_tid_233351, slice_233352);\n        int64_t remnant_233354 = global_tid_233351 - gtid_213717 * slice_233352;\n        int64_t gtid_213718 = remnant_233354;\n        int64_t remnant_233355 = remnant_233354 - gtid_213718;\n        \n        if (slt64(gtid_213717, partition_sizze_203577) && slt64(gtid_213718,\n                                                                n_p_203492)) {\n            int64_t x_213723;\n            \n            x_213723 = ((__global int64_t *) ext_mem_229264)[gtid_213717 *\n                                                             n_p_203492 +\n                                                             gtid_213718];\n            for (int64_t i_228955 = 0; i_228955 < s_n_m_203636; i_228955++) {\n                int64_t x_213729;\n                \n                x_213729 = ((__global int64_t *) mem_229854)[i_228955 *\n                                                             (n_p_203492 *\n                                                              partition_sizze_203577) +\n                                                             gtid_213717 *\n                                                             n_p_203492 +\n                                                             gtid_213718];\n                \n                double x_213730;\n                \n                x_213730 = ((__global double *) mem_229858)[i_228955 *\n                                                            (n_p_203492 *\n                                                             partition_sizze_203577) +\n                                                            gtid_213717 *\n                ",
            "                                            n_p_203492 +\n                                                            gtid_213718];\n                \n                bool cond_213731 = i_228955 == (int64_t) 0;\n                int64_t defunc_0_m_fun_res_213732;\n                \n                if (cond_213731) {\n                    defunc_0_m_fun_res_213732 = (int64_t) 0;\n                } else {\n                    int64_t y_213733 = sub64(s_n_m_203636, (int64_t) 1);\n                    bool cond_213734 = i_228955 == y_213733;\n                    int64_t defunc_0_m_fun_res_f_res_213735;\n                    \n                    if (cond_213734) {\n                        int64_t defunc_0_m_fun_res_f_res_t_res_213736 =\n                                sub64(pad_css_len_203632, (int64_t) 1);\n                        \n                        defunc_0_m_fun_res_f_res_213735 =\n                            defunc_0_m_fun_res_f_res_t_res_213736;\n                    } else {\n                        int64_t x_213737 = sub64(i_228955, (int64_t) 1);\n                        int64_t x_213738 = mul64(jump_s_203499, x_213737);\n                        int64_t min_arg_213739 = add64((int64_t) 1, x_213738);\n                        int64_t min_res_213740 = smin64(defunc_0_f_res_203631,\n                                                        min_arg_213739);\n                        \n                        defunc_0_m_fun_res_f_res_213735 = min_res_213740;\n                    }\n                    defunc_0_m_fun_res_213732 = defunc_0_m_fun_res_f_res_213735;\n                }\n                \n                double defunc_2_reduce_res_213741;\n                double defunc_2_reduce_res_213742;\n                double defunc_2_reduce_res_213743;\n                double redout_228500;\n                double redout_228501;\n                double redout_228502;\n                \n                redout_228500 = 0.0;\n                redout_228501 = 0.0;\n                redout_228502 = 0.0;\n              ",
            "  for (int64_t i_228503 = 0; i_228503 < q_s_203493; i_228503++) {\n                    bool cond_213754 = sle64(x_213723, i_228503);\n                    int64_t defunc_0_f_res_213755;\n                    \n                    if (cond_213754) {\n                        defunc_0_f_res_213755 = (int64_t) 0;\n                    } else {\n                        int64_t i_213756 = add64(x_213729, i_228503);\n                        int64_t defunc_0_add_arg_213757;\n                        \n                        defunc_0_add_arg_213757 = ((__global\n                                                    int64_t *) mem_229862)[i_213756 *\n                                                                           (n_p_203492 *\n                                                                            partition_sizze_203577) +\n                                                                           gtid_213717 *\n                                                                           n_p_203492 +\n                                                                           gtid_213718];\n                        \n                        int64_t defunc_1_add_res_213758 = add64((int64_t) 1,\n                                                                defunc_0_add_arg_213757);\n                        \n                        defunc_0_f_res_213755 = defunc_1_add_res_213758;\n                    }\n                    \n                    double defunc_0_f_res_213759;\n                    \n                    if (cond_213754) {\n                        defunc_0_f_res_213759 = 0.0;\n                    } else {\n                        int64_t i_213760 = add64(x_213729, i_228503);\n                        double defunc_0_add_arg_213761;\n                        \n                        defunc_0_add_arg_213761 = ((__global\n                                                    double *) mem_229866)[i_213760 *\n                                                                          (n_p_203492 *\n ",
            "                                                                          partition_sizze_203577) +\n                                                                          gtid_213717 *\n                                                                          n_p_203492 +\n                                                                          gtid_213718];\n                        defunc_0_f_res_213759 = defunc_0_add_arg_213761;\n                    }\n                    \n                    int64_t binop_p_213762 = sub64(defunc_0_f_res_213755,\n                                                   defunc_0_m_fun_res_213732);\n                    double defunc_0_f_res_213763 =\n                           sitofp_i64_f64(binop_p_213762);\n                    double abs_res_213764 = fabs(defunc_0_f_res_213763);\n                    double tmp1_213765 = abs_res_213764 / x_213730;\n                    double x_213766 = tmp1_213765 * tmp1_213765;\n                    double y_213767 = tmp1_213765 * x_213766;\n                    double tmp2_213768 = 1.0 - y_213767;\n                    double x_213769 = tmp2_213768 * tmp2_213768;\n                    double tmp3_213770 = tmp2_213768 * x_213769;\n                    double w_j_213771 = defunc_0_f_res_213759 * tmp3_213770;\n                    double xw_j_213772 = defunc_0_f_res_213763 * w_j_213771;\n                    double x2w_j_213773 = defunc_0_f_res_213763 * xw_j_213772;\n                    double defunc_1_op_res_213746 = w_j_213771 + redout_228500;\n                    double defunc_1_op_res_213749 = xw_j_213772 + redout_228501;\n                    double defunc_1_op_res_213752 = x2w_j_213773 +\n                           redout_228502;\n                    double redout_tmp_233358 = defunc_1_op_res_213746;\n                    double redout_tmp_233359 = defunc_1_op_res_213749;\n                    double redout_tmp_233360 = defunc_1_op_res_213752;\n                    \n                    redout_228500 = redout_tmp_233358;\n           ",
            "         redout_228501 = redout_tmp_233359;\n                    redout_228502 = redout_tmp_233360;\n                }\n                defunc_2_reduce_res_213741 = redout_228500;\n                defunc_2_reduce_res_213742 = redout_228501;\n                defunc_2_reduce_res_213743 = redout_228502;\n                \n                double x_213774 = defunc_2_reduce_res_213741 *\n                       defunc_2_reduce_res_213743;\n                double y_213775 = defunc_2_reduce_res_213742 *\n                       defunc_2_reduce_res_213742;\n                double y_213776 = x_213774 - y_213775;\n                double det1_213777 = 1.0 / y_213776;\n                double a11_213778 = defunc_2_reduce_res_213743 * det1_213777;\n                double x_213779 = 0.0 - defunc_2_reduce_res_213742;\n                double b11_213780 = det1_213777 * x_213779;\n                double c11_213781 = defunc_2_reduce_res_213741 * det1_213777;\n                int64_t defunc_0_m_fun_res_213782;\n                \n                if (cond_213731) {\n                    defunc_0_m_fun_res_213782 = (int64_t) 0;\n                } else {\n                    int64_t y_213783 = sub64(s_n_m_203636, (int64_t) 1);\n                    bool cond_213784 = i_228955 == y_213783;\n                    int64_t defunc_0_m_fun_res_f_res_213785;\n                    \n                    if (cond_213784) {\n                        int64_t defunc_0_m_fun_res_f_res_t_res_213786 =\n                                sub64(pad_css_len_203632, (int64_t) 1);\n                        \n                        defunc_0_m_fun_res_f_res_213785 =\n                            defunc_0_m_fun_res_f_res_t_res_213786;\n                    } else {\n                        int64_t x_213787 = sub64(i_228955, (int64_t) 1);\n                        int64_t x_213788 = mul64(jump_s_203499, x_213787);\n                        int64_t min_arg_213789 = add64((int64_t) 1, x_213788);\n                        int64_t min_res_213790 = smin64(defunc_0_f_res_2",
            "03631,\n                                                        min_arg_213789);\n                        \n                        defunc_0_m_fun_res_f_res_213785 = min_res_213790;\n                    }\n                    defunc_0_m_fun_res_213782 = defunc_0_m_fun_res_f_res_213785;\n                }\n                \n                double defunc_2_reduce_res_213791;\n                double defunc_2_reduce_res_213792;\n                double redout_228504;\n                double redout_228505;\n                \n                redout_228504 = 0.0;\n                redout_228505 = 0.0;\n                for (int64_t i_228506 = 0; i_228506 < q_s_203493; i_228506++) {\n                    bool cond_213800 = sle64(x_213723, i_228506);\n                    int64_t defunc_0_f_res_213801;\n                    \n                    if (cond_213800) {\n                        defunc_0_f_res_213801 = (int64_t) 0;\n                    } else {\n                        int64_t i_213802 = add64(x_213729, i_228506);\n                        int64_t defunc_0_add_arg_213803;\n                        \n                        defunc_0_add_arg_213803 = ((__global\n                                                    int64_t *) mem_229862)[i_213802 *\n                                                                           (n_p_203492 *\n                                                                            partition_sizze_203577) +\n                                                                           gtid_213717 *\n                                                                           n_p_203492 +\n                                                                           gtid_213718];\n                        \n                        int64_t defunc_1_add_res_213804 = add64((int64_t) 1,\n                                                                defunc_0_add_arg_213803);\n                        \n                        defunc_0_f_res_213801 = defunc_1_add_res_213804;\n                    }",
            "\n                    \n                    double defunc_0_f_res_213805;\n                    \n                    if (cond_213800) {\n                        defunc_0_f_res_213805 = 0.0;\n                    } else {\n                        int64_t i_213806 = add64(x_213729, i_228506);\n                        double defunc_0_add_arg_213807;\n                        \n                        defunc_0_add_arg_213807 = ((__global\n                                                    double *) mem_229866)[i_213806 *\n                                                                          (n_p_203492 *\n                                                                           partition_sizze_203577) +\n                                                                          gtid_213717 *\n                                                                          n_p_203492 +\n                                                                          gtid_213718];\n                        defunc_0_f_res_213805 = defunc_0_add_arg_213807;\n                    }\n                    \n                    int64_t binop_p_213808 = sub64(defunc_0_f_res_213801,\n                                                   defunc_0_m_fun_res_213782);\n                    double defunc_0_f_res_213809 =\n                           sitofp_i64_f64(binop_p_213808);\n                    double abs_res_213810 = fabs(defunc_0_f_res_213809);\n                    double tmp1_213811 = abs_res_213810 / x_213730;\n                    double x_213812 = tmp1_213811 * tmp1_213811;\n                    double y_213813 = tmp1_213811 * x_213812;\n                    double tmp2_213814 = 1.0 - y_213813;\n                    double x_213815 = tmp2_213814 * tmp2_213814;\n                    double tmp3_213816 = tmp2_213814 * x_213815;\n                    double tmp4_213817 = defunc_0_f_res_213805 * tmp3_213816;\n                    double defunc_1_f_res_213818 = defunc_0_f_res_213809 *\n                           tmp4_213817;\n          ",
            "          double defunc_0_f_res_213819;\n                    \n                    if (cond_213800) {\n                        defunc_0_f_res_213819 = 0.0;\n                    } else {\n                        int64_t i_213820 = add64(x_213729, i_228506);\n                        double defunc_0_add_arg_213821;\n                        \n                        defunc_0_add_arg_213821 = ((__global\n                                                    double *) mem_229870)[i_213820 *\n                                                                          (n_p_203492 *\n                                                                           partition_sizze_203577) +\n                                                                          gtid_213717 *\n                                                                          n_p_203492 +\n                                                                          gtid_213718];\n                        defunc_0_f_res_213819 = defunc_0_add_arg_213821;\n                    }\n                    \n                    double x_213822 = a11_213778 * tmp4_213817;\n                    double y_213823 = b11_213780 * defunc_1_f_res_213818;\n                    double x_213824 = x_213822 + y_213823;\n                    double defunc_9_fit_fun_res_213825 = defunc_0_f_res_213819 *\n                           x_213824;\n                    double x_213826 = b11_213780 * tmp4_213817;\n                    double y_213827 = c11_213781 * defunc_1_f_res_213818;\n                    double x_213828 = x_213826 + y_213827;\n                    double defunc_9_slope_fun_res_213829 =\n                           defunc_0_f_res_213819 * x_213828;\n                    double defunc_1_op_res_213795 =\n                           defunc_9_fit_fun_res_213825 + redout_228504;\n                    double defunc_1_op_res_213798 =\n                           defunc_9_slope_fun_res_213829 + redout_228505;\n                    double redout_tmp_233361 = defunc_1_op_res_213795;\n",
            "                    double redout_tmp_233362 = defunc_1_op_res_213798;\n                    \n                    redout_228504 = redout_tmp_233361;\n                    redout_228505 = redout_tmp_233362;\n                }\n                defunc_2_reduce_res_213791 = redout_228504;\n                defunc_2_reduce_res_213792 = redout_228505;\n                ((__global double *) color_231995)[phys_tid_213719 + i_228955 *\n                                                   num_threads_232122] =\n                    defunc_2_reduce_res_213791;\n                ((__global double *) color_231994)[phys_tid_213719 + i_228955 *\n                                                   num_threads_232122] =\n                    defunc_2_reduce_res_213792;\n            }\n            for (int64_t i_233363 = 0; i_233363 < s_n_m_203636; i_233363++) {\n                double tmp_233364;\n                \n                tmp_233364 = ((__global\n                               double *) color_231995)[phys_tid_213719 +\n                                                       i_233363 *\n                                                       num_threads_232122];\n                ((__global double *) mem_229905)[gtid_213717 * n_p_203492 +\n                                                 gtid_213718 + i_233363 *\n                                                 (n_p_203492 *\n                                                  partition_sizze_203577)] =\n                    tmp_233364;\n            }\n            for (int64_t i_233365 = 0; i_233365 < s_n_m_203636; i_233365++) {\n                double tmp_233366;\n                \n                tmp_233366 = ((__global\n                               double *) color_231994)[phys_tid_213719 +\n                                                       i_233365 *\n                                                       num_threads_232122];\n                ((__global double *) mem_229909)[gtid_213717 * n_p_203492 +\n                                                 gtid_213718 +",
            " i_233365 *\n                                                 (n_p_203492 *\n                                                  partition_sizze_203577)] =\n                    tmp_233366;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_213696\n}\n__kernel void mainzisegmap_213994(__global int *global_failure,\n                                  int64_t n_p_203492, int64_t q_s_203493,\n                                  int64_t jump_s_203499,\n                                  int64_t partition_sizze_203577,\n                                  int64_t defunc_0_f_res_203631,\n                                  int64_t pad_css_len_203632,\n                                  int64_t s_n_m_203636, __global\n                                  unsigned char *ext_mem_229264, __global\n                                  unsigned char *ext_mem_229265, __global\n                                  unsigned char *ext_mem_229362, __global\n                                  unsigned char *ext_mem_229363, __global\n                                  unsigned char *mem_229526, __global\n                                  unsigned char *mem_229531, __global\n                                  unsigned char *mem_229962, __global\n                                  unsigned char *mem_229967)\n{\n    #define segmap_group_sizze_213981 (mainzisegmap_group_sizze_212822)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233449;\n    int32_t local_tid_233450;\n    int64_t group_sizze_233453;\n    int32_t wave_sizze_233452;\n    int32_t group_tid_233451;\n    \n    global_tid_233449 = get_global_id(0);\n    local_tid_233450 = get_local_id(0);\n    group_sizze_233453 = get_local_size(0);\n    wave_sizze_233452 = LOCKSTEP_WIDTH;\n    group_tid_233451 = get_group_id(0);\n    \n    int32_t phys_tid_213994 = global_tid_23",
            "3449;\n    int64_t global_tid_233454 = sext_i32_i64(group_tid_233451) *\n            segmap_group_sizze_213981 + sext_i32_i64(local_tid_233450);\n    int64_t slice_233455 = s_n_m_203636;\n    int64_t slice_233456 = n_p_203492 * slice_233455;\n    int64_t slice_233457 = partition_sizze_203577 * slice_233456;\n    int64_t gtid_213991 = squot64(global_tid_233454, slice_233456);\n    int64_t remnant_233458 = global_tid_233454 - gtid_213991 * slice_233456;\n    int64_t gtid_213992 = squot64(remnant_233458, slice_233455);\n    int64_t remnant_233459 = remnant_233458 - gtid_213992 * slice_233455;\n    int64_t gtid_213993 = remnant_233459;\n    int64_t remnant_233460 = remnant_233459 - gtid_213993;\n    \n    if ((slt64(gtid_213991, partition_sizze_203577) && slt64(gtid_213992,\n                                                             n_p_203492)) &&\n        slt64(gtid_213993, s_n_m_203636)) {\n        int64_t x_213998;\n        \n        x_213998 = ((__global int64_t *) ext_mem_229264)[gtid_213991 *\n                                                         n_p_203492 +\n                                                         gtid_213992];\n        \n        int64_t x_214000;\n        \n        x_214000 = ((__global int64_t *) ext_mem_229363)[gtid_213991 *\n                                                         (s_n_m_203636 *\n                                                          n_p_203492) +\n                                                         gtid_213992 *\n                                                         s_n_m_203636 +\n                                                         gtid_213993];\n        \n        double x_214001;\n        \n        x_214001 = ((__global double *) ext_mem_229362)[gtid_213991 *\n                                                        (s_n_m_203636 *\n                                                         n_p_203492) +\n                                                        gtid_213992 *\n                                                        s_n_m_20",
            "3636 +\n                                                        gtid_213993];\n        \n        bool cond_214002 = gtid_213993 == (int64_t) 0;\n        int64_t defunc_0_m_fun_res_214003;\n        \n        if (cond_214002) {\n            defunc_0_m_fun_res_214003 = (int64_t) 0;\n        } else {\n            int64_t y_214004 = sub64(s_n_m_203636, (int64_t) 1);\n            bool cond_214005 = gtid_213993 == y_214004;\n            int64_t defunc_0_m_fun_res_f_res_214006;\n            \n            if (cond_214005) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_214007 =\n                        sub64(pad_css_len_203632, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_214006 =\n                    defunc_0_m_fun_res_f_res_t_res_214007;\n            } else {\n                int64_t x_214008 = sub64(gtid_213993, (int64_t) 1);\n                int64_t x_214009 = mul64(jump_s_203499, x_214008);\n                int64_t min_arg_214010 = add64((int64_t) 1, x_214009);\n                int64_t min_res_214011 = smin64(defunc_0_f_res_203631,\n                                                min_arg_214010);\n                \n                defunc_0_m_fun_res_f_res_214006 = min_res_214011;\n            }\n            defunc_0_m_fun_res_214003 = defunc_0_m_fun_res_f_res_214006;\n        }\n        \n        double defunc_2_reduce_res_214012;\n        double defunc_2_reduce_res_214013;\n        double defunc_2_reduce_res_214014;\n        double redout_228519;\n        double redout_228520;\n        double redout_228521;\n        \n        redout_228519 = 0.0;\n        redout_228520 = 0.0;\n        redout_228521 = 0.0;\n        for (int64_t i_228522 = 0; i_228522 < q_s_203493; i_228522++) {\n            bool cond_214025 = sle64(x_213998, i_228522);\n            int64_t defunc_0_f_res_214026;\n            \n            if (cond_214025) {\n                defunc_0_f_res_214026 = (int64_t) 0;\n            } else {\n                int64_t i_214027 = add64(x_214000, i_228522);\n                in",
            "t64_t defunc_0_add_arg_214028;\n                \n                defunc_0_add_arg_214028 = ((__global\n                                            int64_t *) ext_mem_229265)[gtid_213991 *\n                                                                       (defunc_0_f_res_203631 *\n                                                                        n_p_203492) +\n                                                                       gtid_213992 *\n                                                                       defunc_0_f_res_203631 +\n                                                                       i_214027];\n                \n                int64_t defunc_1_add_res_214029 = add64((int64_t) 1,\n                                                        defunc_0_add_arg_214028);\n                \n                defunc_0_f_res_214026 = defunc_1_add_res_214029;\n            }\n            \n            double defunc_0_f_res_214030;\n            \n            if (cond_214025) {\n                defunc_0_f_res_214030 = 0.0;\n            } else {\n                int64_t i_214031 = add64(x_214000, i_228522);\n                double defunc_0_add_arg_214032;\n                \n                defunc_0_add_arg_214032 = ((__global\n                                            double *) mem_229531)[gtid_213991 *\n                                                                  (defunc_0_f_res_203631 *\n                                                                   n_p_203492) +\n                                                                  gtid_213992 *\n                                                                  defunc_0_f_res_203631 +\n                                                                  i_214031];\n                defunc_0_f_res_214030 = defunc_0_add_arg_214032;\n            }\n            \n            int64_t binop_p_214033 = sub64(defunc_0_f_res_214026,\n                                           defunc_0_m_fun_res_214003);\n            double defunc_0_f_res",
            "_214034 = sitofp_i64_f64(binop_p_214033);\n            double abs_res_214035 = fabs(defunc_0_f_res_214034);\n            double tmp1_214036 = abs_res_214035 / x_214001;\n            double x_214037 = tmp1_214036 * tmp1_214036;\n            double y_214038 = tmp1_214036 * x_214037;\n            double tmp2_214039 = 1.0 - y_214038;\n            double x_214040 = tmp2_214039 * tmp2_214039;\n            double tmp3_214041 = tmp2_214039 * x_214040;\n            double w_j_214042 = defunc_0_f_res_214030 * tmp3_214041;\n            double xw_j_214043 = defunc_0_f_res_214034 * w_j_214042;\n            double x2w_j_214044 = defunc_0_f_res_214034 * xw_j_214043;\n            double defunc_1_op_res_214017 = w_j_214042 + redout_228519;\n            double defunc_1_op_res_214020 = xw_j_214043 + redout_228520;\n            double defunc_1_op_res_214023 = x2w_j_214044 + redout_228521;\n            double redout_tmp_233461 = defunc_1_op_res_214017;\n            double redout_tmp_233462 = defunc_1_op_res_214020;\n            double redout_tmp_233463 = defunc_1_op_res_214023;\n            \n            redout_228519 = redout_tmp_233461;\n            redout_228520 = redout_tmp_233462;\n            redout_228521 = redout_tmp_233463;\n        }\n        defunc_2_reduce_res_214012 = redout_228519;\n        defunc_2_reduce_res_214013 = redout_228520;\n        defunc_2_reduce_res_214014 = redout_228521;\n        \n        double x_214045 = defunc_2_reduce_res_214012 *\n               defunc_2_reduce_res_214014;\n        double y_214046 = defunc_2_reduce_res_214013 *\n               defunc_2_reduce_res_214013;\n        double y_214047 = x_214045 - y_214046;\n        double det1_214048 = 1.0 / y_214047;\n        double a11_214049 = defunc_2_reduce_res_214014 * det1_214048;\n        double x_214050 = 0.0 - defunc_2_reduce_res_214013;\n        double b11_214051 = det1_214048 * x_214050;\n        double c11_214052 = defunc_2_reduce_res_214012 * det1_214048;\n        int64_t defunc_0_m_fun_res_214053;\n        \n        if (cond_2140",
            "02) {\n            defunc_0_m_fun_res_214053 = (int64_t) 0;\n        } else {\n            int64_t y_214054 = sub64(s_n_m_203636, (int64_t) 1);\n            bool cond_214055 = gtid_213993 == y_214054;\n            int64_t defunc_0_m_fun_res_f_res_214056;\n            \n            if (cond_214055) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_214057 =\n                        sub64(pad_css_len_203632, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_214056 =\n                    defunc_0_m_fun_res_f_res_t_res_214057;\n            } else {\n                int64_t x_214058 = sub64(gtid_213993, (int64_t) 1);\n                int64_t x_214059 = mul64(jump_s_203499, x_214058);\n                int64_t min_arg_214060 = add64((int64_t) 1, x_214059);\n                int64_t min_res_214061 = smin64(defunc_0_f_res_203631,\n                                                min_arg_214060);\n                \n                defunc_0_m_fun_res_f_res_214056 = min_res_214061;\n            }\n            defunc_0_m_fun_res_214053 = defunc_0_m_fun_res_f_res_214056;\n        }\n        \n        double defunc_2_reduce_res_214062;\n        double defunc_2_reduce_res_214063;\n        double redout_228523;\n        double redout_228524;\n        \n        redout_228523 = 0.0;\n        redout_228524 = 0.0;\n        for (int64_t i_228525 = 0; i_228525 < q_s_203493; i_228525++) {\n            bool cond_214071 = sle64(x_213998, i_228525);\n            int64_t defunc_0_f_res_214072;\n            \n            if (cond_214071) {\n                defunc_0_f_res_214072 = (int64_t) 0;\n            } else {\n                int64_t i_214073 = add64(x_214000, i_228525);\n                int64_t defunc_0_add_arg_214074;\n                \n                defunc_0_add_arg_214074 = ((__global\n                                            int64_t *) ext_mem_229265)[gtid_213991 *\n                                                                       (defunc_0_f_res_203631 *\n                                  ",
            "                                      n_p_203492) +\n                                                                       gtid_213992 *\n                                                                       defunc_0_f_res_203631 +\n                                                                       i_214073];\n                \n                int64_t defunc_1_add_res_214075 = add64((int64_t) 1,\n                                                        defunc_0_add_arg_214074);\n                \n                defunc_0_f_res_214072 = defunc_1_add_res_214075;\n            }\n            \n            double defunc_0_f_res_214076;\n            \n            if (cond_214071) {\n                defunc_0_f_res_214076 = 0.0;\n            } else {\n                int64_t i_214077 = add64(x_214000, i_228525);\n                double defunc_0_add_arg_214078;\n                \n                defunc_0_add_arg_214078 = ((__global\n                                            double *) mem_229531)[gtid_213991 *\n                                                                  (defunc_0_f_res_203631 *\n                                                                   n_p_203492) +\n                                                                  gtid_213992 *\n                                                                  defunc_0_f_res_203631 +\n                                                                  i_214077];\n                defunc_0_f_res_214076 = defunc_0_add_arg_214078;\n            }\n            \n            int64_t binop_p_214079 = sub64(defunc_0_f_res_214072,\n                                           defunc_0_m_fun_res_214053);\n            double defunc_0_f_res_214080 = sitofp_i64_f64(binop_p_214079);\n            double abs_res_214081 = fabs(defunc_0_f_res_214080);\n            double tmp1_214082 = abs_res_214081 / x_214001;\n            double x_214083 = tmp1_214082 * tmp1_214082;\n            double y_214084 = tmp1_214082 * x_214083;\n            double tmp2_214085 = 1.0 -",
            " y_214084;\n            double x_214086 = tmp2_214085 * tmp2_214085;\n            double tmp3_214087 = tmp2_214085 * x_214086;\n            double tmp4_214088 = defunc_0_f_res_214076 * tmp3_214087;\n            double defunc_1_f_res_214089 = defunc_0_f_res_214080 * tmp4_214088;\n            double defunc_0_f_res_214090;\n            \n            if (cond_214071) {\n                defunc_0_f_res_214090 = 0.0;\n            } else {\n                int64_t i_214091 = add64(x_214000, i_228525);\n                double defunc_0_add_arg_214092;\n                \n                defunc_0_add_arg_214092 = ((__global\n                                            double *) mem_229526)[gtid_213991 *\n                                                                  (defunc_0_f_res_203631 *\n                                                                   n_p_203492) +\n                                                                  gtid_213992 *\n                                                                  defunc_0_f_res_203631 +\n                                                                  i_214091];\n                defunc_0_f_res_214090 = defunc_0_add_arg_214092;\n            }\n            \n            double x_214093 = a11_214049 * tmp4_214088;\n            double y_214094 = b11_214051 * defunc_1_f_res_214089;\n            double x_214095 = x_214093 + y_214094;\n            double defunc_9_fit_fun_res_214096 = defunc_0_f_res_214090 *\n                   x_214095;\n            double x_214097 = b11_214051 * tmp4_214088;\n            double y_214098 = c11_214052 * defunc_1_f_res_214089;\n            double x_214099 = x_214097 + y_214098;\n            double defunc_9_slope_fun_res_214100 = defunc_0_f_res_214090 *\n                   x_214099;\n            double defunc_1_op_res_214066 = defunc_9_fit_fun_res_214096 +\n                   redout_228523;\n            double defunc_1_op_res_214069 = defunc_9_slope_fun_res_214100 +\n                   redout_228524;\n            double redout_tmp_23",
            "3464 = defunc_1_op_res_214066;\n            double redout_tmp_233465 = defunc_1_op_res_214069;\n            \n            redout_228523 = redout_tmp_233464;\n            redout_228524 = redout_tmp_233465;\n        }\n        defunc_2_reduce_res_214062 = redout_228523;\n        defunc_2_reduce_res_214063 = redout_228524;\n        ((__global double *) mem_229962)[gtid_213991 * (s_n_m_203636 *\n                                                        n_p_203492) +\n                                         gtid_213992 * s_n_m_203636 +\n                                         gtid_213993] =\n            defunc_2_reduce_res_214062;\n        ((__global double *) mem_229967)[gtid_213991 * (s_n_m_203636 *\n                                                        n_p_203492) +\n                                         gtid_213992 * s_n_m_203636 +\n                                         gtid_213993] =\n            defunc_2_reduce_res_214063;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_213981\n}\n__kernel void mainzisegmap_214111(__global int *global_failure,\n                                  int64_t n_p_203492, int64_t jump_s_203499,\n                                  int64_t partition_sizze_203577,\n                                  int64_t defunc_0_f_res_203631,\n                                  int64_t pad_css_len_203632,\n                                  int64_t s_n_m_203636, __global\n                                  unsigned char *mem_229973, __global\n                                  unsigned char *mem_229977)\n{\n    #define segmap_group_sizze_214104 (mainzisegmap_group_sizze_213157)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233466;\n    int32_t local_tid_233467;\n    int64_t group_sizze_233470;\n    int32_t wave_sizze_233469;\n    int32_t group_tid_233468;\n    \n    global_tid_233466 = get_global_id(0);\n    local_tid_233467 = get_local_id(0);\n  ",
            "  group_sizze_233470 = get_local_size(0);\n    wave_sizze_233469 = LOCKSTEP_WIDTH;\n    group_tid_233468 = get_group_id(0);\n    \n    int32_t phys_tid_214111 = global_tid_233466;\n    int64_t global_tid_233471 = sext_i32_i64(group_tid_233468) *\n            segmap_group_sizze_214104 + sext_i32_i64(local_tid_233467);\n    int64_t slice_233472 = s_n_m_203636;\n    int64_t slice_233473 = n_p_203492 * slice_233472;\n    int64_t slice_233474 = partition_sizze_203577 * slice_233473;\n    int64_t gtid_214108 = squot64(global_tid_233471, slice_233473);\n    int64_t remnant_233475 = global_tid_233471 - gtid_214108 * slice_233473;\n    int64_t gtid_214109 = squot64(remnant_233475, slice_233472);\n    int64_t remnant_233476 = remnant_233475 - gtid_214109 * slice_233472;\n    int64_t gtid_214110 = remnant_233476;\n    int64_t remnant_233477 = remnant_233476 - gtid_214110;\n    \n    if ((slt64(gtid_214108, partition_sizze_203577) && slt64(gtid_214109,\n                                                             n_p_203492)) &&\n        slt64(gtid_214110, s_n_m_203636)) {\n        bool cond_214113 = gtid_214110 == (int64_t) 0;\n        int64_t defunc_0_m_fun_res_214114;\n        \n        if (cond_214113) {\n            defunc_0_m_fun_res_214114 = (int64_t) 0;\n        } else {\n            int64_t y_214115 = sub64(s_n_m_203636, (int64_t) 1);\n            bool cond_214116 = gtid_214110 == y_214115;\n            int64_t defunc_0_m_fun_res_f_res_214117;\n            \n            if (cond_214116) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_214118 =\n                        sub64(pad_css_len_203632, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_214117 =\n                    defunc_0_m_fun_res_f_res_t_res_214118;\n            } else {\n                int64_t x_214119 = sub64(gtid_214110, (int64_t) 1);\n                int64_t x_214120 = mul64(jump_s_203499, x_214119);\n                int64_t min_arg_214121 = add64((int64_t) 1, x_214120);\n                int64_t min_res_214122",
            " = smin64(defunc_0_f_res_203631,\n                                                min_arg_214121);\n                \n                defunc_0_m_fun_res_f_res_214117 = min_res_214122;\n            }\n            defunc_0_m_fun_res_214114 = defunc_0_m_fun_res_f_res_214117;\n        }\n        ((__global int64_t *) mem_229973)[gtid_214108 * (s_n_m_203636 *\n                                                         n_p_203492) +\n                                          gtid_214109 * s_n_m_203636 +\n                                          gtid_214110] =\n            defunc_0_m_fun_res_214114;\n        ((__global bool *) mem_229977)[gtid_214108 * (s_n_m_203636 *\n                                                      n_p_203492) +\n                                       gtid_214109 * s_n_m_203636 +\n                                       gtid_214110] = cond_214113;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_214104\n}\n__kernel void mainzisegmap_214195(__global int *global_failure,\n                                  int64_t n_p_203492, int64_t jump_s_203499,\n                                  int64_t partition_sizze_203577,\n                                  int64_t defunc_0_f_res_203631,\n                                  int64_t pad_css_len_203632,\n                                  int64_t s_n_m_203636, __global\n                                  unsigned char *mem_229983, __global\n                                  unsigned char *mem_229988, __global\n                                  unsigned char *mem_229993, __global\n                                  unsigned char *mem_229999, __global\n                                  unsigned char *mem_230004, __global\n                                  unsigned char *mem_230009, __global\n                                  unsigned char *mem_230014)\n{\n    #define segmap_group_sizze_214186 (mainzisegmap_group_sizze_213054)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*glob",
            "al_failure >= 0)\n        return;\n    \n    int32_t global_tid_233582;\n    int32_t local_tid_233583;\n    int64_t group_sizze_233586;\n    int32_t wave_sizze_233585;\n    int32_t group_tid_233584;\n    \n    global_tid_233582 = get_global_id(0);\n    local_tid_233583 = get_local_id(0);\n    group_sizze_233586 = get_local_size(0);\n    wave_sizze_233585 = LOCKSTEP_WIDTH;\n    group_tid_233584 = get_group_id(0);\n    \n    int32_t phys_tid_214195 = global_tid_233582;\n    int64_t global_tid_233587 = sext_i32_i64(group_tid_233584) *\n            segmap_group_sizze_214186 + sext_i32_i64(local_tid_233583);\n    int64_t slice_233588 = s_n_m_203636;\n    int64_t slice_233589 = n_p_203492 * slice_233588;\n    int64_t slice_233590 = partition_sizze_203577 * slice_233589;\n    int64_t gtid_214192 = squot64(global_tid_233587, slice_233589);\n    int64_t remnant_233591 = global_tid_233587 - gtid_214192 * slice_233589;\n    int64_t gtid_214193 = squot64(remnant_233591, slice_233588);\n    int64_t remnant_233592 = remnant_233591 - gtid_214193 * slice_233588;\n    int64_t gtid_214194 = remnant_233592;\n    int64_t remnant_233593 = remnant_233592 - gtid_214194;\n    \n    if ((slt64(gtid_214192, partition_sizze_203577) && slt64(gtid_214193,\n                                                             n_p_203492)) &&\n        slt64(gtid_214194, s_n_m_203636)) {\n        bool index_primexp_228728 = gtid_214194 == (int64_t) 0;\n        double defunc_2_reduce_res_214198;\n        \n        defunc_2_reduce_res_214198 = ((__global\n                                       double *) mem_229983)[gtid_214192 *\n                                                             (s_n_m_203636 *\n                                                              n_p_203492) +\n                                                             gtid_214193 *\n                                                             s_n_m_203636 +\n                                                             gtid_214194];\n        \n        double defunc_2_reduce_re",
            "s_214199;\n        \n        defunc_2_reduce_res_214199 = ((__global\n                                       double *) mem_229988)[gtid_214192 *\n                                                             (s_n_m_203636 *\n                                                              n_p_203492) +\n                                                             gtid_214193 *\n                                                             s_n_m_203636 +\n                                                             gtid_214194];\n        \n        double defunc_2_reduce_res_214200;\n        \n        defunc_2_reduce_res_214200 = ((__global\n                                       double *) mem_229993)[gtid_214192 *\n                                                             (s_n_m_203636 *\n                                                              n_p_203492) +\n                                                             gtid_214193 *\n                                                             s_n_m_203636 +\n                                                             gtid_214194];\n        \n        double x_214201 = defunc_2_reduce_res_214198 *\n               defunc_2_reduce_res_214200;\n        double y_214202 = defunc_2_reduce_res_214199 *\n               defunc_2_reduce_res_214199;\n        double y_214203 = x_214201 - y_214202;\n        double det1_214204 = 1.0 / y_214203;\n        double a11_214205 = defunc_2_reduce_res_214200 * det1_214204;\n        double x_214206 = 0.0 - defunc_2_reduce_res_214199;\n        double b11_214207 = det1_214204 * x_214206;\n        double c11_214208 = defunc_2_reduce_res_214198 * det1_214204;\n        int64_t defunc_0_m_fun_res_214209;\n        \n        if (index_primexp_228728) {\n            defunc_0_m_fun_res_214209 = (int64_t) 0;\n        } else {\n            int64_t y_214210 = sub64(s_n_m_203636, (int64_t) 1);\n            bool cond_214211 = gtid_214194 == y_214210;\n            int64_t defunc_0_m_fun_res_f_res_214212;\n            \n            if (cond_2",
            "14211) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_214213 =\n                        sub64(pad_css_len_203632, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_214212 =\n                    defunc_0_m_fun_res_f_res_t_res_214213;\n            } else {\n                int64_t x_214214 = sub64(gtid_214194, (int64_t) 1);\n                int64_t x_214215 = mul64(jump_s_203499, x_214214);\n                int64_t min_arg_214216 = add64((int64_t) 1, x_214215);\n                int64_t min_res_214217 = smin64(defunc_0_f_res_203631,\n                                                min_arg_214216);\n                \n                defunc_0_m_fun_res_f_res_214212 = min_res_214217;\n            }\n            defunc_0_m_fun_res_214209 = defunc_0_m_fun_res_f_res_214212;\n        }\n        ((__global double *) mem_229999)[gtid_214192 * (s_n_m_203636 *\n                                                        n_p_203492) +\n                                         gtid_214193 * s_n_m_203636 +\n                                         gtid_214194] = a11_214205;\n        ((__global double *) mem_230004)[gtid_214192 * (s_n_m_203636 *\n                                                        n_p_203492) +\n                                         gtid_214193 * s_n_m_203636 +\n                                         gtid_214194] = b11_214207;\n        ((__global double *) mem_230009)[gtid_214192 * (s_n_m_203636 *\n                                                        n_p_203492) +\n                                         gtid_214193 * s_n_m_203636 +\n                                         gtid_214194] = c11_214208;\n        ((__global int64_t *) mem_230014)[gtid_214192 * (s_n_m_203636 *\n                                                         n_p_203492) +\n                                          gtid_214193 * s_n_m_203636 +\n                                          gtid_214194] =\n            defunc_0_m_fun_res_214209;\n    }\n    \n  error_0:\n    return;\n    #undef se",
            "gmap_group_sizze_214186\n}\n__kernel void mainzisegmap_214470(__global int *global_failure,\n                                  int64_t n_p_203492, int64_t q_s_203493,\n                                  int64_t jump_s_203499,\n                                  int64_t partition_sizze_203577,\n                                  int64_t defunc_0_f_res_203631,\n                                  int64_t pad_css_len_203632,\n                                  int64_t s_n_m_203636,\n                                  int64_t num_groups_214465,\n                                  int64_t num_threads_232131, __global\n                                  unsigned char *mem_230061, __global\n                                  unsigned char *mem_230064, __global\n                                  unsigned char *mem_230068, __global\n                                  unsigned char *mem_230072, __global\n                                  unsigned char *mem_230076, __global\n                                  unsigned char *mem_230080, __global\n                                  unsigned char *mem_230173, __global\n                                  unsigned char *mem_230177, __global\n                                  unsigned char *color_232004, __global\n                                  unsigned char *color_232005)\n{\n    #define segmap_group_sizze_214464 (mainzisegmap_group_sizze_214306)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233692;\n    int32_t local_tid_233693;\n    int64_t group_sizze_233696;\n    int32_t wave_sizze_233695;\n    int32_t group_tid_233694;\n    \n    global_tid_233692 = get_global_id(0);\n    local_tid_233693 = get_local_id(0);\n    group_sizze_233696 = get_local_size(0);\n    wave_sizze_233695 = LOCKSTEP_WIDTH;\n    group_tid_233694 = get_group_id(0);\n    \n    int32_t phys_tid_214470 = global_tid_233692;\n    int32_t phys_group_id_233697;\n    \n    phys_group_id_23",
            "3697 = get_group_id(0);\n    for (int32_t i_233698 = 0; i_233698 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577,\n                                          segmap_group_sizze_214464)) -\n                   phys_group_id_233697, sext_i64_i32(num_groups_214465));\n         i_233698++) {\n        int32_t virt_group_id_233699 = phys_group_id_233697 + i_233698 *\n                sext_i64_i32(num_groups_214465);\n        int64_t global_tid_233700 = sext_i32_i64(virt_group_id_233699) *\n                segmap_group_sizze_214464 + sext_i32_i64(local_tid_233693);\n        int64_t slice_233701 = partition_sizze_203577;\n        int64_t gtid_214469 = global_tid_233700;\n        int64_t remnant_233702 = global_tid_233700 - gtid_214469;\n        \n        if (slt64(gtid_214469, partition_sizze_203577)) {\n            for (int64_t i_228962 = 0; i_228962 < n_p_203492; i_228962++) {\n                int64_t x_214482;\n                \n                x_214482 = ((__global int64_t *) mem_230064)[i_228962 *\n                                                             partition_sizze_203577 +\n                                                             gtid_214469];\n                for (int64_t i_228969 = 0; i_228969 < s_n_m_203636;\n                     i_228969++) {\n                    int64_t x_214488;\n                    \n                    x_214488 = ((__global int64_t *) mem_230072)[i_228962 *\n                                                                 (partition_sizze_203577 *\n                                                                  s_n_m_203636) +\n                                                                 i_228969 *\n                                                                 partition_sizze_203577 +\n                                                                 gtid_214469];\n                    \n                    double x_214489;\n                    \n                    x_214489 = ((__global double *) mem_230061)[i_228962 *\n                    ",
            "                                            (partition_sizze_203577 *\n                                                                 s_n_m_203636) +\n                                                                i_228969 *\n                                                                partition_sizze_203577 +\n                                                                gtid_214469];\n                    \n                    bool cond_214490 = i_228969 == (int64_t) 0;\n                    int64_t defunc_0_m_fun_res_214491;\n                    \n                    if (cond_214490) {\n                        defunc_0_m_fun_res_214491 = (int64_t) 0;\n                    } else {\n                        int64_t y_214492 = sub64(s_n_m_203636, (int64_t) 1);\n                        bool cond_214493 = i_228969 == y_214492;\n                        int64_t defunc_0_m_fun_res_f_res_214494;\n                        \n                        if (cond_214493) {\n                            int64_t defunc_0_m_fun_res_f_res_t_res_214495 =\n                                    sub64(pad_css_len_203632, (int64_t) 1);\n                            \n                            defunc_0_m_fun_res_f_res_214494 =\n                                defunc_0_m_fun_res_f_res_t_res_214495;\n                        } else {\n                            int64_t x_214496 = sub64(i_228969, (int64_t) 1);\n                            int64_t x_214497 = mul64(jump_s_203499, x_214496);\n                            int64_t min_arg_214498 = add64((int64_t) 1,\n                                                           x_214497);\n                            int64_t min_res_214499 =\n                                    smin64(defunc_0_f_res_203631,\n                                           min_arg_214498);\n                            \n                            defunc_0_m_fun_res_f_res_214494 = min_res_214499;\n                        }\n                        defunc_0_m_fun_res_214491 =\n                            d",
            "efunc_0_m_fun_res_f_res_214494;\n                    }\n                    \n                    double defunc_2_reduce_res_214500;\n                    double defunc_2_reduce_res_214501;\n                    double defunc_2_reduce_res_214502;\n                    double defunc_2_reduce_res_214503;\n                    double defunc_2_reduce_res_214504;\n                    double redout_228540;\n                    double redout_228541;\n                    double redout_228542;\n                    double redout_228543;\n                    double redout_228544;\n                    \n                    redout_228540 = 0.0;\n                    redout_228541 = 0.0;\n                    redout_228542 = 0.0;\n                    redout_228543 = 0.0;\n                    redout_228544 = 0.0;\n                    for (int64_t i_228545 = 0; i_228545 < q_s_203493;\n                         i_228545++) {\n                        bool cond_214521 = sle64(x_214482, i_228545);\n                        int64_t defunc_0_f_res_214522;\n                        \n                        if (cond_214521) {\n                            defunc_0_f_res_214522 = (int64_t) 0;\n                        } else {\n                            int64_t i_214523 = add64(x_214488, i_228545);\n                            int64_t defunc_0_add_arg_214524;\n                            \n                            defunc_0_add_arg_214524 = ((__global\n                                                        int64_t *) mem_230080)[i_228962 *\n                                                                               (partition_sizze_203577 *\n                                                                                defunc_0_f_res_203631) +\n                                                                               i_214523 *\n                                                                               partition_sizze_203577 +\n                                                                               gtid_214469]",
            ";\n                            \n                            int64_t defunc_1_add_res_214525 = add64((int64_t) 1,\n                                                                    defunc_0_add_arg_214524);\n                            \n                            defunc_0_f_res_214522 = defunc_1_add_res_214525;\n                        }\n                        \n                        double defunc_0_f_res_214526;\n                        \n                        if (cond_214521) {\n                            defunc_0_f_res_214526 = 0.0;\n                        } else {\n                            int64_t i_214527 = add64(x_214488, i_228545);\n                            double defunc_0_add_arg_214528;\n                            \n                            defunc_0_add_arg_214528 = ((__global\n                                                        double *) mem_230068)[i_228962 *\n                                                                              (partition_sizze_203577 *\n                                                                               defunc_0_f_res_203631) +\n                                                                              i_214527 *\n                                                                              partition_sizze_203577 +\n                                                                              gtid_214469];\n                            defunc_0_f_res_214526 = defunc_0_add_arg_214528;\n                        }\n                        \n                        int64_t binop_p_214529 = sub64(defunc_0_f_res_214522,\n                                                       defunc_0_m_fun_res_214491);\n                        double defunc_0_f_res_214530 =\n                               sitofp_i64_f64(binop_p_214529);\n                        double abs_res_214531 = fabs(defunc_0_f_res_214530);\n                        double tmp1_214532 = abs_res_214531 / x_214489;\n                        double x_214533 = tmp1_214532 * tmp1",
            "_214532;\n                        double y_214534 = tmp1_214532 * x_214533;\n                        double tmp2_214535 = 1.0 - y_214534;\n                        double x_214536 = tmp2_214535 * tmp2_214535;\n                        double tmp3_214537 = tmp2_214535 * x_214536;\n                        double w_j_214538 = defunc_0_f_res_214526 * tmp3_214537;\n                        double xw_j_214539 = defunc_0_f_res_214530 * w_j_214538;\n                        double x2w_j_214540 = defunc_0_f_res_214530 *\n                               xw_j_214539;\n                        double x3w_j_214541 = defunc_0_f_res_214530 *\n                               x2w_j_214540;\n                        double x4w_j_214542 = defunc_0_f_res_214530 *\n                               x3w_j_214541;\n                        double defunc_1_op_res_214507 = w_j_214538 +\n                               redout_228540;\n                        double defunc_1_op_res_214510 = xw_j_214539 +\n                               redout_228541;\n                        double defunc_1_op_res_214513 = x2w_j_214540 +\n                               redout_228542;\n                        double defunc_1_op_res_214516 = x3w_j_214541 +\n                               redout_228543;\n                        double defunc_1_op_res_214519 = x4w_j_214542 +\n                               redout_228544;\n                        double redout_tmp_233707 = defunc_1_op_res_214507;\n                        double redout_tmp_233708 = defunc_1_op_res_214510;\n                        double redout_tmp_233709 = defunc_1_op_res_214513;\n                        double redout_tmp_233710 = defunc_1_op_res_214516;\n                        double redout_tmp_233711 = defunc_1_op_res_214519;\n                        \n                        redout_228540 = redout_tmp_233707;\n                        redout_228541 = redout_tmp_233708;\n                        redout_228542 = redout_tmp_233709;\n                        redout_228543 = redout_tmp_233710;\n  ",
            "                      redout_228544 = redout_tmp_233711;\n                    }\n                    defunc_2_reduce_res_214500 = redout_228540;\n                    defunc_2_reduce_res_214501 = redout_228541;\n                    defunc_2_reduce_res_214502 = redout_228542;\n                    defunc_2_reduce_res_214503 = redout_228543;\n                    defunc_2_reduce_res_214504 = redout_228544;\n                    \n                    double x_214543 = defunc_2_reduce_res_214502 *\n                           defunc_2_reduce_res_214504;\n                    double y_214544 = defunc_2_reduce_res_214503 *\n                           defunc_2_reduce_res_214503;\n                    double a12_214545 = x_214543 - y_214544;\n                    double x_214546 = defunc_2_reduce_res_214502 *\n                           defunc_2_reduce_res_214503;\n                    double y_214547 = defunc_2_reduce_res_214501 *\n                           defunc_2_reduce_res_214504;\n                    double b12_214548 = x_214546 - y_214547;\n                    double x_214549 = defunc_2_reduce_res_214501 *\n                           defunc_2_reduce_res_214503;\n                    double y_214550 = defunc_2_reduce_res_214502 *\n                           defunc_2_reduce_res_214502;\n                    double c12_214551 = x_214549 - y_214550;\n                    double x_214552 = defunc_2_reduce_res_214500 *\n                           defunc_2_reduce_res_214504;\n                    double b2_214553 = x_214552 - y_214550;\n                    double x_214554 = defunc_2_reduce_res_214501 *\n                           defunc_2_reduce_res_214502;\n                    double y_214555 = defunc_2_reduce_res_214500 *\n                           defunc_2_reduce_res_214503;\n                    double c2_214556 = x_214554 - y_214555;\n                    double x_214557 = defunc_2_reduce_res_214500 * a12_214545;\n                    double y_214558 = defunc_2_reduce_res_214501 * b12_214548;\n                    d",
            "ouble x_214559 = x_214557 + y_214558;\n                    double y_214560 = defunc_2_reduce_res_214502 * c12_214551;\n                    double y_214561 = x_214559 + y_214560;\n                    double det_214562 = 1.0 / y_214561;\n                    double a12_214563 = a12_214545 * det_214562;\n                    double b12_214564 = b12_214548 * det_214562;\n                    double c12_214565 = c12_214551 * det_214562;\n                    double b2_214566 = b2_214553 * det_214562;\n                    double c2_214567 = c2_214556 * det_214562;\n                    int64_t defunc_0_m_fun_res_214568;\n                    \n                    if (cond_214490) {\n                        defunc_0_m_fun_res_214568 = (int64_t) 0;\n                    } else {\n                        int64_t y_214569 = sub64(s_n_m_203636, (int64_t) 1);\n                        bool cond_214570 = i_228969 == y_214569;\n                        int64_t defunc_0_m_fun_res_f_res_214571;\n                        \n                        if (cond_214570) {\n                            int64_t defunc_0_m_fun_res_f_res_t_res_214572 =\n                                    sub64(pad_css_len_203632, (int64_t) 1);\n                            \n                            defunc_0_m_fun_res_f_res_214571 =\n                                defunc_0_m_fun_res_f_res_t_res_214572;\n                        } else {\n                            int64_t x_214573 = sub64(i_228969, (int64_t) 1);\n                            int64_t x_214574 = mul64(jump_s_203499, x_214573);\n                            int64_t min_arg_214575 = add64((int64_t) 1,\n                                                           x_214574);\n                            int64_t min_res_214576 =\n                                    smin64(defunc_0_f_res_203631,\n                                           min_arg_214575);\n                            \n                            defunc_0_m_fun_res_f_res_214571 = min_res_214576;\n                        }\n      ",
            "                  defunc_0_m_fun_res_214568 =\n                            defunc_0_m_fun_res_f_res_214571;\n                    }\n                    \n                    double defunc_2_reduce_res_214577;\n                    double defunc_2_reduce_res_214578;\n                    double redout_228546;\n                    double redout_228547;\n                    \n                    redout_228546 = 0.0;\n                    redout_228547 = 0.0;\n                    for (int64_t i_228548 = 0; i_228548 < q_s_203493;\n                         i_228548++) {\n                        bool cond_214586 = sle64(x_214482, i_228548);\n                        int64_t defunc_0_f_res_214587;\n                        \n                        if (cond_214586) {\n                            defunc_0_f_res_214587 = (int64_t) 0;\n                        } else {\n                            int64_t i_214588 = add64(x_214488, i_228548);\n                            int64_t defunc_0_add_arg_214589;\n                            \n                            defunc_0_add_arg_214589 = ((__global\n                                                        int64_t *) mem_230080)[i_228962 *\n                                                                               (partition_sizze_203577 *\n                                                                                defunc_0_f_res_203631) +\n                                                                               i_214588 *\n                                                                               partition_sizze_203577 +\n                                                                               gtid_214469];\n                            \n                            int64_t defunc_1_add_res_214590 = add64((int64_t) 1,\n                                                                    defunc_0_add_arg_214589);\n                            \n                            defunc_0_f_res_214587 = defunc_1_add_res_214590;\n                        }\n ",
            "                       \n                        double defunc_0_f_res_214591;\n                        \n                        if (cond_214586) {\n                            defunc_0_f_res_214591 = 0.0;\n                        } else {\n                            int64_t i_214592 = add64(x_214488, i_228548);\n                            double defunc_0_add_arg_214593;\n                            \n                            defunc_0_add_arg_214593 = ((__global\n                                                        double *) mem_230068)[i_228962 *\n                                                                              (partition_sizze_203577 *\n                                                                               defunc_0_f_res_203631) +\n                                                                              i_214592 *\n                                                                              partition_sizze_203577 +\n                                                                              gtid_214469];\n                            defunc_0_f_res_214591 = defunc_0_add_arg_214593;\n                        }\n                        \n                        int64_t binop_p_214594 = sub64(defunc_0_f_res_214587,\n                                                       defunc_0_m_fun_res_214568);\n                        double defunc_0_f_res_214595 =\n                               sitofp_i64_f64(binop_p_214594);\n                        double abs_res_214596 = fabs(defunc_0_f_res_214595);\n                        double tmp1_214597 = abs_res_214596 / x_214489;\n                        double x_214598 = tmp1_214597 * tmp1_214597;\n                        double y_214599 = tmp1_214597 * x_214598;\n                        double tmp2_214600 = 1.0 - y_214599;\n                        double x_214601 = tmp2_214600 * tmp2_214600;\n                        double tmp3_214602 = tmp2_214600 * x_214601;\n                        double tmp4_214603 = defunc_0_f_res_21459",
            "1 *\n                               tmp3_214602;\n                        double defunc_1_f_res_214604 = defunc_0_f_res_214595 *\n                               tmp4_214603;\n                        double defunc_1_f_res_214605 = defunc_0_f_res_214595 *\n                               defunc_1_f_res_214604;\n                        double defunc_0_f_res_214606;\n                        \n                        if (cond_214586) {\n                            defunc_0_f_res_214606 = 0.0;\n                        } else {\n                            int64_t i_214607 = add64(x_214488, i_228548);\n                            double defunc_0_add_arg_214608;\n                            \n                            defunc_0_add_arg_214608 = ((__global\n                                                        double *) mem_230076)[i_228962 *\n                                                                              (partition_sizze_203577 *\n                                                                               defunc_0_f_res_203631) +\n                                                                              i_214607 *\n                                                                              partition_sizze_203577 +\n                                                                              gtid_214469];\n                            defunc_0_f_res_214606 = defunc_0_add_arg_214608;\n                        }\n                        \n                        double x_214609 = a12_214563 * tmp4_214603;\n                        double y_214610 = b12_214564 * defunc_1_f_res_214604;\n                        double x_214611 = x_214609 + y_214610;\n                        double y_214612 = c12_214565 * defunc_1_f_res_214605;\n                        double x_214613 = x_214611 + y_214612;\n                        double defunc_9_fit_fun_res_214614 =\n                               defunc_0_f_res_214606 * x_214613;\n                        double x_214615 = b12_214564 * tmp4_214603;\n   ",
            "                     double y_214616 = b2_214566 * defunc_1_f_res_214604;\n                        double x_214617 = x_214615 + y_214616;\n                        double y_214618 = c2_214567 * defunc_1_f_res_214605;\n                        double x_214619 = x_214617 + y_214618;\n                        double defunc_9_slope_fun_res_214620 =\n                               defunc_0_f_res_214606 * x_214619;\n                        double defunc_1_op_res_214581 =\n                               defunc_9_fit_fun_res_214614 + redout_228546;\n                        double defunc_1_op_res_214584 =\n                               defunc_9_slope_fun_res_214620 + redout_228547;\n                        double redout_tmp_233712 = defunc_1_op_res_214581;\n                        double redout_tmp_233713 = defunc_1_op_res_214584;\n                        \n                        redout_228546 = redout_tmp_233712;\n                        redout_228547 = redout_tmp_233713;\n                    }\n                    defunc_2_reduce_res_214577 = redout_228546;\n                    defunc_2_reduce_res_214578 = redout_228547;\n                    ((__global double *) color_232005)[phys_tid_214470 +\n                                                       (i_228962 *\n                                                        (num_threads_232131 *\n                                                         s_n_m_203636) +\n                                                        i_228969 *\n                                                        num_threads_232131)] =\n                        defunc_2_reduce_res_214577;\n                    ((__global double *) color_232004)[phys_tid_214470 +\n                                                       (i_228962 *\n                                                        (num_threads_232131 *\n                                                         s_n_m_203636) +\n                                                        i_228969 *\n                                       ",
            "                 num_threads_232131)] =\n                        defunc_2_reduce_res_214578;\n                }\n            }\n            for (int64_t i_233714 = 0; i_233714 < n_p_203492; i_233714++) {\n                for (int64_t i_233715 = 0; i_233715 < s_n_m_203636;\n                     i_233715++) {\n                    double tmp_233716;\n                    \n                    tmp_233716 = ((__global\n                                   double *) color_232005)[phys_tid_214470 +\n                                                           (i_233714 *\n                                                            (num_threads_232131 *\n                                                             s_n_m_203636) +\n                                                            i_233715 *\n                                                            num_threads_232131)];\n                    ((__global double *) mem_230173)[gtid_214469 + (i_233714 *\n                                                                    (partition_sizze_203577 *\n                                                                     s_n_m_203636) +\n                                                                    i_233715 *\n                                                                    partition_sizze_203577)] =\n                        tmp_233716;\n                }\n            }\n            for (int64_t i_233717 = 0; i_233717 < n_p_203492; i_233717++) {\n                for (int64_t i_233718 = 0; i_233718 < s_n_m_203636;\n                     i_233718++) {\n                    double tmp_233719;\n                    \n                    tmp_233719 = ((__global\n                                   double *) color_232004)[phys_tid_214470 +\n                                                           (i_233717 *\n                                                            (num_threads_232131 *\n                                                             s_n_m_203636) +\n                                           ",
            "                 i_233718 *\n                                                            num_threads_232131)];\n                    ((__global double *) mem_230177)[gtid_214469 + (i_233717 *\n                                                                    (partition_sizze_203577 *\n                                                                     s_n_m_203636) +\n                                                                    i_233718 *\n                                                                    partition_sizze_203577)] =\n                        tmp_233719;\n                }\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_214464\n}\n__kernel void mainzisegmap_216262(__global int *global_failure,\n                                  int64_t n_p_203492, int64_t q_s_203493,\n                                  int64_t jump_s_203499,\n                                  int64_t partition_sizze_203577,\n                                  int64_t defunc_0_f_res_203631,\n                                  int64_t pad_css_len_203632,\n                                  int64_t s_n_m_203636,\n                                  int64_t num_groups_216240,\n                                  int64_t num_threads_232134, __global\n                                  unsigned char *ext_mem_229264, __global\n                                  unsigned char *mem_230181, __global\n                                  unsigned char *mem_230185, __global\n                                  unsigned char *mem_230189, __global\n                                  unsigned char *mem_230193, __global\n                                  unsigned char *mem_230197, __global\n                                  unsigned char *mem_230232, __global\n                                  unsigned char *mem_230236, __global\n                                  unsigned char *color_232006, __global\n                                  ",
            "unsigned char *color_232007)\n{\n    #define segmap_group_sizze_216239 (mainzisegmap_group_sizze_214626)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233720;\n    int32_t local_tid_233721;\n    int64_t group_sizze_233724;\n    int32_t wave_sizze_233723;\n    int32_t group_tid_233722;\n    \n    global_tid_233720 = get_global_id(0);\n    local_tid_233721 = get_local_id(0);\n    group_sizze_233724 = get_local_size(0);\n    wave_sizze_233723 = LOCKSTEP_WIDTH;\n    group_tid_233722 = get_group_id(0);\n    \n    int32_t phys_tid_216262 = global_tid_233720;\n    int32_t phys_group_id_233725;\n    \n    phys_group_id_233725 = get_group_id(0);\n    for (int32_t i_233726 = 0; i_233726 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577 * n_p_203492,\n                                          segmap_group_sizze_216239)) -\n                   phys_group_id_233725, sext_i64_i32(num_groups_216240));\n         i_233726++) {\n        int32_t virt_group_id_233727 = phys_group_id_233725 + i_233726 *\n                sext_i64_i32(num_groups_216240);\n        int64_t global_tid_233728 = sext_i32_i64(virt_group_id_233727) *\n                segmap_group_sizze_216239 + sext_i32_i64(local_tid_233721);\n        int64_t slice_233729 = n_p_203492;\n        int64_t slice_233730 = partition_sizze_203577 * slice_233729;\n        int64_t gtid_216260 = squot64(global_tid_233728, slice_233729);\n        int64_t remnant_233731 = global_tid_233728 - gtid_216260 * slice_233729;\n        int64_t gtid_216261 = remnant_233731;\n        int64_t remnant_233732 = remnant_233731 - gtid_216261;\n        \n        if (slt64(gtid_216260, partition_sizze_203577) && slt64(gtid_216261,\n                                                                n_p_203492)) {\n            int64_t x_216266;\n            \n            x_216266 = ((__global int64_t *) ext_mem_229264)[gtid_216260 *\n                        ",
            "                                     n_p_203492 +\n                                                             gtid_216261];\n            for (int64_t i_228976 = 0; i_228976 < s_n_m_203636; i_228976++) {\n                int64_t x_216272;\n                \n                x_216272 = ((__global int64_t *) mem_230181)[i_228976 *\n                                                             (n_p_203492 *\n                                                              partition_sizze_203577) +\n                                                             gtid_216260 *\n                                                             n_p_203492 +\n                                                             gtid_216261];\n                \n                double x_216273;\n                \n                x_216273 = ((__global double *) mem_230185)[i_228976 *\n                                                            (n_p_203492 *\n                                                             partition_sizze_203577) +\n                                                            gtid_216260 *\n                                                            n_p_203492 +\n                                                            gtid_216261];\n                \n                bool cond_216274 = i_228976 == (int64_t) 0;\n                int64_t defunc_0_m_fun_res_216275;\n                \n                if (cond_216274) {\n                    defunc_0_m_fun_res_216275 = (int64_t) 0;\n                } else {\n                    int64_t y_216276 = sub64(s_n_m_203636, (int64_t) 1);\n                    bool cond_216277 = i_228976 == y_216276;\n                    int64_t defunc_0_m_fun_res_f_res_216278;\n                    \n                    if (cond_216277) {\n                        int64_t defunc_0_m_fun_res_f_res_t_res_216279 =\n                                sub64(pad_css_len_203632, (int64_t) 1);\n                        \n                        defunc_0_m_fun_res_f_res_216278 =\n                   ",
            "         defunc_0_m_fun_res_f_res_t_res_216279;\n                    } else {\n                        int64_t x_216280 = sub64(i_228976, (int64_t) 1);\n                        int64_t x_216281 = mul64(jump_s_203499, x_216280);\n                        int64_t min_arg_216282 = add64((int64_t) 1, x_216281);\n                        int64_t min_res_216283 = smin64(defunc_0_f_res_203631,\n                                                        min_arg_216282);\n                        \n                        defunc_0_m_fun_res_f_res_216278 = min_res_216283;\n                    }\n                    defunc_0_m_fun_res_216275 = defunc_0_m_fun_res_f_res_216278;\n                }\n                \n                double defunc_2_reduce_res_216284;\n                double defunc_2_reduce_res_216285;\n                double defunc_2_reduce_res_216286;\n                double defunc_2_reduce_res_216287;\n                double defunc_2_reduce_res_216288;\n                double redout_228553;\n                double redout_228554;\n                double redout_228555;\n                double redout_228556;\n                double redout_228557;\n                \n                redout_228553 = 0.0;\n                redout_228554 = 0.0;\n                redout_228555 = 0.0;\n                redout_228556 = 0.0;\n                redout_228557 = 0.0;\n                for (int64_t i_228558 = 0; i_228558 < q_s_203493; i_228558++) {\n                    bool cond_216305 = sle64(x_216266, i_228558);\n                    int64_t defunc_0_f_res_216306;\n                    \n                    if (cond_216305) {\n                        defunc_0_f_res_216306 = (int64_t) 0;\n                    } else {\n                        int64_t i_216307 = add64(x_216272, i_228558);\n                        int64_t defunc_0_add_arg_216308;\n                        \n                        defunc_0_add_arg_216308 = ((__global\n                                                    int64_t *) mem_230189)[i_216307 *\n              ",
            "                                                             (n_p_203492 *\n                                                                            partition_sizze_203577) +\n                                                                           gtid_216260 *\n                                                                           n_p_203492 +\n                                                                           gtid_216261];\n                        \n                        int64_t defunc_1_add_res_216309 = add64((int64_t) 1,\n                                                                defunc_0_add_arg_216308);\n                        \n                        defunc_0_f_res_216306 = defunc_1_add_res_216309;\n                    }\n                    \n                    double defunc_0_f_res_216310;\n                    \n                    if (cond_216305) {\n                        defunc_0_f_res_216310 = 0.0;\n                    } else {\n                        int64_t i_216311 = add64(x_216272, i_228558);\n                        double defunc_0_add_arg_216312;\n                        \n                        defunc_0_add_arg_216312 = ((__global\n                                                    double *) mem_230193)[i_216311 *\n                                                                          (n_p_203492 *\n                                                                           partition_sizze_203577) +\n                                                                          gtid_216260 *\n                                                                          n_p_203492 +\n                                                                          gtid_216261];\n                        defunc_0_f_res_216310 = defunc_0_add_arg_216312;\n                    }\n                    \n                    int64_t binop_p_216313 = sub64(defunc_0_f_res_216306,\n                                                   defunc_0_m_fun_res_216275);\n              ",
            "      double defunc_0_f_res_216314 =\n                           sitofp_i64_f64(binop_p_216313);\n                    double abs_res_216315 = fabs(defunc_0_f_res_216314);\n                    double tmp1_216316 = abs_res_216315 / x_216273;\n                    double x_216317 = tmp1_216316 * tmp1_216316;\n                    double y_216318 = tmp1_216316 * x_216317;\n                    double tmp2_216319 = 1.0 - y_216318;\n                    double x_216320 = tmp2_216319 * tmp2_216319;\n                    double tmp3_216321 = tmp2_216319 * x_216320;\n                    double w_j_216322 = defunc_0_f_res_216310 * tmp3_216321;\n                    double xw_j_216323 = defunc_0_f_res_216314 * w_j_216322;\n                    double x2w_j_216324 = defunc_0_f_res_216314 * xw_j_216323;\n                    double x3w_j_216325 = defunc_0_f_res_216314 * x2w_j_216324;\n                    double x4w_j_216326 = defunc_0_f_res_216314 * x3w_j_216325;\n                    double defunc_1_op_res_216291 = w_j_216322 + redout_228553;\n                    double defunc_1_op_res_216294 = xw_j_216323 + redout_228554;\n                    double defunc_1_op_res_216297 = x2w_j_216324 +\n                           redout_228555;\n                    double defunc_1_op_res_216300 = x3w_j_216325 +\n                           redout_228556;\n                    double defunc_1_op_res_216303 = x4w_j_216326 +\n                           redout_228557;\n                    double redout_tmp_233735 = defunc_1_op_res_216291;\n                    double redout_tmp_233736 = defunc_1_op_res_216294;\n                    double redout_tmp_233737 = defunc_1_op_res_216297;\n                    double redout_tmp_233738 = defunc_1_op_res_216300;\n                    double redout_tmp_233739 = defunc_1_op_res_216303;\n                    \n                    redout_228553 = redout_tmp_233735;\n                    redout_228554 = redout_tmp_233736;\n                    redout_228555 = redout_tmp_233737;\n                    redout_",
            "228556 = redout_tmp_233738;\n                    redout_228557 = redout_tmp_233739;\n                }\n                defunc_2_reduce_res_216284 = redout_228553;\n                defunc_2_reduce_res_216285 = redout_228554;\n                defunc_2_reduce_res_216286 = redout_228555;\n                defunc_2_reduce_res_216287 = redout_228556;\n                defunc_2_reduce_res_216288 = redout_228557;\n                \n                double x_216327 = defunc_2_reduce_res_216286 *\n                       defunc_2_reduce_res_216288;\n                double y_216328 = defunc_2_reduce_res_216287 *\n                       defunc_2_reduce_res_216287;\n                double a12_216329 = x_216327 - y_216328;\n                double x_216330 = defunc_2_reduce_res_216286 *\n                       defunc_2_reduce_res_216287;\n                double y_216331 = defunc_2_reduce_res_216285 *\n                       defunc_2_reduce_res_216288;\n                double b12_216332 = x_216330 - y_216331;\n                double x_216333 = defunc_2_reduce_res_216285 *\n                       defunc_2_reduce_res_216287;\n                double y_216334 = defunc_2_reduce_res_216286 *\n                       defunc_2_reduce_res_216286;\n                double c12_216335 = x_216333 - y_216334;\n                double x_216336 = defunc_2_reduce_res_216284 *\n                       defunc_2_reduce_res_216288;\n                double b2_216337 = x_216336 - y_216334;\n                double x_216338 = defunc_2_reduce_res_216285 *\n                       defunc_2_reduce_res_216286;\n                double y_216339 = defunc_2_reduce_res_216284 *\n                       defunc_2_reduce_res_216287;\n                double c2_216340 = x_216338 - y_216339;\n                double x_216341 = defunc_2_reduce_res_216284 * a12_216329;\n                double y_216342 = defunc_2_reduce_res_216285 * b12_216332;\n                double x_216343 = x_216341 + y_216342;\n                double y_216344 = defunc_2_reduce_res_216286 * c12_2",
            "16335;\n                double y_216345 = x_216343 + y_216344;\n                double det_216346 = 1.0 / y_216345;\n                double a12_216347 = a12_216329 * det_216346;\n                double b12_216348 = b12_216332 * det_216346;\n                double c12_216349 = c12_216335 * det_216346;\n                double b2_216350 = b2_216337 * det_216346;\n                double c2_216351 = c2_216340 * det_216346;\n                int64_t defunc_0_m_fun_res_216352;\n                \n                if (cond_216274) {\n                    defunc_0_m_fun_res_216352 = (int64_t) 0;\n                } else {\n                    int64_t y_216353 = sub64(s_n_m_203636, (int64_t) 1);\n                    bool cond_216354 = i_228976 == y_216353;\n                    int64_t defunc_0_m_fun_res_f_res_216355;\n                    \n                    if (cond_216354) {\n                        int64_t defunc_0_m_fun_res_f_res_t_res_216356 =\n                                sub64(pad_css_len_203632, (int64_t) 1);\n                        \n                        defunc_0_m_fun_res_f_res_216355 =\n                            defunc_0_m_fun_res_f_res_t_res_216356;\n                    } else {\n                        int64_t x_216357 = sub64(i_228976, (int64_t) 1);\n                        int64_t x_216358 = mul64(jump_s_203499, x_216357);\n                        int64_t min_arg_216359 = add64((int64_t) 1, x_216358);\n                        int64_t min_res_216360 = smin64(defunc_0_f_res_203631,\n                                                        min_arg_216359);\n                        \n                        defunc_0_m_fun_res_f_res_216355 = min_res_216360;\n                    }\n                    defunc_0_m_fun_res_216352 = defunc_0_m_fun_res_f_res_216355;\n                }\n                \n                double defunc_2_reduce_res_216361;\n                double defunc_2_reduce_res_216362;\n                double redout_228559;\n                double redout_228560;\n                \n       ",
            "         redout_228559 = 0.0;\n                redout_228560 = 0.0;\n                for (int64_t i_228561 = 0; i_228561 < q_s_203493; i_228561++) {\n                    bool cond_216370 = sle64(x_216266, i_228561);\n                    int64_t defunc_0_f_res_216371;\n                    \n                    if (cond_216370) {\n                        defunc_0_f_res_216371 = (int64_t) 0;\n                    } else {\n                        int64_t i_216372 = add64(x_216272, i_228561);\n                        int64_t defunc_0_add_arg_216373;\n                        \n                        defunc_0_add_arg_216373 = ((__global\n                                                    int64_t *) mem_230189)[i_216372 *\n                                                                           (n_p_203492 *\n                                                                            partition_sizze_203577) +\n                                                                           gtid_216260 *\n                                                                           n_p_203492 +\n                                                                           gtid_216261];\n                        \n                        int64_t defunc_1_add_res_216374 = add64((int64_t) 1,\n                                                                defunc_0_add_arg_216373);\n                        \n                        defunc_0_f_res_216371 = defunc_1_add_res_216374;\n                    }\n                    \n                    double defunc_0_f_res_216375;\n                    \n                    if (cond_216370) {\n                        defunc_0_f_res_216375 = 0.0;\n                    } else {\n                        int64_t i_216376 = add64(x_216272, i_228561);\n                        double defunc_0_add_arg_216377;\n                        \n                        defunc_0_add_arg_216377 = ((__global\n                                                    double *) mem_230193)[i_216376 *\n        ",
            "                                                                  (n_p_203492 *\n                                                                           partition_sizze_203577) +\n                                                                          gtid_216260 *\n                                                                          n_p_203492 +\n                                                                          gtid_216261];\n                        defunc_0_f_res_216375 = defunc_0_add_arg_216377;\n                    }\n                    \n                    int64_t binop_p_216378 = sub64(defunc_0_f_res_216371,\n                                                   defunc_0_m_fun_res_216352);\n                    double defunc_0_f_res_216379 =\n                           sitofp_i64_f64(binop_p_216378);\n                    double abs_res_216380 = fabs(defunc_0_f_res_216379);\n                    double tmp1_216381 = abs_res_216380 / x_216273;\n                    double x_216382 = tmp1_216381 * tmp1_216381;\n                    double y_216383 = tmp1_216381 * x_216382;\n                    double tmp2_216384 = 1.0 - y_216383;\n                    double x_216385 = tmp2_216384 * tmp2_216384;\n                    double tmp3_216386 = tmp2_216384 * x_216385;\n                    double tmp4_216387 = defunc_0_f_res_216375 * tmp3_216386;\n                    double defunc_1_f_res_216388 = defunc_0_f_res_216379 *\n                           tmp4_216387;\n                    double defunc_1_f_res_216389 = defunc_0_f_res_216379 *\n                           defunc_1_f_res_216388;\n                    double defunc_0_f_res_216390;\n                    \n                    if (cond_216370) {\n                        defunc_0_f_res_216390 = 0.0;\n                    } else {\n                        int64_t i_216391 = add64(x_216272, i_228561);\n                        double defunc_0_add_arg_216392;\n                        \n                        defunc_0_add_arg_216392 = ((__global\n",
            "                                                    double *) mem_230197)[i_216391 *\n                                                                          (n_p_203492 *\n                                                                           partition_sizze_203577) +\n                                                                          gtid_216260 *\n                                                                          n_p_203492 +\n                                                                          gtid_216261];\n                        defunc_0_f_res_216390 = defunc_0_add_arg_216392;\n                    }\n                    \n                    double x_216393 = a12_216347 * tmp4_216387;\n                    double y_216394 = b12_216348 * defunc_1_f_res_216388;\n                    double x_216395 = x_216393 + y_216394;\n                    double y_216396 = c12_216349 * defunc_1_f_res_216389;\n                    double x_216397 = x_216395 + y_216396;\n                    double defunc_9_fit_fun_res_216398 = defunc_0_f_res_216390 *\n                           x_216397;\n                    double x_216399 = b12_216348 * tmp4_216387;\n                    double y_216400 = b2_216350 * defunc_1_f_res_216388;\n                    double x_216401 = x_216399 + y_216400;\n                    double y_216402 = c2_216351 * defunc_1_f_res_216389;\n                    double x_216403 = x_216401 + y_216402;\n                    double defunc_9_slope_fun_res_216404 =\n                           defunc_0_f_res_216390 * x_216403;\n                    double defunc_1_op_res_216365 =\n                           defunc_9_fit_fun_res_216398 + redout_228559;\n                    double defunc_1_op_res_216368 =\n                           defunc_9_slope_fun_res_216404 + redout_228560;\n                    double redout_tmp_233740 = defunc_1_op_res_216365;\n                    double redout_tmp_233741 = defunc_1_op_res_216368;\n                    \n                    redout_228559 = re",
            "dout_tmp_233740;\n                    redout_228560 = redout_tmp_233741;\n                }\n                defunc_2_reduce_res_216361 = redout_228559;\n                defunc_2_reduce_res_216362 = redout_228560;\n                ((__global double *) color_232007)[phys_tid_216262 + i_228976 *\n                                                   num_threads_232134] =\n                    defunc_2_reduce_res_216361;\n                ((__global double *) color_232006)[phys_tid_216262 + i_228976 *\n                                                   num_threads_232134] =\n                    defunc_2_reduce_res_216362;\n            }\n            for (int64_t i_233742 = 0; i_233742 < s_n_m_203636; i_233742++) {\n                double tmp_233743;\n                \n                tmp_233743 = ((__global\n                               double *) color_232007)[phys_tid_216262 +\n                                                       i_233742 *\n                                                       num_threads_232134];\n                ((__global double *) mem_230232)[gtid_216260 * n_p_203492 +\n                                                 gtid_216261 + i_233742 *\n                                                 (n_p_203492 *\n                                                  partition_sizze_203577)] =\n                    tmp_233743;\n            }\n            for (int64_t i_233744 = 0; i_233744 < s_n_m_203636; i_233744++) {\n                double tmp_233745;\n                \n                tmp_233745 = ((__global\n                               double *) color_232006)[phys_tid_216262 +\n                                                       i_233744 *\n                                                       num_threads_232134];\n                ((__global double *) mem_230236)[gtid_216260 * n_p_203492 +\n                                                 gtid_216261 + i_233744 *\n                                                 (n_p_203492 *\n                                                  parti",
            "tion_sizze_203577)] =\n                    tmp_233745;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_216239\n}\n__kernel void mainzisegmap_216607(__global int *global_failure,\n                                  int64_t n_p_203492, int64_t q_s_203493,\n                                  int64_t jump_s_203499,\n                                  int64_t partition_sizze_203577,\n                                  int64_t defunc_0_f_res_203631,\n                                  int64_t pad_css_len_203632,\n                                  int64_t s_n_m_203636, __global\n                                  unsigned char *ext_mem_229264, __global\n                                  unsigned char *ext_mem_229265, __global\n                                  unsigned char *ext_mem_229362, __global\n                                  unsigned char *ext_mem_229363, __global\n                                  unsigned char *mem_229526, __global\n                                  unsigned char *mem_229531, __global\n                                  unsigned char *mem_230301, __global\n                                  unsigned char *mem_230306)\n{\n    #define segmap_group_sizze_216594 (mainzisegmap_group_sizze_215167)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233844;\n    int32_t local_tid_233845;\n    int64_t group_sizze_233848;\n    int32_t wave_sizze_233847;\n    int32_t group_tid_233846;\n    \n    global_tid_233844 = get_global_id(0);\n    local_tid_233845 = get_local_id(0);\n    group_sizze_233848 = get_local_size(0);\n    wave_sizze_233847 = LOCKSTEP_WIDTH;\n    group_tid_233846 = get_group_id(0);\n    \n    int32_t phys_tid_216607 = global_tid_233844;\n    int64_t global_tid_233849 = sext_i32_i64(group_tid_233846) *\n            segmap_group_sizze_216594 + sext_i32_i64(local_",
            "tid_233845);\n    int64_t slice_233850 = s_n_m_203636;\n    int64_t slice_233851 = n_p_203492 * slice_233850;\n    int64_t slice_233852 = partition_sizze_203577 * slice_233851;\n    int64_t gtid_216604 = squot64(global_tid_233849, slice_233851);\n    int64_t remnant_233853 = global_tid_233849 - gtid_216604 * slice_233851;\n    int64_t gtid_216605 = squot64(remnant_233853, slice_233850);\n    int64_t remnant_233854 = remnant_233853 - gtid_216605 * slice_233850;\n    int64_t gtid_216606 = remnant_233854;\n    int64_t remnant_233855 = remnant_233854 - gtid_216606;\n    \n    if ((slt64(gtid_216604, partition_sizze_203577) && slt64(gtid_216605,\n                                                             n_p_203492)) &&\n        slt64(gtid_216606, s_n_m_203636)) {\n        int64_t x_216611;\n        \n        x_216611 = ((__global int64_t *) ext_mem_229264)[gtid_216604 *\n                                                         n_p_203492 +\n                                                         gtid_216605];\n        \n        int64_t x_216613;\n        \n        x_216613 = ((__global int64_t *) ext_mem_229363)[gtid_216604 *\n                                                         (s_n_m_203636 *\n                                                          n_p_203492) +\n                                                         gtid_216605 *\n                                                         s_n_m_203636 +\n                                                         gtid_216606];\n        \n        double x_216614;\n        \n        x_216614 = ((__global double *) ext_mem_229362)[gtid_216604 *\n                                                        (s_n_m_203636 *\n                                                         n_p_203492) +\n                                                        gtid_216605 *\n                                                        s_n_m_203636 +\n                                                        gtid_216606];\n        \n        bool cond_216615 = gtid_216606 == (i",
            "nt64_t) 0;\n        int64_t defunc_0_m_fun_res_216616;\n        \n        if (cond_216615) {\n            defunc_0_m_fun_res_216616 = (int64_t) 0;\n        } else {\n            int64_t y_216617 = sub64(s_n_m_203636, (int64_t) 1);\n            bool cond_216618 = gtid_216606 == y_216617;\n            int64_t defunc_0_m_fun_res_f_res_216619;\n            \n            if (cond_216618) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_216620 =\n                        sub64(pad_css_len_203632, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_216619 =\n                    defunc_0_m_fun_res_f_res_t_res_216620;\n            } else {\n                int64_t x_216621 = sub64(gtid_216606, (int64_t) 1);\n                int64_t x_216622 = mul64(jump_s_203499, x_216621);\n                int64_t min_arg_216623 = add64((int64_t) 1, x_216622);\n                int64_t min_res_216624 = smin64(defunc_0_f_res_203631,\n                                                min_arg_216623);\n                \n                defunc_0_m_fun_res_f_res_216619 = min_res_216624;\n            }\n            defunc_0_m_fun_res_216616 = defunc_0_m_fun_res_f_res_216619;\n        }\n        \n        double defunc_2_reduce_res_216625;\n        double defunc_2_reduce_res_216626;\n        double defunc_2_reduce_res_216627;\n        double defunc_2_reduce_res_216628;\n        double defunc_2_reduce_res_216629;\n        double redout_228574;\n        double redout_228575;\n        double redout_228576;\n        double redout_228577;\n        double redout_228578;\n        \n        redout_228574 = 0.0;\n        redout_228575 = 0.0;\n        redout_228576 = 0.0;\n        redout_228577 = 0.0;\n        redout_228578 = 0.0;\n        for (int64_t i_228579 = 0; i_228579 < q_s_203493; i_228579++) {\n            bool cond_216646 = sle64(x_216611, i_228579);\n            int64_t defunc_0_f_res_216647;\n            \n            if (cond_216646) {\n                defunc_0_f_res_216647 = (int64_t) 0;\n            } else {\n      ",
            "          int64_t i_216648 = add64(x_216613, i_228579);\n                int64_t defunc_0_add_arg_216649;\n                \n                defunc_0_add_arg_216649 = ((__global\n                                            int64_t *) ext_mem_229265)[gtid_216604 *\n                                                                       (defunc_0_f_res_203631 *\n                                                                        n_p_203492) +\n                                                                       gtid_216605 *\n                                                                       defunc_0_f_res_203631 +\n                                                                       i_216648];\n                \n                int64_t defunc_1_add_res_216650 = add64((int64_t) 1,\n                                                        defunc_0_add_arg_216649);\n                \n                defunc_0_f_res_216647 = defunc_1_add_res_216650;\n            }\n            \n            double defunc_0_f_res_216651;\n            \n            if (cond_216646) {\n                defunc_0_f_res_216651 = 0.0;\n            } else {\n                int64_t i_216652 = add64(x_216613, i_228579);\n                double defunc_0_add_arg_216653;\n                \n                defunc_0_add_arg_216653 = ((__global\n                                            double *) mem_229531)[gtid_216604 *\n                                                                  (defunc_0_f_res_203631 *\n                                                                   n_p_203492) +\n                                                                  gtid_216605 *\n                                                                  defunc_0_f_res_203631 +\n                                                                  i_216652];\n                defunc_0_f_res_216651 = defunc_0_add_arg_216653;\n            }\n            \n            int64_t binop_p_216654 = sub64(defunc_0_f_res_216647,\n                              ",
            "             defunc_0_m_fun_res_216616);\n            double defunc_0_f_res_216655 = sitofp_i64_f64(binop_p_216654);\n            double abs_res_216656 = fabs(defunc_0_f_res_216655);\n            double tmp1_216657 = abs_res_216656 / x_216614;\n            double x_216658 = tmp1_216657 * tmp1_216657;\n            double y_216659 = tmp1_216657 * x_216658;\n            double tmp2_216660 = 1.0 - y_216659;\n            double x_216661 = tmp2_216660 * tmp2_216660;\n            double tmp3_216662 = tmp2_216660 * x_216661;\n            double w_j_216663 = defunc_0_f_res_216651 * tmp3_216662;\n            double xw_j_216664 = defunc_0_f_res_216655 * w_j_216663;\n            double x2w_j_216665 = defunc_0_f_res_216655 * xw_j_216664;\n            double x3w_j_216666 = defunc_0_f_res_216655 * x2w_j_216665;\n            double x4w_j_216667 = defunc_0_f_res_216655 * x3w_j_216666;\n            double defunc_1_op_res_216632 = w_j_216663 + redout_228574;\n            double defunc_1_op_res_216635 = xw_j_216664 + redout_228575;\n            double defunc_1_op_res_216638 = x2w_j_216665 + redout_228576;\n            double defunc_1_op_res_216641 = x3w_j_216666 + redout_228577;\n            double defunc_1_op_res_216644 = x4w_j_216667 + redout_228578;\n            double redout_tmp_233856 = defunc_1_op_res_216632;\n            double redout_tmp_233857 = defunc_1_op_res_216635;\n            double redout_tmp_233858 = defunc_1_op_res_216638;\n            double redout_tmp_233859 = defunc_1_op_res_216641;\n            double redout_tmp_233860 = defunc_1_op_res_216644;\n            \n            redout_228574 = redout_tmp_233856;\n            redout_228575 = redout_tmp_233857;\n            redout_228576 = redout_tmp_233858;\n            redout_228577 = redout_tmp_233859;\n            redout_228578 = redout_tmp_233860;\n        }\n        defunc_2_reduce_res_216625 = redout_228574;\n        defunc_2_reduce_res_216626 = redout_228575;\n        defunc_2_reduce_res_216627 = redout_228576;\n        defunc_2_reduce_res_216628 =",
            " redout_228577;\n        defunc_2_reduce_res_216629 = redout_228578;\n        \n        double x_216668 = defunc_2_reduce_res_216627 *\n               defunc_2_reduce_res_216629;\n        double y_216669 = defunc_2_reduce_res_216628 *\n               defunc_2_reduce_res_216628;\n        double a12_216670 = x_216668 - y_216669;\n        double x_216671 = defunc_2_reduce_res_216627 *\n               defunc_2_reduce_res_216628;\n        double y_216672 = defunc_2_reduce_res_216626 *\n               defunc_2_reduce_res_216629;\n        double b12_216673 = x_216671 - y_216672;\n        double x_216674 = defunc_2_reduce_res_216626 *\n               defunc_2_reduce_res_216628;\n        double y_216675 = defunc_2_reduce_res_216627 *\n               defunc_2_reduce_res_216627;\n        double c12_216676 = x_216674 - y_216675;\n        double x_216677 = defunc_2_reduce_res_216625 *\n               defunc_2_reduce_res_216629;\n        double b2_216678 = x_216677 - y_216675;\n        double x_216679 = defunc_2_reduce_res_216626 *\n               defunc_2_reduce_res_216627;\n        double y_216680 = defunc_2_reduce_res_216625 *\n               defunc_2_reduce_res_216628;\n        double c2_216681 = x_216679 - y_216680;\n        double x_216682 = defunc_2_reduce_res_216625 * a12_216670;\n        double y_216683 = defunc_2_reduce_res_216626 * b12_216673;\n        double x_216684 = x_216682 + y_216683;\n        double y_216685 = defunc_2_reduce_res_216627 * c12_216676;\n        double y_216686 = x_216684 + y_216685;\n        double det_216687 = 1.0 / y_216686;\n        double a12_216688 = a12_216670 * det_216687;\n        double b12_216689 = b12_216673 * det_216687;\n        double c12_216690 = c12_216676 * det_216687;\n        double b2_216691 = b2_216678 * det_216687;\n        double c2_216692 = c2_216681 * det_216687;\n        int64_t defunc_0_m_fun_res_216693;\n        \n        if (cond_216615) {\n            defunc_0_m_fun_res_216693 = (int64_t) 0;\n        } else {\n            int64_t y_216694 = sub64(s_n_m_203636",
            ", (int64_t) 1);\n            bool cond_216695 = gtid_216606 == y_216694;\n            int64_t defunc_0_m_fun_res_f_res_216696;\n            \n            if (cond_216695) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_216697 =\n                        sub64(pad_css_len_203632, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_216696 =\n                    defunc_0_m_fun_res_f_res_t_res_216697;\n            } else {\n                int64_t x_216698 = sub64(gtid_216606, (int64_t) 1);\n                int64_t x_216699 = mul64(jump_s_203499, x_216698);\n                int64_t min_arg_216700 = add64((int64_t) 1, x_216699);\n                int64_t min_res_216701 = smin64(defunc_0_f_res_203631,\n                                                min_arg_216700);\n                \n                defunc_0_m_fun_res_f_res_216696 = min_res_216701;\n            }\n            defunc_0_m_fun_res_216693 = defunc_0_m_fun_res_f_res_216696;\n        }\n        \n        double defunc_2_reduce_res_216702;\n        double defunc_2_reduce_res_216703;\n        double redout_228580;\n        double redout_228581;\n        \n        redout_228580 = 0.0;\n        redout_228581 = 0.0;\n        for (int64_t i_228582 = 0; i_228582 < q_s_203493; i_228582++) {\n            bool cond_216711 = sle64(x_216611, i_228582);\n            int64_t defunc_0_f_res_216712;\n            \n            if (cond_216711) {\n                defunc_0_f_res_216712 = (int64_t) 0;\n            } else {\n                int64_t i_216713 = add64(x_216613, i_228582);\n                int64_t defunc_0_add_arg_216714;\n                \n                defunc_0_add_arg_216714 = ((__global\n                                            int64_t *) ext_mem_229265)[gtid_216604 *\n                                                                       (defunc_0_f_res_203631 *\n                                                                        n_p_203492) +\n                                                                       gt",
            "id_216605 *\n                                                                       defunc_0_f_res_203631 +\n                                                                       i_216713];\n                \n                int64_t defunc_1_add_res_216715 = add64((int64_t) 1,\n                                                        defunc_0_add_arg_216714);\n                \n                defunc_0_f_res_216712 = defunc_1_add_res_216715;\n            }\n            \n            double defunc_0_f_res_216716;\n            \n            if (cond_216711) {\n                defunc_0_f_res_216716 = 0.0;\n            } else {\n                int64_t i_216717 = add64(x_216613, i_228582);\n                double defunc_0_add_arg_216718;\n                \n                defunc_0_add_arg_216718 = ((__global\n                                            double *) mem_229531)[gtid_216604 *\n                                                                  (defunc_0_f_res_203631 *\n                                                                   n_p_203492) +\n                                                                  gtid_216605 *\n                                                                  defunc_0_f_res_203631 +\n                                                                  i_216717];\n                defunc_0_f_res_216716 = defunc_0_add_arg_216718;\n            }\n            \n            int64_t binop_p_216719 = sub64(defunc_0_f_res_216712,\n                                           defunc_0_m_fun_res_216693);\n            double defunc_0_f_res_216720 = sitofp_i64_f64(binop_p_216719);\n            double abs_res_216721 = fabs(defunc_0_f_res_216720);\n            double tmp1_216722 = abs_res_216721 / x_216614;\n            double x_216723 = tmp1_216722 * tmp1_216722;\n            double y_216724 = tmp1_216722 * x_216723;\n            double tmp2_216725 = 1.0 - y_216724;\n            double x_216726 = tmp2_216725 * tmp2_216725;\n            double tmp3_216727 = tmp2_216725 * x_216726;\n",
            "            double tmp4_216728 = defunc_0_f_res_216716 * tmp3_216727;\n            double defunc_1_f_res_216729 = defunc_0_f_res_216720 * tmp4_216728;\n            double defunc_1_f_res_216730 = defunc_0_f_res_216720 *\n                   defunc_1_f_res_216729;\n            double defunc_0_f_res_216731;\n            \n            if (cond_216711) {\n                defunc_0_f_res_216731 = 0.0;\n            } else {\n                int64_t i_216732 = add64(x_216613, i_228582);\n                double defunc_0_add_arg_216733;\n                \n                defunc_0_add_arg_216733 = ((__global\n                                            double *) mem_229526)[gtid_216604 *\n                                                                  (defunc_0_f_res_203631 *\n                                                                   n_p_203492) +\n                                                                  gtid_216605 *\n                                                                  defunc_0_f_res_203631 +\n                                                                  i_216732];\n                defunc_0_f_res_216731 = defunc_0_add_arg_216733;\n            }\n            \n            double x_216734 = a12_216688 * tmp4_216728;\n            double y_216735 = b12_216689 * defunc_1_f_res_216729;\n            double x_216736 = x_216734 + y_216735;\n            double y_216737 = c12_216690 * defunc_1_f_res_216730;\n            double x_216738 = x_216736 + y_216737;\n            double defunc_9_fit_fun_res_216739 = defunc_0_f_res_216731 *\n                   x_216738;\n            double x_216740 = b12_216689 * tmp4_216728;\n            double y_216741 = b2_216691 * defunc_1_f_res_216729;\n            double x_216742 = x_216740 + y_216741;\n            double y_216743 = c2_216692 * defunc_1_f_res_216730;\n            double x_216744 = x_216742 + y_216743;\n            double defunc_9_slope_fun_res_216745 = defunc_0_f_res_216731 *\n                   x_216744;\n            double defunc_1_op_res",
            "_216706 = defunc_9_fit_fun_res_216739 +\n                   redout_228580;\n            double defunc_1_op_res_216709 = defunc_9_slope_fun_res_216745 +\n                   redout_228581;\n            double redout_tmp_233861 = defunc_1_op_res_216706;\n            double redout_tmp_233862 = defunc_1_op_res_216709;\n            \n            redout_228580 = redout_tmp_233861;\n            redout_228581 = redout_tmp_233862;\n        }\n        defunc_2_reduce_res_216702 = redout_228580;\n        defunc_2_reduce_res_216703 = redout_228581;\n        ((__global double *) mem_230301)[gtid_216604 * (s_n_m_203636 *\n                                                        n_p_203492) +\n                                         gtid_216605 * s_n_m_203636 +\n                                         gtid_216606] =\n            defunc_2_reduce_res_216702;\n        ((__global double *) mem_230306)[gtid_216604 * (s_n_m_203636 *\n                                                        n_p_203492) +\n                                         gtid_216605 * s_n_m_203636 +\n                                         gtid_216606] =\n            defunc_2_reduce_res_216703;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_216594\n}\n__kernel void mainzisegmap_216756(__global int *global_failure,\n                                  int64_t n_p_203492, int64_t jump_s_203499,\n                                  int64_t partition_sizze_203577,\n                                  int64_t defunc_0_f_res_203631,\n                                  int64_t pad_css_len_203632,\n                                  int64_t s_n_m_203636, __global\n                                  unsigned char *mem_230312, __global\n                                  unsigned char *mem_230316)\n{\n    #define segmap_group_sizze_216749 (mainzisegmap_group_sizze_215584)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_2338",
            "63;\n    int32_t local_tid_233864;\n    int64_t group_sizze_233867;\n    int32_t wave_sizze_233866;\n    int32_t group_tid_233865;\n    \n    global_tid_233863 = get_global_id(0);\n    local_tid_233864 = get_local_id(0);\n    group_sizze_233867 = get_local_size(0);\n    wave_sizze_233866 = LOCKSTEP_WIDTH;\n    group_tid_233865 = get_group_id(0);\n    \n    int32_t phys_tid_216756 = global_tid_233863;\n    int64_t global_tid_233868 = sext_i32_i64(group_tid_233865) *\n            segmap_group_sizze_216749 + sext_i32_i64(local_tid_233864);\n    int64_t slice_233869 = s_n_m_203636;\n    int64_t slice_233870 = n_p_203492 * slice_233869;\n    int64_t slice_233871 = partition_sizze_203577 * slice_233870;\n    int64_t gtid_216753 = squot64(global_tid_233868, slice_233870);\n    int64_t remnant_233872 = global_tid_233868 - gtid_216753 * slice_233870;\n    int64_t gtid_216754 = squot64(remnant_233872, slice_233869);\n    int64_t remnant_233873 = remnant_233872 - gtid_216754 * slice_233869;\n    int64_t gtid_216755 = remnant_233873;\n    int64_t remnant_233874 = remnant_233873 - gtid_216755;\n    \n    if ((slt64(gtid_216753, partition_sizze_203577) && slt64(gtid_216754,\n                                                             n_p_203492)) &&\n        slt64(gtid_216755, s_n_m_203636)) {\n        bool cond_216758 = gtid_216755 == (int64_t) 0;\n        int64_t defunc_0_m_fun_res_216759;\n        \n        if (cond_216758) {\n            defunc_0_m_fun_res_216759 = (int64_t) 0;\n        } else {\n            int64_t y_216760 = sub64(s_n_m_203636, (int64_t) 1);\n            bool cond_216761 = gtid_216755 == y_216760;\n            int64_t defunc_0_m_fun_res_f_res_216762;\n            \n            if (cond_216761) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_216763 =\n                        sub64(pad_css_len_203632, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_216762 =\n                    defunc_0_m_fun_res_f_res_t_res_216763;\n            } else {\n                int64_t x_21",
            "6764 = sub64(gtid_216755, (int64_t) 1);\n                int64_t x_216765 = mul64(jump_s_203499, x_216764);\n                int64_t min_arg_216766 = add64((int64_t) 1, x_216765);\n                int64_t min_res_216767 = smin64(defunc_0_f_res_203631,\n                                                min_arg_216766);\n                \n                defunc_0_m_fun_res_f_res_216762 = min_res_216767;\n            }\n            defunc_0_m_fun_res_216759 = defunc_0_m_fun_res_f_res_216762;\n        }\n        ((__global int64_t *) mem_230312)[gtid_216753 * (s_n_m_203636 *\n                                                         n_p_203492) +\n                                          gtid_216754 * s_n_m_203636 +\n                                          gtid_216755] =\n            defunc_0_m_fun_res_216759;\n        ((__global bool *) mem_230316)[gtid_216753 * (s_n_m_203636 *\n                                                      n_p_203492) +\n                                       gtid_216754 * s_n_m_203636 +\n                                       gtid_216755] = cond_216758;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_216749\n}\n__kernel void mainzisegmap_216852(__global int *global_failure,\n                                  int64_t n_p_203492, int64_t jump_s_203499,\n                                  int64_t partition_sizze_203577,\n                                  int64_t defunc_0_f_res_203631,\n                                  int64_t pad_css_len_203632,\n                                  int64_t s_n_m_203636, __global\n                                  unsigned char *mem_230322, __global\n                                  unsigned char *mem_230327, __global\n                                  unsigned char *mem_230332, __global\n                                  unsigned char *mem_230337, __global\n                                  unsigned char *mem_230342, __global\n                                  unsigned char *mem_230348, __global\n                                ",
            "  unsigned char *mem_230353, __global\n                                  unsigned char *mem_230358, __global\n                                  unsigned char *mem_230363, __global\n                                  unsigned char *mem_230368, __global\n                                  unsigned char *mem_230373)\n{\n    #define segmap_group_sizze_216841 (mainzisegmap_group_sizze_215454)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234007;\n    int32_t local_tid_234008;\n    int64_t group_sizze_234011;\n    int32_t wave_sizze_234010;\n    int32_t group_tid_234009;\n    \n    global_tid_234007 = get_global_id(0);\n    local_tid_234008 = get_local_id(0);\n    group_sizze_234011 = get_local_size(0);\n    wave_sizze_234010 = LOCKSTEP_WIDTH;\n    group_tid_234009 = get_group_id(0);\n    \n    int32_t phys_tid_216852 = global_tid_234007;\n    int64_t global_tid_234012 = sext_i32_i64(group_tid_234009) *\n            segmap_group_sizze_216841 + sext_i32_i64(local_tid_234008);\n    int64_t slice_234013 = s_n_m_203636;\n    int64_t slice_234014 = n_p_203492 * slice_234013;\n    int64_t slice_234015 = partition_sizze_203577 * slice_234014;\n    int64_t gtid_216849 = squot64(global_tid_234012, slice_234014);\n    int64_t remnant_234016 = global_tid_234012 - gtid_216849 * slice_234014;\n    int64_t gtid_216850 = squot64(remnant_234016, slice_234013);\n    int64_t remnant_234017 = remnant_234016 - gtid_216850 * slice_234013;\n    int64_t gtid_216851 = remnant_234017;\n    int64_t remnant_234018 = remnant_234017 - gtid_216851;\n    \n    if ((slt64(gtid_216849, partition_sizze_203577) && slt64(gtid_216850,\n                                                             n_p_203492)) &&\n        slt64(gtid_216851, s_n_m_203636)) {\n        bool index_primexp_228734 = gtid_216851 == (int64_t) 0;\n        double defunc_2_reduce_res_216855;\n        \n        defunc_2_reduce_res_216855 = ((__global\n",
            "                                       double *) mem_230322)[gtid_216849 *\n                                                             (s_n_m_203636 *\n                                                              n_p_203492) +\n                                                             gtid_216850 *\n                                                             s_n_m_203636 +\n                                                             gtid_216851];\n        \n        double defunc_2_reduce_res_216856;\n        \n        defunc_2_reduce_res_216856 = ((__global\n                                       double *) mem_230327)[gtid_216849 *\n                                                             (s_n_m_203636 *\n                                                              n_p_203492) +\n                                                             gtid_216850 *\n                                                             s_n_m_203636 +\n                                                             gtid_216851];\n        \n        double defunc_2_reduce_res_216857;\n        \n        defunc_2_reduce_res_216857 = ((__global\n                                       double *) mem_230332)[gtid_216849 *\n                                                             (s_n_m_203636 *\n                                                              n_p_203492) +\n                                                             gtid_216850 *\n                                                             s_n_m_203636 +\n                                                             gtid_216851];\n        \n        double defunc_2_reduce_res_216858;\n        \n        defunc_2_reduce_res_216858 = ((__global\n                                       double *) mem_230337)[gtid_216849 *\n                                                             (s_n_m_203636 *\n                                                              n_p_203492) +\n                                                             gtid_216850 *\n        ",
            "                                                     s_n_m_203636 +\n                                                             gtid_216851];\n        \n        double defunc_2_reduce_res_216859;\n        \n        defunc_2_reduce_res_216859 = ((__global\n                                       double *) mem_230342)[gtid_216849 *\n                                                             (s_n_m_203636 *\n                                                              n_p_203492) +\n                                                             gtid_216850 *\n                                                             s_n_m_203636 +\n                                                             gtid_216851];\n        \n        double x_216860 = defunc_2_reduce_res_216857 *\n               defunc_2_reduce_res_216859;\n        double y_216861 = defunc_2_reduce_res_216858 *\n               defunc_2_reduce_res_216858;\n        double a12_216862 = x_216860 - y_216861;\n        double x_216863 = defunc_2_reduce_res_216857 *\n               defunc_2_reduce_res_216858;\n        double y_216864 = defunc_2_reduce_res_216856 *\n               defunc_2_reduce_res_216859;\n        double b12_216865 = x_216863 - y_216864;\n        double x_216866 = defunc_2_reduce_res_216856 *\n               defunc_2_reduce_res_216858;\n        double y_216867 = defunc_2_reduce_res_216857 *\n               defunc_2_reduce_res_216857;\n        double c12_216868 = x_216866 - y_216867;\n        double x_216869 = defunc_2_reduce_res_216855 *\n               defunc_2_reduce_res_216859;\n        double b2_216870 = x_216869 - y_216867;\n        double x_216871 = defunc_2_reduce_res_216856 *\n               defunc_2_reduce_res_216857;\n        double y_216872 = defunc_2_reduce_res_216855 *\n               defunc_2_reduce_res_216858;\n        double c2_216873 = x_216871 - y_216872;\n        double x_216874 = defunc_2_reduce_res_216855 * a12_216862;\n        double y_216875 = defunc_2_reduce_res_216856 * b12_216865;\n        double x_216876 = ",
            "x_216874 + y_216875;\n        double y_216877 = defunc_2_reduce_res_216857 * c12_216868;\n        double y_216878 = x_216876 + y_216877;\n        double det_216879 = 1.0 / y_216878;\n        double a12_216880 = a12_216862 * det_216879;\n        double b12_216881 = b12_216865 * det_216879;\n        double c12_216882 = c12_216868 * det_216879;\n        double b2_216883 = b2_216870 * det_216879;\n        double c2_216884 = c2_216873 * det_216879;\n        int64_t defunc_0_m_fun_res_216885;\n        \n        if (index_primexp_228734) {\n            defunc_0_m_fun_res_216885 = (int64_t) 0;\n        } else {\n            int64_t y_216886 = sub64(s_n_m_203636, (int64_t) 1);\n            bool cond_216887 = gtid_216851 == y_216886;\n            int64_t defunc_0_m_fun_res_f_res_216888;\n            \n            if (cond_216887) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_216889 =\n                        sub64(pad_css_len_203632, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_216888 =\n                    defunc_0_m_fun_res_f_res_t_res_216889;\n            } else {\n                int64_t x_216890 = sub64(gtid_216851, (int64_t) 1);\n                int64_t x_216891 = mul64(jump_s_203499, x_216890);\n                int64_t min_arg_216892 = add64((int64_t) 1, x_216891);\n                int64_t min_res_216893 = smin64(defunc_0_f_res_203631,\n                                                min_arg_216892);\n                \n                defunc_0_m_fun_res_f_res_216888 = min_res_216893;\n            }\n            defunc_0_m_fun_res_216885 = defunc_0_m_fun_res_f_res_216888;\n        }\n        ((__global double *) mem_230348)[gtid_216849 * (s_n_m_203636 *\n                                                        n_p_203492) +\n                                         gtid_216850 * s_n_m_203636 +\n                                         gtid_216851] = a12_216880;\n        ((__global double *) mem_230353)[gtid_216849 * (s_n_m_203636 *\n                                     ",
            "                   n_p_203492) +\n                                         gtid_216850 * s_n_m_203636 +\n                                         gtid_216851] = b12_216881;\n        ((__global double *) mem_230358)[gtid_216849 * (s_n_m_203636 *\n                                                        n_p_203492) +\n                                         gtid_216850 * s_n_m_203636 +\n                                         gtid_216851] = c12_216882;\n        ((__global double *) mem_230363)[gtid_216849 * (s_n_m_203636 *\n                                                        n_p_203492) +\n                                         gtid_216850 * s_n_m_203636 +\n                                         gtid_216851] = b2_216883;\n        ((__global double *) mem_230368)[gtid_216849 * (s_n_m_203636 *\n                                                        n_p_203492) +\n                                         gtid_216850 * s_n_m_203636 +\n                                         gtid_216851] = c2_216884;\n        ((__global int64_t *) mem_230373)[gtid_216849 * (s_n_m_203636 *\n                                                         n_p_203492) +\n                                          gtid_216850 * s_n_m_203636 +\n                                          gtid_216851] =\n            defunc_0_m_fun_res_216885;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_216841\n}\n__kernel void mainzisegmap_218413(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_p_203492, int64_t jump_s_203499,\n                                  int64_t partition_sizze_203577,\n                                  int64_t defunc_0_f_res_203631,\n                                  int64_t pad_css_len_203632,\n                                  int64_t s_n_m_203636, __global\n                                  unsigned char *ext_mem_230486, __global\n     ",
            "                             unsigned char *ext_mem_230487, __global\n                                  unsigned char *mem_230493)\n{\n    #define segmap_group_sizze_218407 (mainzisegmap_group_sizze_218115)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234195;\n    int32_t local_tid_234196;\n    int64_t group_sizze_234199;\n    int32_t wave_sizze_234198;\n    int32_t group_tid_234197;\n    \n    global_tid_234195 = get_global_id(0);\n    local_tid_234196 = get_local_id(0);\n    group_sizze_234199 = get_local_size(0);\n    wave_sizze_234198 = LOCKSTEP_WIDTH;\n    group_tid_234197 = get_group_id(0);\n    \n    int32_t phys_tid_218413 = global_tid_234195;\n    int64_t global_tid_234200 = sext_i32_i64(group_tid_234197) *\n            segmap_group_sizze_218407 + sext_i32_i64(local_tid_234196);\n    int64_t slice_234201 = pad_css_len_203632;\n    int64_t slice_234202 = n_p_203492 * slice_234201;\n    int64_t slice_234203 = partition_sizze_203577 * slice_234202;\n    int64_t gtid_218410 = squot64(global_tid_234200, slice_234202);\n    int64_t remnant_234204 = global_tid_234200 - gtid_218410 * slice_234202;\n    int64_t gtid_218411 = squot64(remnant_234204, slice_234201);\n    int64_t remnant_234205 = remnant_234204 - gtid_218411 * slice_234201;\n    int64_t gtid_218412 = remnant_234205;\n    int64_t remnant_234206 = remnant_234205 - gtid_218412;\n    \n    if ((slt64(gtid_218410, partition_sizze_203577) && slt64(gtid_218411,\n                                                             n_p_203492)) &&\n        slt64(gtid_218412, pad_css_len_203632)) {\n        bool cond_218417 = gtid_218412 == (int64_t) 0;\n        double defunc_0_f_res_218418;\n        \n        if (cond_218417) {\n            bool y_218419 = slt64((int64_t) 0, s_n_m_203636);\n            bool index_certs_218420;\n            \n            if (!y_218419) {\n                {\n                    if (atomic_cmpxchg_i32_",
            "global(global_failure, -1, 38) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) (int64_t) 0;\n                        global_failure_args[1] = (int64_t) s_n_m_203636;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            double head_res_218421;\n            \n            head_res_218421 = ((__global double *) ext_mem_230487)[gtid_218410 *\n                                                                   (s_n_m_203636 *\n                                                                    n_p_203492) +\n                                                                   gtid_218411 *\n                                                                   s_n_m_203636];\n            defunc_0_f_res_218418 = head_res_218421;\n        } else {\n            int64_t y_218422 = sub64(pad_css_len_203632, (int64_t) 1);\n            bool cond_218423 = gtid_218412 == y_218422;\n            double defunc_0_f_res_f_res_218424;\n            \n            if (cond_218423) {\n                int64_t i_218425 = sub64(s_n_m_203636, (int64_t) 1);\n                bool x_218426 = sle64((int64_t) 0, i_218425);\n                bool y_218427 = slt64(i_218425, s_n_m_203636);\n                bool bounds_check_218428 = x_218426 && y_218427;\n                bool index_certs_218429;\n                \n                if (!bounds_check_218428) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 39) ==\n                            -1) {\n                            global_failure_args[0] = (int64_t) i_218425;\n                            global_failure_args[1] = (int64_t) s_n_m_203636;\n                            ;\n                        }\n                        return;\n                    }\n                }\n                \n                double last_res_218430;\n                \n                last_res_218430 = ((__global\n                            ",
            "        double *) ext_mem_230487)[gtid_218410 *\n                                                              (s_n_m_203636 *\n                                                               n_p_203492) +\n                                                              gtid_218411 *\n                                                              s_n_m_203636 +\n                                                              i_218425];\n                defunc_0_f_res_f_res_218424 = last_res_218430;\n            } else {\n                int64_t x_218431 = sub64(gtid_218412, (int64_t) 1);\n                bool zzero_218432 = jump_s_203499 == (int64_t) 0;\n                bool nonzzero_218433 = !zzero_218432;\n                bool nonzzero_cert_218434;\n                \n                if (!nonzzero_218433) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 40) ==\n                            -1) {\n                            ;\n                        }\n                        return;\n                    }\n                }\n                \n                int64_t x_218435 = sdiv64(x_218431, jump_s_203499);\n                int64_t m_v_218436 = add64((int64_t) 1, x_218435);\n                int64_t j_218437;\n                \n                if (cond_218417) {\n                    j_218437 = (int64_t) 0;\n                } else {\n                    int64_t y_218438 = sub64(s_n_m_203636, (int64_t) 1);\n                    bool cond_218439 = m_v_218436 == y_218438;\n                    int64_t j_f_res_218440;\n                    \n                    if (cond_218439) {\n                        j_f_res_218440 = x_218435;\n                    } else {\n                        j_f_res_218440 = m_v_218436;\n                    }\n                    j_218437 = j_f_res_218440;\n                }\n                \n                bool cond_218441 = j_218437 == (int64_t) 0;\n                int64_t defunc_0_m_fun_res_218442;\n                \n                if (co",
            "nd_218441) {\n                    defunc_0_m_fun_res_218442 = (int64_t) 0;\n                } else {\n                    int64_t y_218443 = sub64(s_n_m_203636, (int64_t) 1);\n                    bool cond_218444 = j_218437 == y_218443;\n                    int64_t defunc_0_m_fun_res_f_res_218445;\n                    \n                    if (cond_218444) {\n                        defunc_0_m_fun_res_f_res_218445 = y_218422;\n                    } else {\n                        int64_t x_218446 = sub64(j_218437, (int64_t) 1);\n                        int64_t x_218447 = mul64(jump_s_203499, x_218446);\n                        int64_t min_arg_218448 = add64((int64_t) 1, x_218447);\n                        int64_t min_res_218449 = smin64(defunc_0_f_res_203631,\n                                                        min_arg_218448);\n                        \n                        defunc_0_m_fun_res_f_res_218445 = min_res_218449;\n                    }\n                    defunc_0_m_fun_res_218442 = defunc_0_m_fun_res_f_res_218445;\n                }\n                \n                int64_t defunc_0_m_fun_arg_218450 = add64((int64_t) 1,\n                                                          j_218437);\n                bool cond_218451 = defunc_0_m_fun_arg_218450 == (int64_t) 0;\n                int64_t defunc_0_m_fun_res_218452;\n                \n                if (cond_218451) {\n                    defunc_0_m_fun_res_218452 = (int64_t) 0;\n                } else {\n                    int64_t y_218453 = sub64(s_n_m_203636, (int64_t) 1);\n                    bool cond_218454 = defunc_0_m_fun_arg_218450 == y_218453;\n                    int64_t defunc_0_m_fun_res_f_res_218455;\n                    \n                    if (cond_218454) {\n                        defunc_0_m_fun_res_f_res_218455 = y_218422;\n                    } else {\n                        int64_t x_218456 = mul64(jump_s_203499, j_218437);\n                        int64_t min_arg_218457 = add64((int64_t) 1, x_218456);\n    ",
            "                    int64_t min_res_218458 = smin64(defunc_0_f_res_203631,\n                                                        min_arg_218457);\n                        \n                        defunc_0_m_fun_res_f_res_218455 = min_res_218458;\n                    }\n                    defunc_0_m_fun_res_218452 = defunc_0_m_fun_res_f_res_218455;\n                }\n                \n                int64_t i64_arg_218459 = sub64(defunc_0_m_fun_res_218452,\n                                               defunc_0_m_fun_res_218442);\n                double i64_res_218460 = sitofp_i64_f64(i64_arg_218459);\n                int64_t i64_arg_218461 = sub64(gtid_218412,\n                                               defunc_0_m_fun_res_218442);\n                double i64_res_218462 = sitofp_i64_f64(i64_arg_218461);\n                double u_218463 = i64_res_218462 / i64_res_218460;\n                double u2_218464 = u_218463 * u_218463;\n                double u3_218465 = u_218463 * u2_218464;\n                double x_218466 = 2.0 * u3_218465;\n                double y_218467 = 3.0 * u2_218464;\n                double x_218468 = x_218466 - y_218467;\n                double x_218469 = 1.0 + x_218468;\n                bool x_218470 = sle64((int64_t) 0, j_218437);\n                bool y_218471 = slt64(j_218437, s_n_m_203636);\n                bool bounds_check_218472 = x_218470 && y_218471;\n                bool index_certs_218473;\n                \n                if (!bounds_check_218472) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 41) ==\n                            -1) {\n                            global_failure_args[0] = (int64_t) j_218437;\n                            global_failure_args[1] = (int64_t) s_n_m_203636;\n                            ;\n                        }\n                        return;\n                    }\n                }\n                \n                double y_218474;\n                \n                y_218474 =",
            " ((__global double *) ext_mem_230487)[gtid_218410 *\n                                                                (s_n_m_203636 *\n                                                                 n_p_203492) +\n                                                                gtid_218411 *\n                                                                s_n_m_203636 +\n                                                                j_218437];\n                \n                double x_218475 = x_218469 * y_218474;\n                double x_218476 = y_218467 - x_218466;\n                bool x_218477 = sle64((int64_t) 0, defunc_0_m_fun_arg_218450);\n                bool y_218478 = slt64(defunc_0_m_fun_arg_218450, s_n_m_203636);\n                bool bounds_check_218479 = x_218477 && y_218478;\n                bool index_certs_218480;\n                \n                if (!bounds_check_218479) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 42) ==\n                            -1) {\n                            global_failure_args[0] =\n                                (int64_t) defunc_0_m_fun_arg_218450;\n                            global_failure_args[1] = (int64_t) s_n_m_203636;\n                            ;\n                        }\n                        return;\n                    }\n                }\n                \n                double y_218481;\n                \n                y_218481 = ((__global double *) ext_mem_230487)[gtid_218410 *\n                                                                (s_n_m_203636 *\n                                                                 n_p_203492) +\n                                                                gtid_218411 *\n                                                                s_n_m_203636 +\n                                                                defunc_0_m_fun_arg_218450];\n                \n                double y_218482 = x_218476 * y_218481;\n               ",
            " double x_218483 = x_218475 + y_218482;\n                double y_218484 = 2.0 * u2_218464;\n                double x_218485 = u3_218465 - y_218484;\n                double x_218486 = u_218463 + x_218485;\n                double y_218487;\n                \n                y_218487 = ((__global double *) ext_mem_230486)[gtid_218410 *\n                                                                (s_n_m_203636 *\n                                                                 n_p_203492) +\n                                                                gtid_218411 *\n                                                                s_n_m_203636 +\n                                                                j_218437];\n                \n                double x_218488 = x_218486 * y_218487;\n                double y_218489 = i64_res_218460 * x_218488;\n                double x_218490 = x_218483 + y_218489;\n                double x_218491 = u3_218465 - u2_218464;\n                double y_218492;\n                \n                y_218492 = ((__global double *) ext_mem_230486)[gtid_218410 *\n                                                                (s_n_m_203636 *\n                                                                 n_p_203492) +\n                                                                gtid_218411 *\n                                                                s_n_m_203636 +\n                                                                defunc_0_m_fun_arg_218450];\n                \n                double x_218493 = x_218491 * y_218492;\n                double y_218494 = i64_res_218460 * x_218493;\n                double defunc_4_interpolate_proc_res_218495 = x_218490 +\n                       y_218494;\n                \n                defunc_0_f_res_f_res_218424 =\n                    defunc_4_interpolate_proc_res_218495;\n            }\n            defunc_0_f_res_218418 = defunc_0_f_res_f_res_218424;\n        }\n        ((__global double *) mem_230493)[gtid_218",
            "410 * (pad_css_len_203632 *\n                                                        n_p_203492) +\n                                         gtid_218411 * pad_css_len_203632 +\n                                         gtid_218412] = defunc_0_f_res_218418;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_218407\n}\n__kernel void mainzisegmap_218562(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_p_203492,\n                                  int64_t partition_sizze_203577,\n                                  int64_t C_len_203634,\n                                  int64_t css_results_l_204110, __global\n                                  unsigned char *ext_mem_230494, __global\n                                  unsigned char *mem_230500)\n{\n    #define segmap_group_sizze_218557 (mainzisegmap_group_sizze_218511)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234207;\n    int32_t local_tid_234208;\n    int64_t group_sizze_234211;\n    int32_t wave_sizze_234210;\n    int32_t group_tid_234209;\n    \n    global_tid_234207 = get_global_id(0);\n    local_tid_234208 = get_local_id(0);\n    group_sizze_234211 = get_local_size(0);\n    wave_sizze_234210 = LOCKSTEP_WIDTH;\n    group_tid_234209 = get_group_id(0);\n    \n    int32_t phys_tid_218562 = global_tid_234207;\n    int64_t global_tid_234212 = sext_i32_i64(group_tid_234209) *\n            segmap_group_sizze_218557 + sext_i32_i64(local_tid_234208);\n    int64_t slice_234213 = C_len_203634;\n    int64_t slice_234214 = partition_sizze_203577 * slice_234213;\n    int64_t gtid_218560 = squot64(global_tid_234212, slice_234213);\n    int64_t remnant_234215 = global_tid_234212 - gtid_218560 * slice_234213;\n    int64_t gtid_218561 = remnant_234215;\n    int64_t remnan",
            "t_234216 = remnant_234215 - gtid_218561;\n    \n    if (slt64(gtid_218560, partition_sizze_203577) && slt64(gtid_218561,\n                                                            C_len_203634)) {\n        int64_t i_218565 = smod64(gtid_218561, n_p_203492);\n        bool x_218566 = sle64((int64_t) 0, i_218565);\n        bool y_218567 = slt64(i_218565, n_p_203492);\n        bool bounds_check_218568 = x_218566 && y_218567;\n        int64_t i_218569 = sdiv64(gtid_218561, n_p_203492);\n        bool x_218570 = sle64((int64_t) 0, i_218569);\n        bool y_218571 = slt64(i_218569, css_results_l_204110);\n        bool bounds_check_218572 = x_218570 && y_218571;\n        bool index_ok_218573 = bounds_check_218568 && bounds_check_218572;\n        bool index_certs_218574;\n        \n        if (!index_ok_218573) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 43) == -1) {\n                    global_failure_args[0] = (int64_t) i_218565;\n                    global_failure_args[1] = (int64_t) i_218569;\n                    global_failure_args[2] = (int64_t) n_p_203492;\n                    global_failure_args[3] = (int64_t) css_results_l_204110;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        double defunc_0_f_res_218575;\n        \n        defunc_0_f_res_218575 = ((__global\n                                  double *) ext_mem_230494)[gtid_218560 *\n                                                            (css_results_l_204110 *\n                                                             n_p_203492) +\n                                                            i_218565 *\n                                                            css_results_l_204110 +\n                                                            i_218569];\n        ((__global double *) mem_230500)[gtid_218560 * C_len_203634 +\n                                         gtid_218561] = defunc_0_f_res_218575;\n    }\n    \n  error_0:\n    return;\n  ",
            "  #undef segmap_group_sizze_218557\n}\n__kernel void mainzisegmap_218598(__global int *global_failure,\n                                  int64_t n_p_203492,\n                                  int64_t partition_sizze_203577, __global\n                                  unsigned char *mem_230503, __global\n                                  unsigned char *mem_230507)\n{\n    #define segmap_group_sizze_218594 (mainzisegmap_group_sizze_218582)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234217;\n    int32_t local_tid_234218;\n    int64_t group_sizze_234221;\n    int32_t wave_sizze_234220;\n    int32_t group_tid_234219;\n    \n    global_tid_234217 = get_global_id(0);\n    local_tid_234218 = get_local_id(0);\n    group_sizze_234221 = get_local_size(0);\n    wave_sizze_234220 = LOCKSTEP_WIDTH;\n    group_tid_234219 = get_group_id(0);\n    \n    int32_t phys_tid_218598 = global_tid_234217;\n    int64_t global_tid_234222 = sext_i32_i64(group_tid_234219) *\n            segmap_group_sizze_218594 + sext_i32_i64(local_tid_234218);\n    int64_t slice_234223 = partition_sizze_203577;\n    int64_t gtid_218597 = global_tid_234222;\n    int64_t remnant_234224 = global_tid_234222 - gtid_218597;\n    \n    if (slt64(gtid_218597, partition_sizze_203577)) {\n        double defunc_2_reduce_res_218600;\n        double redout_228979 = 0.0;\n        \n        for (int64_t i_228980 = 0; i_228980 < n_p_203492; i_228980++) {\n            double x_218604;\n            \n            x_218604 = ((__global double *) mem_230503)[i_228980 *\n                                                        partition_sizze_203577 +\n                                                        gtid_218597];\n            \n            double defunc_1_op_res_218603 = x_218604 + redout_228979;\n            double redout_tmp_234225 = defunc_1_op_res_218603;\n            \n            redout_228979 = redout_tmp_234225;\n        }\n     ",
            "   defunc_2_reduce_res_218600 = redout_228979;\n        ((__global double *) mem_230507)[gtid_218597] =\n            defunc_2_reduce_res_218600;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_218594\n}\n__kernel void mainzisegmap_218729(__global int *global_failure,\n                                  int64_t n_p_203492,\n                                  int64_t partition_sizze_203577, __global\n                                  unsigned char *mem_230520, __global\n                                  unsigned char *mem_230524)\n{\n    #define segmap_group_sizze_218725 (mainzisegmap_group_sizze_218713)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234398;\n    int32_t local_tid_234399;\n    int64_t group_sizze_234402;\n    int32_t wave_sizze_234401;\n    int32_t group_tid_234400;\n    \n    global_tid_234398 = get_global_id(0);\n    local_tid_234399 = get_local_id(0);\n    group_sizze_234402 = get_local_size(0);\n    wave_sizze_234401 = LOCKSTEP_WIDTH;\n    group_tid_234400 = get_group_id(0);\n    \n    int32_t phys_tid_218729 = global_tid_234398;\n    int64_t global_tid_234403 = sext_i32_i64(group_tid_234400) *\n            segmap_group_sizze_218725 + sext_i32_i64(local_tid_234399);\n    int64_t slice_234404 = partition_sizze_203577;\n    int64_t gtid_218728 = global_tid_234403;\n    int64_t remnant_234405 = global_tid_234403 - gtid_218728;\n    \n    if (slt64(gtid_218728, partition_sizze_203577)) {\n        double defunc_2_reduce_res_218731;\n        double redout_228981 = 0.0;\n        \n        for (int64_t i_228982 = 0; i_228982 < n_p_203492; i_228982++) {\n            double x_218735;\n            \n            x_218735 = ((__global double *) mem_230520)[i_228982 *\n                                                        partition_sizze_203577 +\n                                                        gtid_218728];\n            \n            double defunc_1_o",
            "p_res_218734 = x_218735 + redout_228981;\n            double redout_tmp_234406 = defunc_1_op_res_218734;\n            \n            redout_228981 = redout_tmp_234406;\n        }\n        defunc_2_reduce_res_218731 = redout_228981;\n        ((__global double *) mem_230524)[gtid_218728] =\n            defunc_2_reduce_res_218731;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_218725\n}\n__kernel void mainzisegmap_218860(__global int *global_failure,\n                                  int64_t partition_sizze_203577, __global\n                                  unsigned char *mem_230537, __global\n                                  unsigned char *mem_230541)\n{\n    #define segmap_group_sizze_218856 (mainzisegmap_group_sizze_218844)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234579;\n    int32_t local_tid_234580;\n    int64_t group_sizze_234583;\n    int32_t wave_sizze_234582;\n    int32_t group_tid_234581;\n    \n    global_tid_234579 = get_global_id(0);\n    local_tid_234580 = get_local_id(0);\n    group_sizze_234583 = get_local_size(0);\n    wave_sizze_234582 = LOCKSTEP_WIDTH;\n    group_tid_234581 = get_group_id(0);\n    \n    int32_t phys_tid_218860 = global_tid_234579;\n    int64_t global_tid_234584 = sext_i32_i64(group_tid_234581) *\n            segmap_group_sizze_218856 + sext_i32_i64(local_tid_234580);\n    int64_t slice_234585 = partition_sizze_203577;\n    int64_t gtid_218859 = global_tid_234584;\n    int64_t remnant_234586 = global_tid_234584 - gtid_218859;\n    \n    if (slt64(gtid_218859, partition_sizze_203577)) {\n        double defunc_2_reduce_res_218862;\n        double redout_228983 = 0.0;\n        \n        for (int32_t i_229107 = 0; i_229107 < 3; i_229107++) {\n            int64_t i_228984 = sext_i32_i64(i_229107);\n            double x_218866;\n            \n            x_218866 = ((__global double *) mem_230537)[i_228984 *\n                      ",
            "                                  partition_sizze_203577 +\n                                                        gtid_218859];\n            \n            double defunc_1_op_res_218865 = x_218866 + redout_228983;\n            double redout_tmp_234587 = defunc_1_op_res_218865;\n            \n            redout_228983 = redout_tmp_234587;\n        }\n        defunc_2_reduce_res_218862 = redout_228983;\n        ((__global double *) mem_230541)[gtid_218859] =\n            defunc_2_reduce_res_218862;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_218856\n}\n__kernel void mainzisegmap_219049(__global int *global_failure,\n                                  int64_t n_203490, int64_t q_l_203495,\n                                  int64_t jump_t_203500,\n                                  int64_t partition_sizze_203577,\n                                  int64_t l_n_m_203643, int64_t i_203670,\n                                  int64_t num_groups_219045,\n                                  int64_t num_threads_232157, __global\n                                  unsigned char *mem_230558, __global\n                                  unsigned char *mem_230561, __global\n                                  unsigned char *mem_230564, __global\n                                  unsigned char *mem_230567, __global\n                                  unsigned char *mem_230586, __global\n                                  unsigned char *color_232027)\n{\n    #define segmap_group_sizze_219044 (mainzisegmap_group_sizze_218975)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234775;\n    int32_t local_tid_234776;\n    int64_t group_sizze_234779;\n    int32_t wave_sizze_234778;\n    int32_t group_tid_234777;\n    \n    global_tid_234775 = get_global_id(0);\n    local_tid_234776 = get_local_id(0);\n    group_sizze_234779 = get_local_size(0);\n    wave_sizze_234778 = LOCKSTEP_WIDTH;\n    gr",
            "oup_tid_234777 = get_group_id(0);\n    \n    int32_t phys_tid_219049 = global_tid_234775;\n    int32_t phys_group_id_234780;\n    \n    phys_group_id_234780 = get_group_id(0);\n    for (int32_t i_234781 = 0; i_234781 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577,\n                                          segmap_group_sizze_219044)) -\n                   phys_group_id_234780, sext_i64_i32(num_groups_219045));\n         i_234781++) {\n        int32_t virt_group_id_234782 = phys_group_id_234780 + i_234781 *\n                sext_i64_i32(num_groups_219045);\n        int64_t global_tid_234783 = sext_i32_i64(virt_group_id_234782) *\n                segmap_group_sizze_219044 + sext_i32_i64(local_tid_234776);\n        int64_t slice_234784 = partition_sizze_203577;\n        int64_t gtid_219048 = global_tid_234783;\n        int64_t remnant_234785 = global_tid_234783 - gtid_219048;\n        \n        if (slt64(gtid_219048, partition_sizze_203577)) {\n            for (int64_t i_228987 = 0; i_228987 < l_n_m_203643; i_228987++) {\n                int64_t x_219056;\n                \n                x_219056 = ((__global int64_t *) mem_230558)[i_228987 *\n                                                             partition_sizze_203577 +\n                                                             gtid_219048];\n                \n                double x_219057;\n                \n                x_219057 = ((__global double *) mem_230561)[i_228987 *\n                                                            partition_sizze_203577 +\n                                                            gtid_219048];\n                \n                int64_t min_arg_219058 = mul64(jump_t_203500, i_228987);\n                int64_t min_res_219059 = smin64(i_203670, min_arg_219058);\n                int64_t defunc_0_g_res_219060 = add64((int64_t) 1,\n                                                      min_res_219059);\n                double defunc_2_reduce_res_219061;\n                double redout_",
            "228331 = 0.0;\n                \n                for (int64_t i_228332 = 0; i_228332 < q_l_203495; i_228332++) {\n                    bool cond_219066 = sle64(n_203490, i_228332);\n                    int64_t defunc_0_f_res_219067;\n                    \n                    if (cond_219066) {\n                        defunc_0_f_res_219067 = (int64_t) 0;\n                    } else {\n                        int64_t i_219068 = add64(x_219056, i_228332);\n                        int64_t defunc_1_add_res_219069 = add64((int64_t) 1,\n                                                                i_219068);\n                        \n                        defunc_0_f_res_219067 = defunc_1_add_res_219069;\n                    }\n                    \n                    double defunc_0_f_res_219070;\n                    \n                    if (cond_219066) {\n                        defunc_0_f_res_219070 = 0.0;\n                    } else {\n                        int64_t i_219071 = add64(x_219056, i_228332);\n                        double defunc_0_add_arg_219072;\n                        \n                        defunc_0_add_arg_219072 = ((__global\n                                                    double *) mem_230564)[i_219071 *\n                                                                          partition_sizze_203577 +\n                                                                          gtid_219048];\n                        defunc_0_f_res_219070 = defunc_0_add_arg_219072;\n                    }\n                    \n                    int64_t binop_p_219073 = sub64(defunc_0_f_res_219067,\n                                                   defunc_0_g_res_219060);\n                    double defunc_0_f_res_219074 =\n                           sitofp_i64_f64(binop_p_219073);\n                    double abs_res_219075 = fabs(defunc_0_f_res_219074);\n                    double tmp1_219076 = abs_res_219075 / x_219057;\n                    double x_219077 = tmp1_219076 * tmp1_219076;\n  ",
            "                  double y_219078 = tmp1_219076 * x_219077;\n                    double tmp2_219079 = 1.0 - y_219078;\n                    double x_219080 = tmp2_219079 * tmp2_219079;\n                    double tmp3_219081 = tmp2_219079 * x_219080;\n                    double w_j_219082 = defunc_0_f_res_219070 * tmp3_219081;\n                    double defunc_1_op_res_219064 = w_j_219082 + redout_228331;\n                    double redout_tmp_234787 = defunc_1_op_res_219064;\n                    \n                    redout_228331 = redout_tmp_234787;\n                }\n                defunc_2_reduce_res_219061 = redout_228331;\n                \n                double a0_219083 = 1.0 / defunc_2_reduce_res_219061;\n                double defunc_2_reduce_res_219084;\n                double redout_228333 = 0.0;\n                \n                for (int64_t i_228334 = 0; i_228334 < q_l_203495; i_228334++) {\n                    bool cond_219089 = sle64(n_203490, i_228334);\n                    int64_t defunc_0_f_res_219090;\n                    \n                    if (cond_219089) {\n                        defunc_0_f_res_219090 = (int64_t) 0;\n                    } else {\n                        int64_t i_219091 = add64(x_219056, i_228334);\n                        int64_t defunc_1_add_res_219092 = add64((int64_t) 1,\n                                                                i_219091);\n                        \n                        defunc_0_f_res_219090 = defunc_1_add_res_219092;\n                    }\n                    \n                    double defunc_0_f_res_219093;\n                    \n                    if (cond_219089) {\n                        defunc_0_f_res_219093 = 0.0;\n                    } else {\n                        int64_t i_219094 = add64(x_219056, i_228334);\n                        double defunc_0_add_arg_219095;\n                        \n                        defunc_0_add_arg_219095 = ((__global\n                                                    double ",
            "*) mem_230564)[i_219094 *\n                                                                          partition_sizze_203577 +\n                                                                          gtid_219048];\n                        defunc_0_f_res_219093 = defunc_0_add_arg_219095;\n                    }\n                    \n                    int64_t binop_p_219096 = sub64(defunc_0_f_res_219090,\n                                                   defunc_0_g_res_219060);\n                    double defunc_0_f_res_219097 =\n                           sitofp_i64_f64(binop_p_219096);\n                    double abs_res_219098 = fabs(defunc_0_f_res_219097);\n                    double tmp1_219099 = abs_res_219098 / x_219057;\n                    double x_219100 = tmp1_219099 * tmp1_219099;\n                    double y_219101 = tmp1_219099 * x_219100;\n                    double tmp2_219102 = 1.0 - y_219101;\n                    double x_219103 = tmp2_219102 * tmp2_219102;\n                    double tmp3_219104 = tmp2_219102 * x_219103;\n                    double tmp4_219105 = defunc_0_f_res_219093 * tmp3_219104;\n                    double defunc_0_f_res_219106;\n                    \n                    if (cond_219089) {\n                        defunc_0_f_res_219106 = 0.0;\n                    } else {\n                        int64_t i_219107 = add64(x_219056, i_228334);\n                        double defunc_0_add_arg_219108;\n                        \n                        defunc_0_add_arg_219108 = ((__global\n                                                    double *) mem_230567)[i_219107 *\n                                                                          partition_sizze_203577 +\n                                                                          gtid_219048];\n                        defunc_0_f_res_219106 = defunc_0_add_arg_219108;\n                    }\n                    \n                    double x_219109 = a0_219083 * tmp4_219105;\n                    doub",
            "le defunc_9_fit_fun_res_219110 = defunc_0_f_res_219106 *\n                           x_219109;\n                    double defunc_1_op_res_219087 =\n                           defunc_9_fit_fun_res_219110 + redout_228333;\n                    double redout_tmp_234788 = defunc_1_op_res_219087;\n                    \n                    redout_228333 = redout_tmp_234788;\n                }\n                defunc_2_reduce_res_219084 = redout_228333;\n                ((__global double *) color_232027)[phys_tid_219049 + i_228987 *\n                                                   num_threads_232157] =\n                    defunc_2_reduce_res_219084;\n            }\n            for (int64_t i_234789 = 0; i_234789 < l_n_m_203643; i_234789++) {\n                double tmp_234790;\n                \n                tmp_234790 = ((__global\n                               double *) color_232027)[phys_tid_219049 +\n                                                       i_234789 *\n                                                       num_threads_232157];\n                ((__global double *) mem_230586)[gtid_219048 + i_234789 *\n                                                 partition_sizze_203577] =\n                    tmp_234790;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_219044\n}\n__kernel void mainzisegmap_219434(__global int *global_failure,\n                                  int64_t n_203490, int64_t q_l_203495,\n                                  int64_t jump_t_203500,\n                                  int64_t partition_sizze_203577,\n                                  int64_t l_n_m_203643, int64_t i_203670,\n                                  int64_t ctx_param_ext_229488,\n                                  int64_t ctx_param_ext_229489,\n                                  int64_t ctx_param_ext_229491, __global\n                                  unsigned char *ext_mem_229411, __global\n          ",
            "                        unsigned char *ext_mem_229412, __global\n                                  unsigned char *mem_param_229493, __global\n                                  unsigned char *mem_230551, __global\n                                  unsigned char *mem_230591)\n{\n    #define segmap_group_sizze_219425 (mainzisegmap_group_sizze_219116)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234791;\n    int32_t local_tid_234792;\n    int64_t group_sizze_234795;\n    int32_t wave_sizze_234794;\n    int32_t group_tid_234793;\n    \n    global_tid_234791 = get_global_id(0);\n    local_tid_234792 = get_local_id(0);\n    group_sizze_234795 = get_local_size(0);\n    wave_sizze_234794 = LOCKSTEP_WIDTH;\n    group_tid_234793 = get_group_id(0);\n    \n    int32_t phys_tid_219434 = global_tid_234791;\n    int64_t global_tid_234796 = sext_i32_i64(group_tid_234793) *\n            segmap_group_sizze_219425 + sext_i32_i64(local_tid_234792);\n    int64_t slice_234797 = l_n_m_203643;\n    int64_t slice_234798 = partition_sizze_203577 * slice_234797;\n    int64_t gtid_219432 = squot64(global_tid_234796, slice_234797);\n    int64_t remnant_234799 = global_tid_234796 - gtid_219432 * slice_234797;\n    int64_t gtid_219433 = remnant_234799;\n    int64_t remnant_234800 = remnant_234799 - gtid_219433;\n    \n    if (slt64(gtid_219432, partition_sizze_203577) && slt64(gtid_219433,\n                                                            l_n_m_203643)) {\n        int64_t x_219438;\n        \n        x_219438 = ((__global int64_t *) ext_mem_229412)[gtid_219432 *\n                                                         l_n_m_203643 +\n                                                         gtid_219433];\n        \n        double x_219439;\n        \n        x_219439 = ((__global double *) ext_mem_229411)[gtid_219432 *\n                                                        l_n_m_203643 +\n       ",
            "                                                 gtid_219433];\n        \n        int64_t min_arg_219440 = mul64(jump_t_203500, gtid_219433);\n        int64_t min_res_219441 = smin64(i_203670, min_arg_219440);\n        int64_t defunc_0_g_res_219442 = add64((int64_t) 1, min_res_219441);\n        double defunc_2_reduce_res_219443;\n        double redout_228339 = 0.0;\n        \n        for (int64_t i_228340 = 0; i_228340 < q_l_203495; i_228340++) {\n            bool cond_219448 = sle64(n_203490, i_228340);\n            int64_t defunc_0_f_res_219449;\n            \n            if (cond_219448) {\n                defunc_0_f_res_219449 = (int64_t) 0;\n            } else {\n                int64_t i_219450 = add64(x_219438, i_228340);\n                int64_t defunc_1_add_res_219451 = add64((int64_t) 1, i_219450);\n                \n                defunc_0_f_res_219449 = defunc_1_add_res_219451;\n            }\n            \n            double defunc_0_f_res_219452;\n            \n            if (cond_219448) {\n                defunc_0_f_res_219452 = 0.0;\n            } else {\n                int64_t i_219453 = add64(x_219438, i_228340);\n                double defunc_0_add_arg_219454;\n                \n                defunc_0_add_arg_219454 = ((__global\n                                            double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                                        (gtid_219432 *\n                                                                         ctx_param_ext_229489 +\n                                                                         i_219453 *\n                                                                         ctx_param_ext_229491)];\n                defunc_0_f_res_219452 = defunc_0_add_arg_219454;\n            }\n            \n            int64_t binop_p_219455 = sub64(defunc_0_f_res_219449,\n                                           defunc_0_g_res_219442);\n            double defunc_0_f_res_219456 = sitofp_i64_f64(binop_p_21945",
            "5);\n            double abs_res_219457 = fabs(defunc_0_f_res_219456);\n            double tmp1_219458 = abs_res_219457 / x_219439;\n            double x_219459 = tmp1_219458 * tmp1_219458;\n            double y_219460 = tmp1_219458 * x_219459;\n            double tmp2_219461 = 1.0 - y_219460;\n            double x_219462 = tmp2_219461 * tmp2_219461;\n            double tmp3_219463 = tmp2_219461 * x_219462;\n            double w_j_219464 = defunc_0_f_res_219452 * tmp3_219463;\n            double defunc_1_op_res_219446 = w_j_219464 + redout_228339;\n            double redout_tmp_234801 = defunc_1_op_res_219446;\n            \n            redout_228339 = redout_tmp_234801;\n        }\n        defunc_2_reduce_res_219443 = redout_228339;\n        \n        double a0_219465 = 1.0 / defunc_2_reduce_res_219443;\n        double defunc_2_reduce_res_219466;\n        double redout_228341 = 0.0;\n        \n        for (int64_t i_228342 = 0; i_228342 < q_l_203495; i_228342++) {\n            bool cond_219471 = sle64(n_203490, i_228342);\n            int64_t defunc_0_f_res_219472;\n            \n            if (cond_219471) {\n                defunc_0_f_res_219472 = (int64_t) 0;\n            } else {\n                int64_t i_219473 = add64(x_219438, i_228342);\n                int64_t defunc_1_add_res_219474 = add64((int64_t) 1, i_219473);\n                \n                defunc_0_f_res_219472 = defunc_1_add_res_219474;\n            }\n            \n            double defunc_0_f_res_219475;\n            \n            if (cond_219471) {\n                defunc_0_f_res_219475 = 0.0;\n            } else {\n                int64_t i_219476 = add64(x_219438, i_228342);\n                double defunc_0_add_arg_219477;\n                \n                defunc_0_add_arg_219477 = ((__global\n                                            double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                                        (gtid_219432 *\n                                                         ",
            "                ctx_param_ext_229489 +\n                                                                         i_219476 *\n                                                                         ctx_param_ext_229491)];\n                defunc_0_f_res_219475 = defunc_0_add_arg_219477;\n            }\n            \n            int64_t binop_p_219478 = sub64(defunc_0_f_res_219472,\n                                           defunc_0_g_res_219442);\n            double defunc_0_f_res_219479 = sitofp_i64_f64(binop_p_219478);\n            double abs_res_219480 = fabs(defunc_0_f_res_219479);\n            double tmp1_219481 = abs_res_219480 / x_219439;\n            double x_219482 = tmp1_219481 * tmp1_219481;\n            double y_219483 = tmp1_219481 * x_219482;\n            double tmp2_219484 = 1.0 - y_219483;\n            double x_219485 = tmp2_219484 * tmp2_219484;\n            double tmp3_219486 = tmp2_219484 * x_219485;\n            double tmp4_219487 = defunc_0_f_res_219475 * tmp3_219486;\n            double defunc_0_f_res_219488;\n            \n            if (cond_219471) {\n                defunc_0_f_res_219488 = 0.0;\n            } else {\n                int64_t i_219489 = add64(x_219438, i_228342);\n                double defunc_0_add_arg_219490;\n                \n                defunc_0_add_arg_219490 = ((__global\n                                            double *) mem_230551)[gtid_219432 *\n                                                                  n_203490 +\n                                                                  i_219489];\n                defunc_0_f_res_219488 = defunc_0_add_arg_219490;\n            }\n            \n            double x_219491 = a0_219465 * tmp4_219487;\n            double defunc_9_fit_fun_res_219492 = defunc_0_f_res_219488 *\n                   x_219491;\n            double defunc_1_op_res_219469 = defunc_9_fit_fun_res_219492 +\n                   redout_228341;\n            double redout_tmp_234802 = defunc_1_op_res_219469;\n            \n            ",
            "redout_228341 = redout_tmp_234802;\n        }\n        defunc_2_reduce_res_219466 = redout_228341;\n        ((__global double *) mem_230591)[gtid_219432 * l_n_m_203643 +\n                                         gtid_219433] =\n            defunc_2_reduce_res_219466;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_219425\n}\n__kernel void mainzisegmap_219551(__global int *global_failure,\n                                  int64_t partition_sizze_203577,\n                                  int64_t l_n_m_203643, __global\n                                  unsigned char *mem_230596, __global\n                                  unsigned char *mem_230601)\n{\n    #define segmap_group_sizze_219546 (mainzisegmap_group_sizze_219247)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234875;\n    int32_t local_tid_234876;\n    int64_t group_sizze_234879;\n    int32_t wave_sizze_234878;\n    int32_t group_tid_234877;\n    \n    global_tid_234875 = get_global_id(0);\n    local_tid_234876 = get_local_id(0);\n    group_sizze_234879 = get_local_size(0);\n    wave_sizze_234878 = LOCKSTEP_WIDTH;\n    group_tid_234877 = get_group_id(0);\n    \n    int32_t phys_tid_219551 = global_tid_234875;\n    int64_t global_tid_234880 = sext_i32_i64(group_tid_234877) *\n            segmap_group_sizze_219546 + sext_i32_i64(local_tid_234876);\n    int64_t slice_234881 = l_n_m_203643;\n    int64_t slice_234882 = partition_sizze_203577 * slice_234881;\n    int64_t gtid_219549 = squot64(global_tid_234880, slice_234881);\n    int64_t remnant_234883 = global_tid_234880 - gtid_219549 * slice_234881;\n    int64_t gtid_219550 = remnant_234883;\n    int64_t remnant_234884 = remnant_234883 - gtid_219550;\n    \n    if (slt64(gtid_219549, partition_sizze_203577) && slt64(gtid_219550,\n                                                            l_n_m_203643)) {\n        double defunc_2_reduce_res_219552;\n      ",
            "  \n        defunc_2_reduce_res_219552 = ((__global\n                                       double *) mem_230596)[gtid_219549 *\n                                                             l_n_m_203643 +\n                                                             gtid_219550];\n        \n        double a0_219553 = 1.0 / defunc_2_reduce_res_219552;\n        \n        ((__global double *) mem_230601)[gtid_219549 * l_n_m_203643 +\n                                         gtid_219550] = a0_219553;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_219546\n}\n__kernel void mainzisegmap_219712(__global int *global_failure,\n                                  int64_t n_203490, int64_t q_l_203495,\n                                  int64_t jump_t_203500,\n                                  int64_t partition_sizze_203577,\n                                  int64_t l_n_m_203643, int64_t i_203670,\n                                  int64_t num_groups_219707,\n                                  int64_t num_threads_232163, __global\n                                  unsigned char *mem_230616, __global\n                                  unsigned char *mem_230619, __global\n                                  unsigned char *mem_230622, __global\n                                  unsigned char *mem_230625, __global\n                                  unsigned char *mem_230659, __global\n                                  unsigned char *mem_230662, __global\n                                  unsigned char *color_232028, __global\n                                  unsigned char *color_232029)\n{\n    #define segmap_group_sizze_219706 (mainzisegmap_group_sizze_219608)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234974;\n    int32_t local_tid_234975;\n    int64_t group_sizze_234978;\n    int32_t wave_sizze_234977;\n    int32_t group_tid_234976;\n    \n    global_tid_234974 = get_gl",
            "obal_id(0);\n    local_tid_234975 = get_local_id(0);\n    group_sizze_234978 = get_local_size(0);\n    wave_sizze_234977 = LOCKSTEP_WIDTH;\n    group_tid_234976 = get_group_id(0);\n    \n    int32_t phys_tid_219712 = global_tid_234974;\n    int32_t phys_group_id_234979;\n    \n    phys_group_id_234979 = get_group_id(0);\n    for (int32_t i_234980 = 0; i_234980 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577,\n                                          segmap_group_sizze_219706)) -\n                   phys_group_id_234979, sext_i64_i32(num_groups_219707));\n         i_234980++) {\n        int32_t virt_group_id_234981 = phys_group_id_234979 + i_234980 *\n                sext_i64_i32(num_groups_219707);\n        int64_t global_tid_234982 = sext_i32_i64(virt_group_id_234981) *\n                segmap_group_sizze_219706 + sext_i32_i64(local_tid_234975);\n        int64_t slice_234983 = partition_sizze_203577;\n        int64_t gtid_219711 = global_tid_234982;\n        int64_t remnant_234984 = global_tid_234982 - gtid_219711;\n        \n        if (slt64(gtid_219711, partition_sizze_203577)) {\n            for (int64_t i_228993 = 0; i_228993 < l_n_m_203643; i_228993++) {\n                int64_t x_219720;\n                \n                x_219720 = ((__global int64_t *) mem_230616)[i_228993 *\n                                                             partition_sizze_203577 +\n                                                             gtid_219711];\n                \n                double x_219721;\n                \n                x_219721 = ((__global double *) mem_230619)[i_228993 *\n                                                            partition_sizze_203577 +\n                                                            gtid_219711];\n                \n                int64_t min_arg_219722 = mul64(jump_t_203500, i_228993);\n                int64_t min_res_219723 = smin64(i_203670, min_arg_219722);\n                int64_t defunc_0_g_res_219724 = add64((int64_t) 1,\n          ",
            "                                            min_res_219723);\n                double defunc_2_reduce_res_219725;\n                double defunc_2_reduce_res_219726;\n                double defunc_2_reduce_res_219727;\n                double redout_228355;\n                double redout_228356;\n                double redout_228357;\n                \n                redout_228355 = 0.0;\n                redout_228356 = 0.0;\n                redout_228357 = 0.0;\n                for (int64_t i_228358 = 0; i_228358 < q_l_203495; i_228358++) {\n                    bool cond_219738 = sle64(n_203490, i_228358);\n                    int64_t defunc_0_f_res_219739;\n                    \n                    if (cond_219738) {\n                        defunc_0_f_res_219739 = (int64_t) 0;\n                    } else {\n                        int64_t i_219740 = add64(x_219720, i_228358);\n                        int64_t defunc_1_add_res_219741 = add64((int64_t) 1,\n                                                                i_219740);\n                        \n                        defunc_0_f_res_219739 = defunc_1_add_res_219741;\n                    }\n                    \n                    double defunc_0_f_res_219742;\n                    \n                    if (cond_219738) {\n                        defunc_0_f_res_219742 = 0.0;\n                    } else {\n                        int64_t i_219743 = add64(x_219720, i_228358);\n                        double defunc_0_add_arg_219744;\n                        \n                        defunc_0_add_arg_219744 = ((__global\n                                                    double *) mem_230622)[i_219743 *\n                                                                          partition_sizze_203577 +\n                                                                          gtid_219711];\n                        defunc_0_f_res_219742 = defunc_0_add_arg_219744;\n                    }\n                    \n                    int64_t binop_p_219745",
            " = sub64(defunc_0_f_res_219739,\n                                                   defunc_0_g_res_219724);\n                    double defunc_0_f_res_219746 =\n                           sitofp_i64_f64(binop_p_219745);\n                    double abs_res_219747 = fabs(defunc_0_f_res_219746);\n                    double tmp1_219748 = abs_res_219747 / x_219721;\n                    double x_219749 = tmp1_219748 * tmp1_219748;\n                    double y_219750 = tmp1_219748 * x_219749;\n                    double tmp2_219751 = 1.0 - y_219750;\n                    double x_219752 = tmp2_219751 * tmp2_219751;\n                    double tmp3_219753 = tmp2_219751 * x_219752;\n                    double w_j_219754 = defunc_0_f_res_219742 * tmp3_219753;\n                    double xw_j_219755 = defunc_0_f_res_219746 * w_j_219754;\n                    double x2w_j_219756 = defunc_0_f_res_219746 * xw_j_219755;\n                    double defunc_1_op_res_219730 = w_j_219754 + redout_228355;\n                    double defunc_1_op_res_219733 = xw_j_219755 + redout_228356;\n                    double defunc_1_op_res_219736 = x2w_j_219756 +\n                           redout_228357;\n                    double redout_tmp_234987 = defunc_1_op_res_219730;\n                    double redout_tmp_234988 = defunc_1_op_res_219733;\n                    double redout_tmp_234989 = defunc_1_op_res_219736;\n                    \n                    redout_228355 = redout_tmp_234987;\n                    redout_228356 = redout_tmp_234988;\n                    redout_228357 = redout_tmp_234989;\n                }\n                defunc_2_reduce_res_219725 = redout_228355;\n                defunc_2_reduce_res_219726 = redout_228356;\n                defunc_2_reduce_res_219727 = redout_228357;\n                \n                double x_219757 = defunc_2_reduce_res_219725 *\n                       defunc_2_reduce_res_219727;\n                double y_219758 = defunc_2_reduce_res_219726 *\n                       defunc_2_re",
            "duce_res_219726;\n                double y_219759 = x_219757 - y_219758;\n                double det1_219760 = 1.0 / y_219759;\n                double a11_219761 = defunc_2_reduce_res_219727 * det1_219760;\n                double x_219762 = 0.0 - defunc_2_reduce_res_219726;\n                double b11_219763 = det1_219760 * x_219762;\n                double c11_219764 = defunc_2_reduce_res_219725 * det1_219760;\n                double defunc_2_reduce_res_219765;\n                double defunc_2_reduce_res_219766;\n                double redout_228359;\n                double redout_228360;\n                \n                redout_228359 = 0.0;\n                redout_228360 = 0.0;\n                for (int64_t i_228361 = 0; i_228361 < q_l_203495; i_228361++) {\n                    bool cond_219774 = sle64(n_203490, i_228361);\n                    int64_t defunc_0_f_res_219775;\n                    \n                    if (cond_219774) {\n                        defunc_0_f_res_219775 = (int64_t) 0;\n                    } else {\n                        int64_t i_219776 = add64(x_219720, i_228361);\n                        int64_t defunc_1_add_res_219777 = add64((int64_t) 1,\n                                                                i_219776);\n                        \n                        defunc_0_f_res_219775 = defunc_1_add_res_219777;\n                    }\n                    \n                    double defunc_0_f_res_219778;\n                    \n                    if (cond_219774) {\n                        defunc_0_f_res_219778 = 0.0;\n                    } else {\n                        int64_t i_219779 = add64(x_219720, i_228361);\n                        double defunc_0_add_arg_219780;\n                        \n                        defunc_0_add_arg_219780 = ((__global\n                                                    double *) mem_230622)[i_219779 *\n                                                                          partition_sizze_203577 +\n                        ",
            "                                                  gtid_219711];\n                        defunc_0_f_res_219778 = defunc_0_add_arg_219780;\n                    }\n                    \n                    int64_t binop_p_219781 = sub64(defunc_0_f_res_219775,\n                                                   defunc_0_g_res_219724);\n                    double defunc_0_f_res_219782 =\n                           sitofp_i64_f64(binop_p_219781);\n                    double abs_res_219783 = fabs(defunc_0_f_res_219782);\n                    double tmp1_219784 = abs_res_219783 / x_219721;\n                    double x_219785 = tmp1_219784 * tmp1_219784;\n                    double y_219786 = tmp1_219784 * x_219785;\n                    double tmp2_219787 = 1.0 - y_219786;\n                    double x_219788 = tmp2_219787 * tmp2_219787;\n                    double tmp3_219789 = tmp2_219787 * x_219788;\n                    double tmp4_219790 = defunc_0_f_res_219778 * tmp3_219789;\n                    double defunc_1_f_res_219791 = defunc_0_f_res_219782 *\n                           tmp4_219790;\n                    double defunc_0_f_res_219792;\n                    \n                    if (cond_219774) {\n                        defunc_0_f_res_219792 = 0.0;\n                    } else {\n                        int64_t i_219793 = add64(x_219720, i_228361);\n                        double defunc_0_add_arg_219794;\n                        \n                        defunc_0_add_arg_219794 = ((__global\n                                                    double *) mem_230625)[i_219793 *\n                                                                          partition_sizze_203577 +\n                                                                          gtid_219711];\n                        defunc_0_f_res_219792 = defunc_0_add_arg_219794;\n                    }\n                    \n                    double x_219795 = a11_219761 * tmp4_219790;\n                    double y_219796 = b11_219763 * defunc",
            "_1_f_res_219791;\n                    double x_219797 = x_219795 + y_219796;\n                    double defunc_9_fit_fun_res_219798 = defunc_0_f_res_219792 *\n                           x_219797;\n                    double x_219799 = b11_219763 * tmp4_219790;\n                    double y_219800 = c11_219764 * defunc_1_f_res_219791;\n                    double x_219801 = x_219799 + y_219800;\n                    double defunc_9_slope_fun_res_219802 =\n                           defunc_0_f_res_219792 * x_219801;\n                    double defunc_1_op_res_219769 =\n                           defunc_9_fit_fun_res_219798 + redout_228359;\n                    double defunc_1_op_res_219772 =\n                           defunc_9_slope_fun_res_219802 + redout_228360;\n                    double redout_tmp_234990 = defunc_1_op_res_219769;\n                    double redout_tmp_234991 = defunc_1_op_res_219772;\n                    \n                    redout_228359 = redout_tmp_234990;\n                    redout_228360 = redout_tmp_234991;\n                }\n                defunc_2_reduce_res_219765 = redout_228359;\n                defunc_2_reduce_res_219766 = redout_228360;\n                ((__global double *) color_232029)[phys_tid_219712 + i_228993 *\n                                                   num_threads_232163] =\n                    defunc_2_reduce_res_219765;\n                ((__global double *) color_232028)[phys_tid_219712 + i_228993 *\n                                                   num_threads_232163] =\n                    defunc_2_reduce_res_219766;\n            }\n            for (int64_t i_234992 = 0; i_234992 < l_n_m_203643; i_234992++) {\n                double tmp_234993;\n                \n                tmp_234993 = ((__global\n                               double *) color_232029)[phys_tid_219712 +\n                                                       i_234992 *\n                                                       num_threads_232163];\n                ((__global ",
            "double *) mem_230659)[gtid_219711 + i_234992 *\n                                                 partition_sizze_203577] =\n                    tmp_234993;\n            }\n            for (int64_t i_234994 = 0; i_234994 < l_n_m_203643; i_234994++) {\n                double tmp_234995;\n                \n                tmp_234995 = ((__global\n                               double *) color_232028)[phys_tid_219712 +\n                                                       i_234994 *\n                                                       num_threads_232163];\n                ((__global double *) mem_230662)[gtid_219711 + i_234994 *\n                                                 partition_sizze_203577] =\n                    tmp_234995;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_219706\n}\n__kernel void mainzisegmap_220233(__global int *global_failure,\n                                  int64_t n_203490, int64_t q_l_203495,\n                                  int64_t jump_t_203500,\n                                  int64_t partition_sizze_203577,\n                                  int64_t l_n_m_203643, int64_t i_203670,\n                                  int64_t ctx_param_ext_229488,\n                                  int64_t ctx_param_ext_229489,\n                                  int64_t ctx_param_ext_229491, __global\n                                  unsigned char *ext_mem_229411, __global\n                                  unsigned char *ext_mem_229412, __global\n                                  unsigned char *mem_param_229493, __global\n                                  unsigned char *mem_230551, __global\n                                  unsigned char *mem_230667, __global\n                                  unsigned char *mem_230671)\n{\n    #define segmap_group_sizze_220222 (mainzisegmap_group_sizze_219808)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const ",
            "int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234996;\n    int32_t local_tid_234997;\n    int64_t group_sizze_235000;\n    int32_t wave_sizze_234999;\n    int32_t group_tid_234998;\n    \n    global_tid_234996 = get_global_id(0);\n    local_tid_234997 = get_local_id(0);\n    group_sizze_235000 = get_local_size(0);\n    wave_sizze_234999 = LOCKSTEP_WIDTH;\n    group_tid_234998 = get_group_id(0);\n    \n    int32_t phys_tid_220233 = global_tid_234996;\n    int64_t global_tid_235001 = sext_i32_i64(group_tid_234998) *\n            segmap_group_sizze_220222 + sext_i32_i64(local_tid_234997);\n    int64_t slice_235002 = l_n_m_203643;\n    int64_t slice_235003 = partition_sizze_203577 * slice_235002;\n    int64_t gtid_220231 = squot64(global_tid_235001, slice_235002);\n    int64_t remnant_235004 = global_tid_235001 - gtid_220231 * slice_235002;\n    int64_t gtid_220232 = remnant_235004;\n    int64_t remnant_235005 = remnant_235004 - gtid_220232;\n    \n    if (slt64(gtid_220231, partition_sizze_203577) && slt64(gtid_220232,\n                                                            l_n_m_203643)) {\n        int64_t x_220237;\n        \n        x_220237 = ((__global int64_t *) ext_mem_229412)[gtid_220231 *\n                                                         l_n_m_203643 +\n                                                         gtid_220232];\n        \n        double x_220238;\n        \n        x_220238 = ((__global double *) ext_mem_229411)[gtid_220231 *\n                                                        l_n_m_203643 +\n                                                        gtid_220232];\n        \n        int64_t min_arg_220239 = mul64(jump_t_203500, gtid_220232);\n        int64_t min_res_220240 = smin64(i_203670, min_arg_220239);\n        int64_t defunc_0_g_res_220241 = add64((int64_t) 1, min_res_220240);\n        double defunc_2_reduce_res_220242;\n        double defunc_2_reduce_res_220243;\n        double defunc_2_reduce_res_220244;\n        ",
            "double redout_228366;\n        double redout_228367;\n        double redout_228368;\n        \n        redout_228366 = 0.0;\n        redout_228367 = 0.0;\n        redout_228368 = 0.0;\n        for (int64_t i_228369 = 0; i_228369 < q_l_203495; i_228369++) {\n            bool cond_220255 = sle64(n_203490, i_228369);\n            int64_t defunc_0_f_res_220256;\n            \n            if (cond_220255) {\n                defunc_0_f_res_220256 = (int64_t) 0;\n            } else {\n                int64_t i_220257 = add64(x_220237, i_228369);\n                int64_t defunc_1_add_res_220258 = add64((int64_t) 1, i_220257);\n                \n                defunc_0_f_res_220256 = defunc_1_add_res_220258;\n            }\n            \n            double defunc_0_f_res_220259;\n            \n            if (cond_220255) {\n                defunc_0_f_res_220259 = 0.0;\n            } else {\n                int64_t i_220260 = add64(x_220237, i_228369);\n                double defunc_0_add_arg_220261;\n                \n                defunc_0_add_arg_220261 = ((__global\n                                            double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                                        (gtid_220231 *\n                                                                         ctx_param_ext_229489 +\n                                                                         i_220260 *\n                                                                         ctx_param_ext_229491)];\n                defunc_0_f_res_220259 = defunc_0_add_arg_220261;\n            }\n            \n            int64_t binop_p_220262 = sub64(defunc_0_f_res_220256,\n                                           defunc_0_g_res_220241);\n            double defunc_0_f_res_220263 = sitofp_i64_f64(binop_p_220262);\n            double abs_res_220264 = fabs(defunc_0_f_res_220263);\n            double tmp1_220265 = abs_res_220264 / x_220238;\n            double x_220266 = tmp1_220265 * tmp1_220265;\n       ",
            "     double y_220267 = tmp1_220265 * x_220266;\n            double tmp2_220268 = 1.0 - y_220267;\n            double x_220269 = tmp2_220268 * tmp2_220268;\n            double tmp3_220270 = tmp2_220268 * x_220269;\n            double w_j_220271 = defunc_0_f_res_220259 * tmp3_220270;\n            double xw_j_220272 = defunc_0_f_res_220263 * w_j_220271;\n            double x2w_j_220273 = defunc_0_f_res_220263 * xw_j_220272;\n            double defunc_1_op_res_220247 = w_j_220271 + redout_228366;\n            double defunc_1_op_res_220250 = xw_j_220272 + redout_228367;\n            double defunc_1_op_res_220253 = x2w_j_220273 + redout_228368;\n            double redout_tmp_235006 = defunc_1_op_res_220247;\n            double redout_tmp_235007 = defunc_1_op_res_220250;\n            double redout_tmp_235008 = defunc_1_op_res_220253;\n            \n            redout_228366 = redout_tmp_235006;\n            redout_228367 = redout_tmp_235007;\n            redout_228368 = redout_tmp_235008;\n        }\n        defunc_2_reduce_res_220242 = redout_228366;\n        defunc_2_reduce_res_220243 = redout_228367;\n        defunc_2_reduce_res_220244 = redout_228368;\n        \n        double x_220274 = defunc_2_reduce_res_220242 *\n               defunc_2_reduce_res_220244;\n        double y_220275 = defunc_2_reduce_res_220243 *\n               defunc_2_reduce_res_220243;\n        double y_220276 = x_220274 - y_220275;\n        double det1_220277 = 1.0 / y_220276;\n        double a11_220278 = defunc_2_reduce_res_220244 * det1_220277;\n        double x_220279 = 0.0 - defunc_2_reduce_res_220243;\n        double b11_220280 = det1_220277 * x_220279;\n        double c11_220281 = defunc_2_reduce_res_220242 * det1_220277;\n        double defunc_2_reduce_res_220282;\n        double defunc_2_reduce_res_220283;\n        double redout_228370;\n        double redout_228371;\n        \n        redout_228370 = 0.0;\n        redout_228371 = 0.0;\n        for (int64_t i_228372 = 0; i_228372 < q_l_203495; i_228372++) {\n            bool co",
            "nd_220291 = sle64(n_203490, i_228372);\n            int64_t defunc_0_f_res_220292;\n            \n            if (cond_220291) {\n                defunc_0_f_res_220292 = (int64_t) 0;\n            } else {\n                int64_t i_220293 = add64(x_220237, i_228372);\n                int64_t defunc_1_add_res_220294 = add64((int64_t) 1, i_220293);\n                \n                defunc_0_f_res_220292 = defunc_1_add_res_220294;\n            }\n            \n            double defunc_0_f_res_220295;\n            \n            if (cond_220291) {\n                defunc_0_f_res_220295 = 0.0;\n            } else {\n                int64_t i_220296 = add64(x_220237, i_228372);\n                double defunc_0_add_arg_220297;\n                \n                defunc_0_add_arg_220297 = ((__global\n                                            double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                                        (gtid_220231 *\n                                                                         ctx_param_ext_229489 +\n                                                                         i_220296 *\n                                                                         ctx_param_ext_229491)];\n                defunc_0_f_res_220295 = defunc_0_add_arg_220297;\n            }\n            \n            int64_t binop_p_220298 = sub64(defunc_0_f_res_220292,\n                                           defunc_0_g_res_220241);\n            double defunc_0_f_res_220299 = sitofp_i64_f64(binop_p_220298);\n            double abs_res_220300 = fabs(defunc_0_f_res_220299);\n            double tmp1_220301 = abs_res_220300 / x_220238;\n            double x_220302 = tmp1_220301 * tmp1_220301;\n            double y_220303 = tmp1_220301 * x_220302;\n            double tmp2_220304 = 1.0 - y_220303;\n            double x_220305 = tmp2_220304 * tmp2_220304;\n            double tmp3_220306 = tmp2_220304 * x_220305;\n            double tmp4_220307 = defunc_0_f_res_220295 * tm",
            "p3_220306;\n            double defunc_1_f_res_220308 = defunc_0_f_res_220299 * tmp4_220307;\n            double defunc_0_f_res_220309;\n            \n            if (cond_220291) {\n                defunc_0_f_res_220309 = 0.0;\n            } else {\n                int64_t i_220310 = add64(x_220237, i_228372);\n                double defunc_0_add_arg_220311;\n                \n                defunc_0_add_arg_220311 = ((__global\n                                            double *) mem_230551)[gtid_220231 *\n                                                                  n_203490 +\n                                                                  i_220310];\n                defunc_0_f_res_220309 = defunc_0_add_arg_220311;\n            }\n            \n            double x_220312 = a11_220278 * tmp4_220307;\n            double y_220313 = b11_220280 * defunc_1_f_res_220308;\n            double x_220314 = x_220312 + y_220313;\n            double defunc_9_fit_fun_res_220315 = defunc_0_f_res_220309 *\n                   x_220314;\n            double x_220316 = b11_220280 * tmp4_220307;\n            double y_220317 = c11_220281 * defunc_1_f_res_220308;\n            double x_220318 = x_220316 + y_220317;\n            double defunc_9_slope_fun_res_220319 = defunc_0_f_res_220309 *\n                   x_220318;\n            double defunc_1_op_res_220286 = defunc_9_fit_fun_res_220315 +\n                   redout_228370;\n            double defunc_1_op_res_220289 = defunc_9_slope_fun_res_220319 +\n                   redout_228371;\n            double redout_tmp_235009 = defunc_1_op_res_220286;\n            double redout_tmp_235010 = defunc_1_op_res_220289;\n            \n            redout_228370 = redout_tmp_235009;\n            redout_228371 = redout_tmp_235010;\n        }\n        defunc_2_reduce_res_220282 = redout_228370;\n        defunc_2_reduce_res_220283 = redout_228371;\n        ((__global double *) mem_230667)[gtid_220231 * l_n_m_203643 +\n                                         gtid_220232] =\n        ",
            "    defunc_2_reduce_res_220282;\n        ((__global double *) mem_230671)[gtid_220231 * l_n_m_203643 +\n                                         gtid_220232] =\n            defunc_2_reduce_res_220283;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_220222\n}\n__kernel void mainzisegmap_220390(__global int *global_failure,\n                                  int64_t partition_sizze_203577,\n                                  int64_t l_n_m_203643, __global\n                                  unsigned char *mem_230676, __global\n                                  unsigned char *mem_230680, __global\n                                  unsigned char *mem_230684, __global\n                                  unsigned char *mem_230689, __global\n                                  unsigned char *mem_230693, __global\n                                  unsigned char *mem_230697)\n{\n    #define segmap_group_sizze_220383 (mainzisegmap_group_sizze_219990)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235111;\n    int32_t local_tid_235112;\n    int64_t group_sizze_235115;\n    int32_t wave_sizze_235114;\n    int32_t group_tid_235113;\n    \n    global_tid_235111 = get_global_id(0);\n    local_tid_235112 = get_local_id(0);\n    group_sizze_235115 = get_local_size(0);\n    wave_sizze_235114 = LOCKSTEP_WIDTH;\n    group_tid_235113 = get_group_id(0);\n    \n    int32_t phys_tid_220390 = global_tid_235111;\n    int64_t global_tid_235116 = sext_i32_i64(group_tid_235113) *\n            segmap_group_sizze_220383 + sext_i32_i64(local_tid_235112);\n    int64_t slice_235117 = l_n_m_203643;\n    int64_t slice_235118 = partition_sizze_203577 * slice_235117;\n    int64_t gtid_220388 = squot64(global_tid_235116, slice_235117);\n    int64_t remnant_235119 = global_tid_235116 - gtid_220388 * slice_235117;\n    int64_t gtid_220389 = remnant_235119;\n    int64_t remnant_235120 = remnant_235119 - gt",
            "id_220389;\n    \n    if (slt64(gtid_220388, partition_sizze_203577) && slt64(gtid_220389,\n                                                            l_n_m_203643)) {\n        double defunc_2_reduce_res_220391;\n        \n        defunc_2_reduce_res_220391 = ((__global\n                                       double *) mem_230676)[gtid_220388 *\n                                                             l_n_m_203643 +\n                                                             gtid_220389];\n        \n        double defunc_2_reduce_res_220392;\n        \n        defunc_2_reduce_res_220392 = ((__global\n                                       double *) mem_230680)[gtid_220388 *\n                                                             l_n_m_203643 +\n                                                             gtid_220389];\n        \n        double defunc_2_reduce_res_220393;\n        \n        defunc_2_reduce_res_220393 = ((__global\n                                       double *) mem_230684)[gtid_220388 *\n                                                             l_n_m_203643 +\n                                                             gtid_220389];\n        \n        double x_220394 = defunc_2_reduce_res_220391 *\n               defunc_2_reduce_res_220393;\n        double y_220395 = defunc_2_reduce_res_220392 *\n               defunc_2_reduce_res_220392;\n        double y_220396 = x_220394 - y_220395;\n        double det1_220397 = 1.0 / y_220396;\n        double a11_220398 = defunc_2_reduce_res_220393 * det1_220397;\n        double x_220399 = 0.0 - defunc_2_reduce_res_220392;\n        double b11_220400 = det1_220397 * x_220399;\n        double c11_220401 = defunc_2_reduce_res_220391 * det1_220397;\n        \n        ((__global double *) mem_230689)[gtid_220388 * l_n_m_203643 +\n                                         gtid_220389] = a11_220398;\n        ((__global double *) mem_230693)[gtid_220388 * l_n_m_203643 +\n                                         gtid_220389] = b11_220400;\n    ",
            "    ((__global double *) mem_230697)[gtid_220388 * l_n_m_203643 +\n                                         gtid_220389] = c11_220401;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_220383\n}\n__kernel void mainzisegmap_220609(__global int *global_failure,\n                                  int64_t n_203490, int64_t q_l_203495,\n                                  int64_t jump_t_203500,\n                                  int64_t partition_sizze_203577,\n                                  int64_t l_n_m_203643, int64_t i_203670,\n                                  int64_t num_groups_220604,\n                                  int64_t num_threads_232170, __global\n                                  unsigned char *mem_230723, __global\n                                  unsigned char *mem_230726, __global\n                                  unsigned char *mem_230729, __global\n                                  unsigned char *mem_230732, __global\n                                  unsigned char *mem_230766, __global\n                                  unsigned char *mem_230769, __global\n                                  unsigned char *color_232030, __global\n                                  unsigned char *color_232031)\n{\n    #define segmap_group_sizze_220603 (mainzisegmap_group_sizze_220473)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_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_220609 = global_tid_235224;\n    int32_t phys_group_id_235229;\n    \n    phys_group_id_235229 = get_group_id(0);\n    for (int32_t i_235230 = 0; i_235230 <\n    ",
            "     sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577,\n                                          segmap_group_sizze_220603)) -\n                   phys_group_id_235229, sext_i64_i32(num_groups_220604));\n         i_235230++) {\n        int32_t virt_group_id_235231 = phys_group_id_235229 + i_235230 *\n                sext_i64_i32(num_groups_220604);\n        int64_t global_tid_235232 = sext_i32_i64(virt_group_id_235231) *\n                segmap_group_sizze_220603 + sext_i32_i64(local_tid_235225);\n        int64_t slice_235233 = partition_sizze_203577;\n        int64_t gtid_220608 = global_tid_235232;\n        int64_t remnant_235234 = global_tid_235232 - gtid_220608;\n        \n        if (slt64(gtid_220608, partition_sizze_203577)) {\n            for (int64_t i_229000 = 0; i_229000 < l_n_m_203643; i_229000++) {\n                int64_t x_220617;\n                \n                x_220617 = ((__global int64_t *) mem_230723)[i_229000 *\n                                                             partition_sizze_203577 +\n                                                             gtid_220608];\n                \n                double x_220618;\n                \n                x_220618 = ((__global double *) mem_230726)[i_229000 *\n                                                            partition_sizze_203577 +\n                                                            gtid_220608];\n                \n                int64_t min_arg_220619 = mul64(jump_t_203500, i_229000);\n                int64_t min_res_220620 = smin64(i_203670, min_arg_220619);\n                int64_t defunc_0_g_res_220621 = add64((int64_t) 1,\n                                                      min_res_220620);\n                double defunc_2_reduce_res_220622;\n                double defunc_2_reduce_res_220623;\n                double defunc_2_reduce_res_220624;\n                double defunc_2_reduce_res_220625;\n                double defunc_2_reduce_res_220626;\n                double redout_228385;\n     ",
            "           double redout_228386;\n                double redout_228387;\n                double redout_228388;\n                double redout_228389;\n                \n                redout_228385 = 0.0;\n                redout_228386 = 0.0;\n                redout_228387 = 0.0;\n                redout_228388 = 0.0;\n                redout_228389 = 0.0;\n                for (int64_t i_228390 = 0; i_228390 < q_l_203495; i_228390++) {\n                    bool cond_220643 = sle64(n_203490, i_228390);\n                    int64_t defunc_0_f_res_220644;\n                    \n                    if (cond_220643) {\n                        defunc_0_f_res_220644 = (int64_t) 0;\n                    } else {\n                        int64_t i_220645 = add64(x_220617, i_228390);\n                        int64_t defunc_1_add_res_220646 = add64((int64_t) 1,\n                                                                i_220645);\n                        \n                        defunc_0_f_res_220644 = defunc_1_add_res_220646;\n                    }\n                    \n                    double defunc_0_f_res_220647;\n                    \n                    if (cond_220643) {\n                        defunc_0_f_res_220647 = 0.0;\n                    } else {\n                        int64_t i_220648 = add64(x_220617, i_228390);\n                        double defunc_0_add_arg_220649;\n                        \n                        defunc_0_add_arg_220649 = ((__global\n                                                    double *) mem_230729)[i_220648 *\n                                                                          partition_sizze_203577 +\n                                                                          gtid_220608];\n                        defunc_0_f_res_220647 = defunc_0_add_arg_220649;\n                    }\n                    \n                    int64_t binop_p_220650 = sub64(defunc_0_f_res_220644,\n                                                   defunc_0_g_res_220621);\n",
            "                    double defunc_0_f_res_220651 =\n                           sitofp_i64_f64(binop_p_220650);\n                    double abs_res_220652 = fabs(defunc_0_f_res_220651);\n                    double tmp1_220653 = abs_res_220652 / x_220618;\n                    double x_220654 = tmp1_220653 * tmp1_220653;\n                    double y_220655 = tmp1_220653 * x_220654;\n                    double tmp2_220656 = 1.0 - y_220655;\n                    double x_220657 = tmp2_220656 * tmp2_220656;\n                    double tmp3_220658 = tmp2_220656 * x_220657;\n                    double w_j_220659 = defunc_0_f_res_220647 * tmp3_220658;\n                    double xw_j_220660 = defunc_0_f_res_220651 * w_j_220659;\n                    double x2w_j_220661 = defunc_0_f_res_220651 * xw_j_220660;\n                    double x3w_j_220662 = defunc_0_f_res_220651 * x2w_j_220661;\n                    double x4w_j_220663 = defunc_0_f_res_220651 * x3w_j_220662;\n                    double defunc_1_op_res_220629 = w_j_220659 + redout_228385;\n                    double defunc_1_op_res_220632 = xw_j_220660 + redout_228386;\n                    double defunc_1_op_res_220635 = x2w_j_220661 +\n                           redout_228387;\n                    double defunc_1_op_res_220638 = x3w_j_220662 +\n                           redout_228388;\n                    double defunc_1_op_res_220641 = x4w_j_220663 +\n                           redout_228389;\n                    double redout_tmp_235237 = defunc_1_op_res_220629;\n                    double redout_tmp_235238 = defunc_1_op_res_220632;\n                    double redout_tmp_235239 = defunc_1_op_res_220635;\n                    double redout_tmp_235240 = defunc_1_op_res_220638;\n                    double redout_tmp_235241 = defunc_1_op_res_220641;\n                    \n                    redout_228385 = redout_tmp_235237;\n                    redout_228386 = redout_tmp_235238;\n                    redout_228387 = redout_tmp_235239;\n             ",
            "       redout_228388 = redout_tmp_235240;\n                    redout_228389 = redout_tmp_235241;\n                }\n                defunc_2_reduce_res_220622 = redout_228385;\n                defunc_2_reduce_res_220623 = redout_228386;\n                defunc_2_reduce_res_220624 = redout_228387;\n                defunc_2_reduce_res_220625 = redout_228388;\n                defunc_2_reduce_res_220626 = redout_228389;\n                \n                double x_220664 = defunc_2_reduce_res_220624 *\n                       defunc_2_reduce_res_220626;\n                double y_220665 = defunc_2_reduce_res_220625 *\n                       defunc_2_reduce_res_220625;\n                double a12_220666 = x_220664 - y_220665;\n                double x_220667 = defunc_2_reduce_res_220624 *\n                       defunc_2_reduce_res_220625;\n                double y_220668 = defunc_2_reduce_res_220623 *\n                       defunc_2_reduce_res_220626;\n                double b12_220669 = x_220667 - y_220668;\n                double x_220670 = defunc_2_reduce_res_220623 *\n                       defunc_2_reduce_res_220625;\n                double y_220671 = defunc_2_reduce_res_220624 *\n                       defunc_2_reduce_res_220624;\n                double c12_220672 = x_220670 - y_220671;\n                double x_220673 = defunc_2_reduce_res_220622 *\n                       defunc_2_reduce_res_220626;\n                double b2_220674 = x_220673 - y_220671;\n                double x_220675 = defunc_2_reduce_res_220623 *\n                       defunc_2_reduce_res_220624;\n                double y_220676 = defunc_2_reduce_res_220622 *\n                       defunc_2_reduce_res_220625;\n                double c2_220677 = x_220675 - y_220676;\n                double x_220678 = defunc_2_reduce_res_220622 * a12_220666;\n                double y_220679 = defunc_2_reduce_res_220623 * b12_220669;\n                double x_220680 = x_220678 + y_220679;\n                double y_220681 = defunc_2_reduce_res_",
            "220624 * c12_220672;\n                double y_220682 = x_220680 + y_220681;\n                double det_220683 = 1.0 / y_220682;\n                double a12_220684 = a12_220666 * det_220683;\n                double b12_220685 = b12_220669 * det_220683;\n                double c12_220686 = c12_220672 * det_220683;\n                double b2_220687 = b2_220674 * det_220683;\n                double c2_220688 = c2_220677 * det_220683;\n                double defunc_2_reduce_res_220689;\n                double defunc_2_reduce_res_220690;\n                double redout_228391;\n                double redout_228392;\n                \n                redout_228391 = 0.0;\n                redout_228392 = 0.0;\n                for (int64_t i_228393 = 0; i_228393 < q_l_203495; i_228393++) {\n                    bool cond_220698 = sle64(n_203490, i_228393);\n                    int64_t defunc_0_f_res_220699;\n                    \n                    if (cond_220698) {\n                        defunc_0_f_res_220699 = (int64_t) 0;\n                    } else {\n                        int64_t i_220700 = add64(x_220617, i_228393);\n                        int64_t defunc_1_add_res_220701 = add64((int64_t) 1,\n                                                                i_220700);\n                        \n                        defunc_0_f_res_220699 = defunc_1_add_res_220701;\n                    }\n                    \n                    double defunc_0_f_res_220702;\n                    \n                    if (cond_220698) {\n                        defunc_0_f_res_220702 = 0.0;\n                    } else {\n                        int64_t i_220703 = add64(x_220617, i_228393);\n                        double defunc_0_add_arg_220704;\n                        \n                        defunc_0_add_arg_220704 = ((__global\n                                                    double *) mem_230729)[i_220703 *\n                                                                          partition_sizze_203577 +\n    ",
            "                                                                      gtid_220608];\n                        defunc_0_f_res_220702 = defunc_0_add_arg_220704;\n                    }\n                    \n                    int64_t binop_p_220705 = sub64(defunc_0_f_res_220699,\n                                                   defunc_0_g_res_220621);\n                    double defunc_0_f_res_220706 =\n                           sitofp_i64_f64(binop_p_220705);\n                    double abs_res_220707 = fabs(defunc_0_f_res_220706);\n                    double tmp1_220708 = abs_res_220707 / x_220618;\n                    double x_220709 = tmp1_220708 * tmp1_220708;\n                    double y_220710 = tmp1_220708 * x_220709;\n                    double tmp2_220711 = 1.0 - y_220710;\n                    double x_220712 = tmp2_220711 * tmp2_220711;\n                    double tmp3_220713 = tmp2_220711 * x_220712;\n                    double tmp4_220714 = defunc_0_f_res_220702 * tmp3_220713;\n                    double defunc_1_f_res_220715 = defunc_0_f_res_220706 *\n                           tmp4_220714;\n                    double defunc_1_f_res_220716 = defunc_0_f_res_220706 *\n                           defunc_1_f_res_220715;\n                    double defunc_0_f_res_220717;\n                    \n                    if (cond_220698) {\n                        defunc_0_f_res_220717 = 0.0;\n                    } else {\n                        int64_t i_220718 = add64(x_220617, i_228393);\n                        double defunc_0_add_arg_220719;\n                        \n                        defunc_0_add_arg_220719 = ((__global\n                                                    double *) mem_230732)[i_220718 *\n                                                                          partition_sizze_203577 +\n                                                                          gtid_220608];\n                        defunc_0_f_res_220717 = defunc_0_add_arg_220719;\n                   ",
            " }\n                    \n                    double x_220720 = a12_220684 * tmp4_220714;\n                    double y_220721 = b12_220685 * defunc_1_f_res_220715;\n                    double x_220722 = x_220720 + y_220721;\n                    double y_220723 = c12_220686 * defunc_1_f_res_220716;\n                    double x_220724 = x_220722 + y_220723;\n                    double defunc_9_fit_fun_res_220725 = defunc_0_f_res_220717 *\n                           x_220724;\n                    double x_220726 = b12_220685 * tmp4_220714;\n                    double y_220727 = b2_220687 * defunc_1_f_res_220715;\n                    double x_220728 = x_220726 + y_220727;\n                    double y_220729 = c2_220688 * defunc_1_f_res_220716;\n                    double x_220730 = x_220728 + y_220729;\n                    double defunc_9_slope_fun_res_220731 =\n                           defunc_0_f_res_220717 * x_220730;\n                    double defunc_1_op_res_220693 =\n                           defunc_9_fit_fun_res_220725 + redout_228391;\n                    double defunc_1_op_res_220696 =\n                           defunc_9_slope_fun_res_220731 + redout_228392;\n                    double redout_tmp_235242 = defunc_1_op_res_220693;\n                    double redout_tmp_235243 = defunc_1_op_res_220696;\n                    \n                    redout_228391 = redout_tmp_235242;\n                    redout_228392 = redout_tmp_235243;\n                }\n                defunc_2_reduce_res_220689 = redout_228391;\n                defunc_2_reduce_res_220690 = redout_228392;\n                ((__global double *) color_232031)[phys_tid_220609 + i_229000 *\n                                                   num_threads_232170] =\n                    defunc_2_reduce_res_220689;\n                ((__global double *) color_232030)[phys_tid_220609 + i_229000 *\n                                                   num_threads_232170] =\n                    defunc_2_reduce_res_220690;\n            }\n   ",
            "         for (int64_t i_235244 = 0; i_235244 < l_n_m_203643; i_235244++) {\n                double tmp_235245;\n                \n                tmp_235245 = ((__global\n                               double *) color_232031)[phys_tid_220609 +\n                                                       i_235244 *\n                                                       num_threads_232170];\n                ((__global double *) mem_230766)[gtid_220608 + i_235244 *\n                                                 partition_sizze_203577] =\n                    tmp_235245;\n            }\n            for (int64_t i_235246 = 0; i_235246 < l_n_m_203643; i_235246++) {\n                double tmp_235247;\n                \n                tmp_235247 = ((__global\n                               double *) color_232030)[phys_tid_220609 +\n                                                       i_235246 *\n                                                       num_threads_232170];\n                ((__global double *) mem_230769)[gtid_220608 + i_235246 *\n                                                 partition_sizze_203577] =\n                    tmp_235247;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_220603\n}\n__kernel void mainzisegmap_221278(__global int *global_failure,\n                                  int64_t n_203490, int64_t q_l_203495,\n                                  int64_t jump_t_203500,\n                                  int64_t partition_sizze_203577,\n                                  int64_t l_n_m_203643, int64_t i_203670,\n                                  int64_t ctx_param_ext_229488,\n                                  int64_t ctx_param_ext_229489,\n                                  int64_t ctx_param_ext_229491, __global\n                                  unsigned char *ext_mem_229411, __global\n                                  unsigned char *ext_mem_229412, __global\n                 ",
            "                 unsigned char *mem_param_229493, __global\n                                  unsigned char *mem_230551, __global\n                                  unsigned char *mem_230774, __global\n                                  unsigned char *mem_230778)\n{\n    #define segmap_group_sizze_221267 (mainzisegmap_group_sizze_220737)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235248;\n    int32_t local_tid_235249;\n    int64_t group_sizze_235252;\n    int32_t wave_sizze_235251;\n    int32_t group_tid_235250;\n    \n    global_tid_235248 = get_global_id(0);\n    local_tid_235249 = get_local_id(0);\n    group_sizze_235252 = get_local_size(0);\n    wave_sizze_235251 = LOCKSTEP_WIDTH;\n    group_tid_235250 = get_group_id(0);\n    \n    int32_t phys_tid_221278 = global_tid_235248;\n    int64_t global_tid_235253 = sext_i32_i64(group_tid_235250) *\n            segmap_group_sizze_221267 + sext_i32_i64(local_tid_235249);\n    int64_t slice_235254 = l_n_m_203643;\n    int64_t slice_235255 = partition_sizze_203577 * slice_235254;\n    int64_t gtid_221276 = squot64(global_tid_235253, slice_235254);\n    int64_t remnant_235256 = global_tid_235253 - gtid_221276 * slice_235254;\n    int64_t gtid_221277 = remnant_235256;\n    int64_t remnant_235257 = remnant_235256 - gtid_221277;\n    \n    if (slt64(gtid_221276, partition_sizze_203577) && slt64(gtid_221277,\n                                                            l_n_m_203643)) {\n        int64_t x_221282;\n        \n        x_221282 = ((__global int64_t *) ext_mem_229412)[gtid_221276 *\n                                                         l_n_m_203643 +\n                                                         gtid_221277];\n        \n        double x_221283;\n        \n        x_221283 = ((__global double *) ext_mem_229411)[gtid_221276 *\n                                                        l_n_m_203643 +\n                  ",
            "                                      gtid_221277];\n        \n        int64_t min_arg_221284 = mul64(jump_t_203500, gtid_221277);\n        int64_t min_res_221285 = smin64(i_203670, min_arg_221284);\n        int64_t defunc_0_g_res_221286 = add64((int64_t) 1, min_res_221285);\n        double defunc_2_reduce_res_221287;\n        double defunc_2_reduce_res_221288;\n        double defunc_2_reduce_res_221289;\n        double defunc_2_reduce_res_221290;\n        double defunc_2_reduce_res_221291;\n        double redout_228398;\n        double redout_228399;\n        double redout_228400;\n        double redout_228401;\n        double redout_228402;\n        \n        redout_228398 = 0.0;\n        redout_228399 = 0.0;\n        redout_228400 = 0.0;\n        redout_228401 = 0.0;\n        redout_228402 = 0.0;\n        for (int64_t i_228403 = 0; i_228403 < q_l_203495; i_228403++) {\n            bool cond_221308 = sle64(n_203490, i_228403);\n            int64_t defunc_0_f_res_221309;\n            \n            if (cond_221308) {\n                defunc_0_f_res_221309 = (int64_t) 0;\n            } else {\n                int64_t i_221310 = add64(x_221282, i_228403);\n                int64_t defunc_1_add_res_221311 = add64((int64_t) 1, i_221310);\n                \n                defunc_0_f_res_221309 = defunc_1_add_res_221311;\n            }\n            \n            double defunc_0_f_res_221312;\n            \n            if (cond_221308) {\n                defunc_0_f_res_221312 = 0.0;\n            } else {\n                int64_t i_221313 = add64(x_221282, i_228403);\n                double defunc_0_add_arg_221314;\n                \n                defunc_0_add_arg_221314 = ((__global\n                                            double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                                        (gtid_221276 *\n                                                                         ctx_param_ext_229489 +\n                                                         ",
            "                i_221313 *\n                                                                         ctx_param_ext_229491)];\n                defunc_0_f_res_221312 = defunc_0_add_arg_221314;\n            }\n            \n            int64_t binop_p_221315 = sub64(defunc_0_f_res_221309,\n                                           defunc_0_g_res_221286);\n            double defunc_0_f_res_221316 = sitofp_i64_f64(binop_p_221315);\n            double abs_res_221317 = fabs(defunc_0_f_res_221316);\n            double tmp1_221318 = abs_res_221317 / x_221283;\n            double x_221319 = tmp1_221318 * tmp1_221318;\n            double y_221320 = tmp1_221318 * x_221319;\n            double tmp2_221321 = 1.0 - y_221320;\n            double x_221322 = tmp2_221321 * tmp2_221321;\n            double tmp3_221323 = tmp2_221321 * x_221322;\n            double w_j_221324 = defunc_0_f_res_221312 * tmp3_221323;\n            double xw_j_221325 = defunc_0_f_res_221316 * w_j_221324;\n            double x2w_j_221326 = defunc_0_f_res_221316 * xw_j_221325;\n            double x3w_j_221327 = defunc_0_f_res_221316 * x2w_j_221326;\n            double x4w_j_221328 = defunc_0_f_res_221316 * x3w_j_221327;\n            double defunc_1_op_res_221294 = w_j_221324 + redout_228398;\n            double defunc_1_op_res_221297 = xw_j_221325 + redout_228399;\n            double defunc_1_op_res_221300 = x2w_j_221326 + redout_228400;\n            double defunc_1_op_res_221303 = x3w_j_221327 + redout_228401;\n            double defunc_1_op_res_221306 = x4w_j_221328 + redout_228402;\n            double redout_tmp_235258 = defunc_1_op_res_221294;\n            double redout_tmp_235259 = defunc_1_op_res_221297;\n            double redout_tmp_235260 = defunc_1_op_res_221300;\n            double redout_tmp_235261 = defunc_1_op_res_221303;\n            double redout_tmp_235262 = defunc_1_op_res_221306;\n            \n            redout_228398 = redout_tmp_235258;\n            redout_228399 = redout_tmp_235259;\n            redout_228400 = redout_",
            "tmp_235260;\n            redout_228401 = redout_tmp_235261;\n            redout_228402 = redout_tmp_235262;\n        }\n        defunc_2_reduce_res_221287 = redout_228398;\n        defunc_2_reduce_res_221288 = redout_228399;\n        defunc_2_reduce_res_221289 = redout_228400;\n        defunc_2_reduce_res_221290 = redout_228401;\n        defunc_2_reduce_res_221291 = redout_228402;\n        \n        double x_221329 = defunc_2_reduce_res_221289 *\n               defunc_2_reduce_res_221291;\n        double y_221330 = defunc_2_reduce_res_221290 *\n               defunc_2_reduce_res_221290;\n        double a12_221331 = x_221329 - y_221330;\n        double x_221332 = defunc_2_reduce_res_221289 *\n               defunc_2_reduce_res_221290;\n        double y_221333 = defunc_2_reduce_res_221288 *\n               defunc_2_reduce_res_221291;\n        double b12_221334 = x_221332 - y_221333;\n        double x_221335 = defunc_2_reduce_res_221288 *\n               defunc_2_reduce_res_221290;\n        double y_221336 = defunc_2_reduce_res_221289 *\n               defunc_2_reduce_res_221289;\n        double c12_221337 = x_221335 - y_221336;\n        double x_221338 = defunc_2_reduce_res_221287 *\n               defunc_2_reduce_res_221291;\n        double b2_221339 = x_221338 - y_221336;\n        double x_221340 = defunc_2_reduce_res_221288 *\n               defunc_2_reduce_res_221289;\n        double y_221341 = defunc_2_reduce_res_221287 *\n               defunc_2_reduce_res_221290;\n        double c2_221342 = x_221340 - y_221341;\n        double x_221343 = defunc_2_reduce_res_221287 * a12_221331;\n        double y_221344 = defunc_2_reduce_res_221288 * b12_221334;\n        double x_221345 = x_221343 + y_221344;\n        double y_221346 = defunc_2_reduce_res_221289 * c12_221337;\n        double y_221347 = x_221345 + y_221346;\n        double det_221348 = 1.0 / y_221347;\n        double a12_221349 = a12_221331 * det_221348;\n        double b12_221350 = b12_221334 * det_221348;\n        double c12_221351 = c12_221337 * det_",
            "221348;\n        double b2_221352 = b2_221339 * det_221348;\n        double c2_221353 = c2_221342 * det_221348;\n        double defunc_2_reduce_res_221354;\n        double defunc_2_reduce_res_221355;\n        double redout_228404;\n        double redout_228405;\n        \n        redout_228404 = 0.0;\n        redout_228405 = 0.0;\n        for (int64_t i_228406 = 0; i_228406 < q_l_203495; i_228406++) {\n            bool cond_221363 = sle64(n_203490, i_228406);\n            int64_t defunc_0_f_res_221364;\n            \n            if (cond_221363) {\n                defunc_0_f_res_221364 = (int64_t) 0;\n            } else {\n                int64_t i_221365 = add64(x_221282, i_228406);\n                int64_t defunc_1_add_res_221366 = add64((int64_t) 1, i_221365);\n                \n                defunc_0_f_res_221364 = defunc_1_add_res_221366;\n            }\n            \n            double defunc_0_f_res_221367;\n            \n            if (cond_221363) {\n                defunc_0_f_res_221367 = 0.0;\n            } else {\n                int64_t i_221368 = add64(x_221282, i_228406);\n                double defunc_0_add_arg_221369;\n                \n                defunc_0_add_arg_221369 = ((__global\n                                            double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                                        (gtid_221276 *\n                                                                         ctx_param_ext_229489 +\n                                                                         i_221368 *\n                                                                         ctx_param_ext_229491)];\n                defunc_0_f_res_221367 = defunc_0_add_arg_221369;\n            }\n            \n            int64_t binop_p_221370 = sub64(defunc_0_f_res_221364,\n                                           defunc_0_g_res_221286);\n            double defunc_0_f_res_221371 = sitofp_i64_f64(binop_p_221370);\n            double abs_res_221372 = fabs(def",
            "unc_0_f_res_221371);\n            double tmp1_221373 = abs_res_221372 / x_221283;\n            double x_221374 = tmp1_221373 * tmp1_221373;\n            double y_221375 = tmp1_221373 * x_221374;\n            double tmp2_221376 = 1.0 - y_221375;\n            double x_221377 = tmp2_221376 * tmp2_221376;\n            double tmp3_221378 = tmp2_221376 * x_221377;\n            double tmp4_221379 = defunc_0_f_res_221367 * tmp3_221378;\n            double defunc_1_f_res_221380 = defunc_0_f_res_221371 * tmp4_221379;\n            double defunc_1_f_res_221381 = defunc_0_f_res_221371 *\n                   defunc_1_f_res_221380;\n            double defunc_0_f_res_221382;\n            \n            if (cond_221363) {\n                defunc_0_f_res_221382 = 0.0;\n            } else {\n                int64_t i_221383 = add64(x_221282, i_228406);\n                double defunc_0_add_arg_221384;\n                \n                defunc_0_add_arg_221384 = ((__global\n                                            double *) mem_230551)[gtid_221276 *\n                                                                  n_203490 +\n                                                                  i_221383];\n                defunc_0_f_res_221382 = defunc_0_add_arg_221384;\n            }\n            \n            double x_221385 = a12_221349 * tmp4_221379;\n            double y_221386 = b12_221350 * defunc_1_f_res_221380;\n            double x_221387 = x_221385 + y_221386;\n            double y_221388 = c12_221351 * defunc_1_f_res_221381;\n            double x_221389 = x_221387 + y_221388;\n            double defunc_9_fit_fun_res_221390 = defunc_0_f_res_221382 *\n                   x_221389;\n            double x_221391 = b12_221350 * tmp4_221379;\n            double y_221392 = b2_221352 * defunc_1_f_res_221380;\n            double x_221393 = x_221391 + y_221392;\n            double y_221394 = c2_221353 * defunc_1_f_res_221381;\n            double x_221395 = x_221393 + y_221394;\n            double defunc_9_slope_fun_res_221396",
            " = defunc_0_f_res_221382 *\n                   x_221395;\n            double defunc_1_op_res_221358 = defunc_9_fit_fun_res_221390 +\n                   redout_228404;\n            double defunc_1_op_res_221361 = defunc_9_slope_fun_res_221396 +\n                   redout_228405;\n            double redout_tmp_235263 = defunc_1_op_res_221358;\n            double redout_tmp_235264 = defunc_1_op_res_221361;\n            \n            redout_228404 = redout_tmp_235263;\n            redout_228405 = redout_tmp_235264;\n        }\n        defunc_2_reduce_res_221354 = redout_228404;\n        defunc_2_reduce_res_221355 = redout_228405;\n        ((__global double *) mem_230774)[gtid_221276 * l_n_m_203643 +\n                                         gtid_221277] =\n            defunc_2_reduce_res_221354;\n        ((__global double *) mem_230778)[gtid_221276 * l_n_m_203643 +\n                                         gtid_221277] =\n            defunc_2_reduce_res_221355;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_221267\n}\n__kernel void mainzisegmap_221479(__global int *global_failure,\n                                  int64_t partition_sizze_203577,\n                                  int64_t l_n_m_203643, __global\n                                  unsigned char *mem_230783, __global\n                                  unsigned char *mem_230787, __global\n                                  unsigned char *mem_230791, __global\n                                  unsigned char *mem_230795, __global\n                                  unsigned char *mem_230799, __global\n                                  unsigned char *mem_230804, __global\n                                  unsigned char *mem_230808, __global\n                                  unsigned char *mem_230812, __global\n                                  unsigned char *mem_230816, __global\n                                  unsigned char *mem_230820)\n{\n    #define segmap_group_sizze_221470 (mainzisegmap_group_sizze_220968)\n    \n    const",
            " int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235393;\n    int32_t local_tid_235394;\n    int64_t group_sizze_235397;\n    int32_t wave_sizze_235396;\n    int32_t group_tid_235395;\n    \n    global_tid_235393 = get_global_id(0);\n    local_tid_235394 = get_local_id(0);\n    group_sizze_235397 = get_local_size(0);\n    wave_sizze_235396 = LOCKSTEP_WIDTH;\n    group_tid_235395 = get_group_id(0);\n    \n    int32_t phys_tid_221479 = global_tid_235393;\n    int64_t global_tid_235398 = sext_i32_i64(group_tid_235395) *\n            segmap_group_sizze_221470 + sext_i32_i64(local_tid_235394);\n    int64_t slice_235399 = l_n_m_203643;\n    int64_t slice_235400 = partition_sizze_203577 * slice_235399;\n    int64_t gtid_221477 = squot64(global_tid_235398, slice_235399);\n    int64_t remnant_235401 = global_tid_235398 - gtid_221477 * slice_235399;\n    int64_t gtid_221478 = remnant_235401;\n    int64_t remnant_235402 = remnant_235401 - gtid_221478;\n    \n    if (slt64(gtid_221477, partition_sizze_203577) && slt64(gtid_221478,\n                                                            l_n_m_203643)) {\n        double defunc_2_reduce_res_221480;\n        \n        defunc_2_reduce_res_221480 = ((__global\n                                       double *) mem_230783)[gtid_221477 *\n                                                             l_n_m_203643 +\n                                                             gtid_221478];\n        \n        double defunc_2_reduce_res_221481;\n        \n        defunc_2_reduce_res_221481 = ((__global\n                                       double *) mem_230787)[gtid_221477 *\n                                                             l_n_m_203643 +\n                                                             gtid_221478];\n        \n        double defunc_2_reduce_res_221482;\n        \n        defunc_2_reduce_res_221482 = ((__global\n                             ",
            "          double *) mem_230791)[gtid_221477 *\n                                                             l_n_m_203643 +\n                                                             gtid_221478];\n        \n        double defunc_2_reduce_res_221483;\n        \n        defunc_2_reduce_res_221483 = ((__global\n                                       double *) mem_230795)[gtid_221477 *\n                                                             l_n_m_203643 +\n                                                             gtid_221478];\n        \n        double defunc_2_reduce_res_221484;\n        \n        defunc_2_reduce_res_221484 = ((__global\n                                       double *) mem_230799)[gtid_221477 *\n                                                             l_n_m_203643 +\n                                                             gtid_221478];\n        \n        double x_221485 = defunc_2_reduce_res_221482 *\n               defunc_2_reduce_res_221484;\n        double y_221486 = defunc_2_reduce_res_221483 *\n               defunc_2_reduce_res_221483;\n        double a12_221487 = x_221485 - y_221486;\n        double x_221488 = defunc_2_reduce_res_221482 *\n               defunc_2_reduce_res_221483;\n        double y_221489 = defunc_2_reduce_res_221481 *\n               defunc_2_reduce_res_221484;\n        double b12_221490 = x_221488 - y_221489;\n        double x_221491 = defunc_2_reduce_res_221481 *\n               defunc_2_reduce_res_221483;\n        double y_221492 = defunc_2_reduce_res_221482 *\n               defunc_2_reduce_res_221482;\n        double c12_221493 = x_221491 - y_221492;\n        double x_221494 = defunc_2_reduce_res_221480 *\n               defunc_2_reduce_res_221484;\n        double b2_221495 = x_221494 - y_221492;\n        double x_221496 = defunc_2_reduce_res_221481 *\n               defunc_2_reduce_res_221482;\n        double y_221497 = defunc_2_reduce_res_221480 *\n               defunc_2_reduce_res_221483;\n        double c2_221498 = x_221496 - y_221497;",
            "\n        double x_221499 = defunc_2_reduce_res_221480 * a12_221487;\n        double y_221500 = defunc_2_reduce_res_221481 * b12_221490;\n        double x_221501 = x_221499 + y_221500;\n        double y_221502 = defunc_2_reduce_res_221482 * c12_221493;\n        double y_221503 = x_221501 + y_221502;\n        double det_221504 = 1.0 / y_221503;\n        double a12_221505 = a12_221487 * det_221504;\n        double b12_221506 = b12_221490 * det_221504;\n        double c12_221507 = c12_221493 * det_221504;\n        double b2_221508 = b2_221495 * det_221504;\n        double c2_221509 = c2_221498 * det_221504;\n        \n        ((__global double *) mem_230804)[gtid_221477 * l_n_m_203643 +\n                                         gtid_221478] = a12_221505;\n        ((__global double *) mem_230808)[gtid_221477 * l_n_m_203643 +\n                                         gtid_221478] = b12_221506;\n        ((__global double *) mem_230812)[gtid_221477 * l_n_m_203643 +\n                                         gtid_221478] = c12_221507;\n        ((__global double *) mem_230816)[gtid_221477 * l_n_m_203643 +\n                                         gtid_221478] = b2_221508;\n        ((__global double *) mem_230820)[gtid_221477 * l_n_m_203643 +\n                                         gtid_221478] = c2_221509;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_221470\n}\n__kernel void mainzisegmap_222349(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203490, int64_t jump_l_203501,\n                                  int64_t partition_sizze_203577,\n                                  int64_t l_n_m_203643, int64_t i_203670,\n                                  int64_t y_205786, __global\n                                  unsigned char *ext_mem_230907, __global\n                                  unsigned char *ext_mem_230908, __global\n        ",
            "                          unsigned char *mem_230913)\n{\n    #define segmap_group_sizze_222344 (mainzisegmap_group_sizze_222226)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235567;\n    int32_t local_tid_235568;\n    int64_t group_sizze_235571;\n    int32_t wave_sizze_235570;\n    int32_t group_tid_235569;\n    \n    global_tid_235567 = get_global_id(0);\n    local_tid_235568 = get_local_id(0);\n    group_sizze_235571 = get_local_size(0);\n    wave_sizze_235570 = LOCKSTEP_WIDTH;\n    group_tid_235569 = get_group_id(0);\n    \n    int32_t phys_tid_222349 = global_tid_235567;\n    int64_t global_tid_235572 = sext_i32_i64(group_tid_235569) *\n            segmap_group_sizze_222344 + sext_i32_i64(local_tid_235568);\n    int64_t slice_235573 = n_203490;\n    int64_t slice_235574 = partition_sizze_203577 * slice_235573;\n    int64_t gtid_222347 = squot64(global_tid_235572, slice_235573);\n    int64_t remnant_235575 = global_tid_235572 - gtid_222347 * slice_235573;\n    int64_t gtid_222348 = remnant_235575;\n    int64_t remnant_235576 = remnant_235575 - gtid_222348;\n    \n    if (slt64(gtid_222347, partition_sizze_203577) && slt64(gtid_222348,\n                                                            n_203490)) {\n        int64_t m_v_222353 = sdiv64(gtid_222348, jump_l_203501);\n        bool cond_222354 = m_v_222353 == y_205786;\n        int64_t j_222355;\n        \n        if (cond_222354) {\n            int64_t j_t_res_222356 = sub64(m_v_222353, (int64_t) 1);\n            \n            j_222355 = j_t_res_222356;\n        } else {\n            j_222355 = m_v_222353;\n        }\n        \n        int64_t min_arg_222357 = mul64(jump_l_203501, j_222355);\n        int64_t min_res_222358 = smin64(i_203670, min_arg_222357);\n        int64_t defunc_0_m_fun_arg_222359 = add64((int64_t) 1, j_222355);\n        int64_t min_arg_222360 = mul64(jump_l_203501,\n                                    ",
            "   defunc_0_m_fun_arg_222359);\n        int64_t min_res_222361 = smin64(i_203670, min_arg_222360);\n        int64_t i64_arg_222362 = sub64(min_res_222361, min_res_222358);\n        double i64_res_222363 = sitofp_i64_f64(i64_arg_222362);\n        int64_t i64_arg_222364 = sub64(gtid_222348, min_res_222358);\n        double i64_res_222365 = sitofp_i64_f64(i64_arg_222364);\n        double u_222366 = i64_res_222365 / i64_res_222363;\n        double u2_222367 = u_222366 * u_222366;\n        double u3_222368 = u_222366 * u2_222367;\n        double x_222369 = 2.0 * u3_222368;\n        double y_222370 = 3.0 * u2_222367;\n        double x_222371 = x_222369 - y_222370;\n        double x_222372 = 1.0 + x_222371;\n        bool x_222373 = sle64((int64_t) 0, j_222355);\n        bool y_222374 = slt64(j_222355, l_n_m_203643);\n        bool bounds_check_222375 = x_222373 && y_222374;\n        bool index_certs_222376;\n        \n        if (!bounds_check_222375) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 50) == -1) {\n                    global_failure_args[0] = (int64_t) j_222355;\n                    global_failure_args[1] = (int64_t) l_n_m_203643;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        double y_222377;\n        \n        y_222377 = ((__global double *) ext_mem_230908)[gtid_222347 *\n                                                        l_n_m_203643 +\n                                                        j_222355];\n        \n        double x_222378 = x_222372 * y_222377;\n        double x_222379 = y_222370 - x_222369;\n        bool x_222380 = sle64((int64_t) 0, defunc_0_m_fun_arg_222359);\n        bool y_222381 = slt64(defunc_0_m_fun_arg_222359, l_n_m_203643);\n        bool bounds_check_222382 = x_222380 && y_222381;\n        bool index_certs_222383;\n        \n        if (!bounds_check_222382) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 51) == -1) {\n                  ",
            "  global_failure_args[0] =\n                        (int64_t) defunc_0_m_fun_arg_222359;\n                    global_failure_args[1] = (int64_t) l_n_m_203643;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        double y_222384;\n        \n        y_222384 = ((__global double *) ext_mem_230908)[gtid_222347 *\n                                                        l_n_m_203643 +\n                                                        defunc_0_m_fun_arg_222359];\n        \n        double y_222385 = x_222379 * y_222384;\n        double x_222386 = x_222378 + y_222385;\n        double y_222387 = 2.0 * u2_222367;\n        double x_222388 = u3_222368 - y_222387;\n        double x_222389 = u_222366 + x_222388;\n        double y_222390;\n        \n        y_222390 = ((__global double *) ext_mem_230907)[gtid_222347 *\n                                                        l_n_m_203643 +\n                                                        j_222355];\n        \n        double x_222391 = x_222389 * y_222390;\n        double y_222392 = i64_res_222363 * x_222391;\n        double x_222393 = x_222386 + y_222392;\n        double x_222394 = u3_222368 - u2_222367;\n        double y_222395;\n        \n        y_222395 = ((__global double *) ext_mem_230907)[gtid_222347 *\n                                                        l_n_m_203643 +\n                                                        defunc_0_m_fun_arg_222359];\n        \n        double x_222396 = x_222394 * y_222395;\n        double y_222397 = i64_res_222363 * x_222396;\n        double defunc_4_interpolate_proc_res_222398 = x_222393 + y_222397;\n        \n        ((__global double *) mem_230913)[gtid_222347 * n_203490 + gtid_222348] =\n            defunc_4_interpolate_proc_res_222398;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_222344\n}\n__kernel void mainzisegmap_222444(__global int *global_failure,\n                                  int64_t n_203490, int64_t n_p_203492,\n       ",
            "                           int64_t partition_sizze_203577,\n                                  int64_t C_len_203634, int64_t ext_230915,\n                                  __global unsigned char *mem_230500, __global\n                                  unsigned char *ext_mem_230914, __global\n                                  unsigned char *mem_230920)\n{\n    #define segmap_group_sizze_222439 (mainzisegmap_group_sizze_222413)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235577;\n    int32_t local_tid_235578;\n    int64_t group_sizze_235581;\n    int32_t wave_sizze_235580;\n    int32_t group_tid_235579;\n    \n    global_tid_235577 = get_global_id(0);\n    local_tid_235578 = get_local_id(0);\n    group_sizze_235581 = get_local_size(0);\n    wave_sizze_235580 = LOCKSTEP_WIDTH;\n    group_tid_235579 = get_group_id(0);\n    \n    int32_t phys_tid_222444 = global_tid_235577;\n    int64_t global_tid_235582 = sext_i32_i64(group_tid_235579) *\n            segmap_group_sizze_222439 + sext_i32_i64(local_tid_235578);\n    int64_t slice_235583 = n_203490;\n    int64_t slice_235584 = partition_sizze_203577 * slice_235583;\n    int64_t gtid_222442 = squot64(global_tid_235582, slice_235583);\n    int64_t remnant_235585 = global_tid_235582 - gtid_222442 * slice_235583;\n    int64_t gtid_222443 = remnant_235585;\n    int64_t remnant_235586 = remnant_235585 - gtid_222443;\n    \n    if (slt64(gtid_222442, partition_sizze_203577) && slt64(gtid_222443,\n                                                            n_203490)) {\n        int64_t slice_228328 = n_p_203492 + gtid_222443;\n        double x_222445;\n        \n        x_222445 = ((__global double *) mem_230500)[gtid_222442 * C_len_203634 +\n                                                    slice_228328];\n        \n        double x_222446;\n        \n        x_222446 = ((__global double *) ext_mem_230914)[gtid_222442 *\n                  ",
            "                                      ext_230915 +\n                                                        gtid_222443];\n        \n        double defunc_1_f_res_222447 = x_222445 - x_222446;\n        \n        ((__global double *) mem_230920)[gtid_222442 * n_203490 + gtid_222443] =\n            defunc_1_f_res_222447;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_222439\n}\n__kernel void mainzisegmap_222551(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203490, int64_t q_t_203494,\n                                  int64_t jump_t_203500,\n                                  int64_t partition_sizze_203577,\n                                  int64_t t_n_m_203650, int64_t i_203670,\n                                  int64_t num_groups_222547,\n                                  int64_t num_threads_232182, __global\n                                  unsigned char *mem_229161, __global\n                                  unsigned char *ext_mem_229196, __global\n                                  unsigned char *mem_230927, __global\n                                  unsigned char *mem_230930, __global\n                                  unsigned char *mem_230933, __global\n                                  unsigned char *mem_230936, __global\n                                  unsigned char *mem_230939, __global\n                                  unsigned char *mem_231003, __global\n                                  unsigned char *color_232040, __global\n                                  unsigned char *color_232041, __global\n                                  unsigned char *color_232042)\n{\n    #define segmap_group_sizze_222546 (mainzisegmap_group_sizze_222454)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile __local bool local_failure;\n    \n    if (failure_is_an_option",
            ") {\n        int failed = *global_failure >= 0;\n        \n        if (failed)\n            return;\n    }\n    local_failure = false;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t global_tid_235602;\n    int32_t local_tid_235603;\n    int64_t group_sizze_235606;\n    int32_t wave_sizze_235605;\n    int32_t group_tid_235604;\n    \n    global_tid_235602 = get_global_id(0);\n    local_tid_235603 = get_local_id(0);\n    group_sizze_235606 = get_local_size(0);\n    wave_sizze_235605 = LOCKSTEP_WIDTH;\n    group_tid_235604 = get_group_id(0);\n    \n    int32_t phys_tid_222551 = global_tid_235602;\n    int32_t phys_group_id_235607;\n    \n    phys_group_id_235607 = get_group_id(0);\n    for (int32_t i_235608 = 0; i_235608 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577,\n                                          segmap_group_sizze_222546)) -\n                   phys_group_id_235607, sext_i64_i32(num_groups_222547));\n         i_235608++) {\n        int32_t virt_group_id_235609 = phys_group_id_235607 + i_235608 *\n                sext_i64_i32(num_groups_222547);\n        int64_t global_tid_235610 = sext_i32_i64(virt_group_id_235609) *\n                segmap_group_sizze_222546 + sext_i32_i64(local_tid_235603);\n        int64_t slice_235611 = partition_sizze_203577;\n        int64_t gtid_222550 = global_tid_235610;\n        int64_t remnant_235612 = global_tid_235610 - gtid_222550;\n        \n        if (slt64(gtid_222550, partition_sizze_203577)) {\n            int64_t x_222556;\n            \n            x_222556 = ((__global int64_t *) ext_mem_229196)[gtid_222550];\n            for (int64_t i_229005 = 0; i_229005 < n_203490; i_229005++) {\n                double x_222560;\n                \n                x_222560 = ((__global double *) mem_229161)[gtid_222550 *\n                                                            n_203490 +\n                                                            i_229005];\n                \n                double x_222561;\n                \n                x_2",
            "22561 = ((__global double *) mem_230927)[i_229005 *\n                                                            partition_sizze_203577 +\n                                                            gtid_222550];\n                \n                double defunc_1_f_res_222562 = x_222560 - x_222561;\n                \n                ((__global double *) color_232040)[phys_tid_222551 + i_229005 *\n                                                   num_threads_232182] =\n                    defunc_1_f_res_222562;\n            }\n            for (int64_t i_229011 = 0; i_229011 < n_203490; i_229011++) {\n                int64_t x_222565;\n                \n                x_222565 = ((__global int64_t *) mem_230930)[i_229011 *\n                                                             partition_sizze_203577 +\n                                                             gtid_222550];\n                \n                bool cond_222566 = sle64((int64_t) 0, x_222565);\n                double defunc_0_f_res_222567;\n                \n                if (cond_222566) {\n                    bool y_222568 = slt64(x_222565, n_203490);\n                    bool bounds_check_222569 = cond_222566 && y_222568;\n                    bool index_certs_222570;\n                    \n                    if (!bounds_check_222569) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          52) == -1) {\n                                global_failure_args[0] = (int64_t) x_222565;\n                                global_failure_args[1] = (int64_t) n_203490;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    double defunc_0_f_res_t_res_222571;\n                    \n                    defunc_0_f_res_t_res_222571 = ((__globa",
            "l\n                                                    double *) color_232040)[phys_tid_222551 +\n                                                                            x_222565 *\n                                                                            num_threads_232182];\n                    defunc_0_f_res_222567 = defunc_0_f_res_t_res_222571;\n                } else {\n                    defunc_0_f_res_222567 = 0.0;\n                }\n                \n                double defunc_0_f_res_222572;\n                \n                if (cond_222566) {\n                    bool y_222573 = slt64(x_222565, n_203490);\n                    bool bounds_check_222574 = cond_222566 && y_222573;\n                    bool index_certs_222575;\n                    \n                    if (!bounds_check_222574) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          53) == -1) {\n                                global_failure_args[0] = (int64_t) x_222565;\n                                global_failure_args[1] = (int64_t) n_203490;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    double defunc_0_f_res_t_res_222576;\n                    \n                    defunc_0_f_res_t_res_222576 = ((__global\n                                                    double *) mem_230939)[x_222565 *\n                                                                          partition_sizze_203577 +\n                                                                          gtid_222550];\n                    defunc_0_f_res_222572 = defunc_0_f_res_t_res_222576;\n                } else {\n                    defunc_0_f_res_222572 = 0.0;\n                }\n                ((__global double *) color_232042)[phys_tid_22",
            "2551 + i_229011 *\n                                                   num_threads_232182] =\n                    defunc_0_f_res_222572;\n                ((__global double *) color_232041)[phys_tid_222551 + i_229011 *\n                                                   num_threads_232182] =\n                    defunc_0_f_res_222567;\n            }\n            for (int64_t i_229016 = 0; i_229016 < t_n_m_203650; i_229016++) {\n                int64_t x_222579;\n                \n                x_222579 = ((__global int64_t *) mem_230933)[i_229016 *\n                                                             partition_sizze_203577 +\n                                                             gtid_222550];\n                \n                double x_222580;\n                \n                x_222580 = ((__global double *) mem_230936)[i_229016 *\n                                                            partition_sizze_203577 +\n                                                            gtid_222550];\n                \n                int64_t min_arg_222581 = mul64(jump_t_203500, i_229016);\n                int64_t min_res_222582 = smin64(i_203670, min_arg_222581);\n                int64_t defunc_0_g_res_222583 = add64((int64_t) 1,\n                                                      min_res_222582);\n                double defunc_2_reduce_res_222584;\n                double redout_228222 = 0.0;\n                \n                for (int64_t i_228223 = 0; i_228223 < q_t_203494; i_228223++) {\n                    bool cond_222589 = sle64(x_222556, i_228223);\n                    int64_t defunc_0_f_res_222590;\n                    \n                    if (cond_222589) {\n                        defunc_0_f_res_222590 = (int64_t) 0;\n                    } else {\n                        int64_t i_222591 = add64(x_222579, i_228223);\n                        int64_t defunc_0_add_arg_222592;\n                        \n                        defunc_0_add_arg_222592 = ((__global\n                      ",
            "                              int64_t *) mem_230930)[i_222591 *\n                                                                           partition_sizze_203577 +\n                                                                           gtid_222550];\n                        \n                        int64_t defunc_1_add_res_222593 = add64((int64_t) 1,\n                                                                defunc_0_add_arg_222592);\n                        \n                        defunc_0_f_res_222590 = defunc_1_add_res_222593;\n                    }\n                    \n                    double defunc_0_f_res_222594;\n                    \n                    if (cond_222589) {\n                        defunc_0_f_res_222594 = 0.0;\n                    } else {\n                        int64_t i_222595 = add64(x_222579, i_228223);\n                        double defunc_0_add_arg_222596;\n                        \n                        defunc_0_add_arg_222596 = ((__global\n                                                    double *) color_232042)[phys_tid_222551 +\n                                                                            i_222595 *\n                                                                            num_threads_232182];\n                        defunc_0_f_res_222594 = defunc_0_add_arg_222596;\n                    }\n                    \n                    int64_t binop_p_222597 = sub64(defunc_0_f_res_222590,\n                                                   defunc_0_g_res_222583);\n                    double defunc_0_f_res_222598 =\n                           sitofp_i64_f64(binop_p_222597);\n                    double abs_res_222599 = fabs(defunc_0_f_res_222598);\n                    double tmp1_222600 = abs_res_222599 / x_222580;\n                    double x_222601 = tmp1_222600 * tmp1_222600;\n                    double y_222602 = tmp1_222600 * x_222601;\n                    double tmp2_222603 = 1.0 - y_222602;\n                    double x_222",
            "604 = tmp2_222603 * tmp2_222603;\n                    double tmp3_222605 = tmp2_222603 * x_222604;\n                    double w_j_222606 = defunc_0_f_res_222594 * tmp3_222605;\n                    double defunc_1_op_res_222587 = w_j_222606 + redout_228222;\n                    double redout_tmp_235617 = defunc_1_op_res_222587;\n                    \n                    redout_228222 = redout_tmp_235617;\n                }\n                defunc_2_reduce_res_222584 = redout_228222;\n                \n                double a0_222607 = 1.0 / defunc_2_reduce_res_222584;\n                double defunc_2_reduce_res_222608;\n                double redout_228224 = 0.0;\n                \n                for (int64_t i_228225 = 0; i_228225 < q_t_203494; i_228225++) {\n                    bool cond_222613 = sle64(x_222556, i_228225);\n                    int64_t defunc_0_f_res_222614;\n                    \n                    if (cond_222613) {\n                        defunc_0_f_res_222614 = (int64_t) 0;\n                    } else {\n                        int64_t i_222615 = add64(x_222579, i_228225);\n                        int64_t defunc_0_add_arg_222616;\n                        \n                        defunc_0_add_arg_222616 = ((__global\n                                                    int64_t *) mem_230930)[i_222615 *\n                                                                           partition_sizze_203577 +\n                                                                           gtid_222550];\n                        \n                        int64_t defunc_1_add_res_222617 = add64((int64_t) 1,\n                                                                defunc_0_add_arg_222616);\n                        \n                        defunc_0_f_res_222614 = defunc_1_add_res_222617;\n                    }\n                    \n                    double defunc_0_f_res_222618;\n                    \n                    if (cond_222613) {\n                        defunc_0_f_res_22261",
            "8 = 0.0;\n                    } else {\n                        int64_t i_222619 = add64(x_222579, i_228225);\n                        double defunc_0_add_arg_222620;\n                        \n                        defunc_0_add_arg_222620 = ((__global\n                                                    double *) color_232042)[phys_tid_222551 +\n                                                                            i_222619 *\n                                                                            num_threads_232182];\n                        defunc_0_f_res_222618 = defunc_0_add_arg_222620;\n                    }\n                    \n                    int64_t binop_p_222621 = sub64(defunc_0_f_res_222614,\n                                                   defunc_0_g_res_222583);\n                    double defunc_0_f_res_222622 =\n                           sitofp_i64_f64(binop_p_222621);\n                    double abs_res_222623 = fabs(defunc_0_f_res_222622);\n                    double tmp1_222624 = abs_res_222623 / x_222580;\n                    double x_222625 = tmp1_222624 * tmp1_222624;\n                    double y_222626 = tmp1_222624 * x_222625;\n                    double tmp2_222627 = 1.0 - y_222626;\n                    double x_222628 = tmp2_222627 * tmp2_222627;\n                    double tmp3_222629 = tmp2_222627 * x_222628;\n                    double tmp4_222630 = defunc_0_f_res_222618 * tmp3_222629;\n                    double defunc_0_f_res_222631;\n                    \n                    if (cond_222613) {\n                        defunc_0_f_res_222631 = 0.0;\n                    } else {\n                        int64_t i_222632 = add64(x_222579, i_228225);\n                        double defunc_0_add_arg_222633;\n                        \n                        defunc_0_add_arg_222633 = ((__global\n                                                    double *) color_232041)[phys_tid_222551 +\n                                                                  ",
            "          i_222632 *\n                                                                            num_threads_232182];\n                        defunc_0_f_res_222631 = defunc_0_add_arg_222633;\n                    }\n                    \n                    double x_222634 = a0_222607 * tmp4_222630;\n                    double defunc_9_fit_fun_res_222635 = defunc_0_f_res_222631 *\n                           x_222634;\n                    double defunc_1_op_res_222611 =\n                           defunc_9_fit_fun_res_222635 + redout_228224;\n                    double redout_tmp_235618 = defunc_1_op_res_222611;\n                    \n                    redout_228224 = redout_tmp_235618;\n                }\n                defunc_2_reduce_res_222608 = redout_228224;\n                ((__global double *) color_232040)[phys_tid_222551 + i_229016 *\n                                                   num_threads_232182] =\n                    defunc_2_reduce_res_222608;\n            }\n            for (int64_t i_235619 = 0; i_235619 < t_n_m_203650; i_235619++) {\n                double tmp_235620;\n                \n                tmp_235620 = ((__global\n                               double *) color_232040)[phys_tid_222551 +\n                                                       i_235619 *\n                                                       num_threads_232182];\n                ((__global double *) mem_231003)[gtid_222550 + i_235619 *\n                                                 partition_sizze_203577] =\n                    tmp_235620;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_222546\n}\n__kernel void mainzisegmap_223067(__global int *global_failure,\n                                  int64_t n_203490,\n                                  int64_t partition_sizze_203577, __global\n                                  unsigned char *mem_229161, __global\n                                  un",
            "signed char *mem_230920, __global\n                                  unsigned char *mem_231008)\n{\n    #define segmap_group_sizze_223062 (mainzisegmap_group_sizze_223036)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235621;\n    int32_t local_tid_235622;\n    int64_t group_sizze_235625;\n    int32_t wave_sizze_235624;\n    int32_t group_tid_235623;\n    \n    global_tid_235621 = get_global_id(0);\n    local_tid_235622 = get_local_id(0);\n    group_sizze_235625 = get_local_size(0);\n    wave_sizze_235624 = LOCKSTEP_WIDTH;\n    group_tid_235623 = get_group_id(0);\n    \n    int32_t phys_tid_223067 = global_tid_235621;\n    int64_t global_tid_235626 = sext_i32_i64(group_tid_235623) *\n            segmap_group_sizze_223062 + sext_i32_i64(local_tid_235622);\n    int64_t slice_235627 = n_203490;\n    int64_t slice_235628 = partition_sizze_203577 * slice_235627;\n    int64_t gtid_223065 = squot64(global_tid_235626, slice_235627);\n    int64_t remnant_235629 = global_tid_235626 - gtid_223065 * slice_235627;\n    int64_t gtid_223066 = remnant_235629;\n    int64_t remnant_235630 = remnant_235629 - gtid_223066;\n    \n    if (slt64(gtid_223065, partition_sizze_203577) && slt64(gtid_223066,\n                                                            n_203490)) {\n        double x_223068;\n        \n        x_223068 = ((__global double *) mem_229161)[gtid_223065 * n_203490 +\n                                                    gtid_223066];\n        \n        double x_223069;\n        \n        x_223069 = ((__global double *) mem_230920)[gtid_223065 * n_203490 +\n                                                    gtid_223066];\n        \n        double defunc_1_f_res_223070 = x_223068 - x_223069;\n        \n        ((__global double *) mem_231008)[gtid_223065 * n_203490 + gtid_223066] =\n            defunc_1_f_res_223070;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_223",
            "062\n}\n__kernel void mainzisegmap_223084(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203490,\n                                  int64_t partition_sizze_203577,\n                                  int64_t ctx_param_ext_229488,\n                                  int64_t ctx_param_ext_229489,\n                                  int64_t ctx_param_ext_229491, __global\n                                  unsigned char *ext_mem_229197, __global\n                                  unsigned char *mem_param_229493, __global\n                                  unsigned char *mem_231008, __global\n                                  unsigned char *mem_231013, __global\n                                  unsigned char *mem_231017)\n{\n    #define segmap_group_sizze_223078 (mainzisegmap_group_sizze_222980)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235631;\n    int32_t local_tid_235632;\n    int64_t group_sizze_235635;\n    int32_t wave_sizze_235634;\n    int32_t group_tid_235633;\n    \n    global_tid_235631 = get_global_id(0);\n    local_tid_235632 = get_local_id(0);\n    group_sizze_235635 = get_local_size(0);\n    wave_sizze_235634 = LOCKSTEP_WIDTH;\n    group_tid_235633 = get_group_id(0);\n    \n    int32_t phys_tid_223084 = global_tid_235631;\n    int64_t global_tid_235636 = sext_i32_i64(group_tid_235633) *\n            segmap_group_sizze_223078 + sext_i32_i64(local_tid_235632);\n    int64_t slice_235637 = n_203490;\n    int64_t slice_235638 = partition_sizze_203577 * slice_235637;\n    int64_t gtid_223082 = squot64(global_tid_235636, slice_235637);\n    int64_t remnant_235639 = global_tid_235636 - gtid_223082 * slice_235637;\n    int64_t gtid_223083 = remnant_235639;\n    int64_t remnant_235640 = remnant_235639 - gtid_22308",
            "3;\n    \n    if (slt64(gtid_223082, partition_sizze_203577) && slt64(gtid_223083,\n                                                            n_203490)) {\n        int64_t x_223087;\n        \n        x_223087 = ((__global int64_t *) ext_mem_229197)[gtid_223082 *\n                                                         n_203490 +\n                                                         gtid_223083];\n        \n        bool cond_223088 = sle64((int64_t) 0, x_223087);\n        double defunc_0_f_res_223089;\n        \n        if (cond_223088) {\n            bool y_223090 = slt64(x_223087, n_203490);\n            bool bounds_check_223091 = cond_223088 && y_223090;\n            bool index_certs_223092;\n            \n            if (!bounds_check_223091) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 54) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) x_223087;\n                        global_failure_args[1] = (int64_t) n_203490;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            double defunc_0_f_res_t_res_223093;\n            \n            defunc_0_f_res_t_res_223093 = ((__global\n                                            double *) mem_231008)[gtid_223082 *\n                                                                  n_203490 +\n                                                                  x_223087];\n            defunc_0_f_res_223089 = defunc_0_f_res_t_res_223093;\n        } else {\n            defunc_0_f_res_223089 = 0.0;\n        }\n        \n        double defunc_0_f_res_223094;\n        \n        if (cond_223088) {\n            bool y_223095 = slt64(x_223087, n_203490);\n            bool bounds_check_223096 = cond_223088 && y_223095;\n            bool index_certs_223097;\n            \n            if (!bounds_check_223096) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 55) ==\n",
            "                        -1) {\n                        global_failure_args[0] = (int64_t) x_223087;\n                        global_failure_args[1] = (int64_t) n_203490;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            double defunc_0_f_res_t_res_223098;\n            \n            defunc_0_f_res_t_res_223098 = ((__global\n                                            double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                                        (gtid_223082 *\n                                                                         ctx_param_ext_229489 +\n                                                                         x_223087 *\n                                                                         ctx_param_ext_229491)];\n            defunc_0_f_res_223094 = defunc_0_f_res_t_res_223098;\n        } else {\n            defunc_0_f_res_223094 = 0.0;\n        }\n        ((__global double *) mem_231013)[gtid_223082 * n_203490 + gtid_223083] =\n            defunc_0_f_res_223094;\n        ((__global double *) mem_231017)[gtid_223082 * n_203490 + gtid_223083] =\n            defunc_0_f_res_223089;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_223078\n}\n__kernel void mainzisegmap_223112(__global int *global_failure,\n                                  int64_t n_203490, int64_t q_t_203494,\n                                  int64_t jump_t_203500,\n                                  int64_t partition_sizze_203577,\n                                  int64_t t_n_m_203650, int64_t i_203670,\n                                  __global unsigned char *ext_mem_229196,\n                                  __global unsigned char *ext_mem_229197,\n                                  __global unsigned char *ext_mem_229460,\n                                  __global unsigned char *ext_mem_229461,\n                                  __global unsigned char *mem_231013, _",
            "_global\n                                  unsigned char *mem_231017, __global\n                                  unsigned char *mem_231022)\n{\n    #define segmap_group_sizze_223103 (mainzisegmap_group_sizze_222643)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235641;\n    int32_t local_tid_235642;\n    int64_t group_sizze_235645;\n    int32_t wave_sizze_235644;\n    int32_t group_tid_235643;\n    \n    global_tid_235641 = get_global_id(0);\n    local_tid_235642 = get_local_id(0);\n    group_sizze_235645 = get_local_size(0);\n    wave_sizze_235644 = LOCKSTEP_WIDTH;\n    group_tid_235643 = get_group_id(0);\n    \n    int32_t phys_tid_223112 = global_tid_235641;\n    int64_t global_tid_235646 = sext_i32_i64(group_tid_235643) *\n            segmap_group_sizze_223103 + sext_i32_i64(local_tid_235642);\n    int64_t slice_235647 = t_n_m_203650;\n    int64_t slice_235648 = partition_sizze_203577 * slice_235647;\n    int64_t gtid_223110 = squot64(global_tid_235646, slice_235647);\n    int64_t remnant_235649 = global_tid_235646 - gtid_223110 * slice_235647;\n    int64_t gtid_223111 = remnant_235649;\n    int64_t remnant_235650 = remnant_235649 - gtid_223111;\n    \n    if (slt64(gtid_223110, partition_sizze_203577) && slt64(gtid_223111,\n                                                            t_n_m_203650)) {\n        int64_t x_223114;\n        \n        x_223114 = ((__global int64_t *) ext_mem_229196)[gtid_223110];\n        \n        int64_t x_223118;\n        \n        x_223118 = ((__global int64_t *) ext_mem_229461)[gtid_223110 *\n                                                         t_n_m_203650 +\n                                                         gtid_223111];\n        \n        double x_223119;\n        \n        x_223119 = ((__global double *) ext_mem_229460)[gtid_223110 *\n                                                        t_n_m_203650 +\n                        ",
            "                                gtid_223111];\n        \n        int64_t min_arg_223120 = mul64(jump_t_203500, gtid_223111);\n        int64_t min_res_223121 = smin64(i_203670, min_arg_223120);\n        int64_t defunc_0_g_res_223122 = add64((int64_t) 1, min_res_223121);\n        double defunc_2_reduce_res_223123;\n        double redout_228230 = 0.0;\n        \n        for (int64_t i_228231 = 0; i_228231 < q_t_203494; i_228231++) {\n            bool cond_223128 = sle64(x_223114, i_228231);\n            int64_t defunc_0_f_res_223129;\n            \n            if (cond_223128) {\n                defunc_0_f_res_223129 = (int64_t) 0;\n            } else {\n                int64_t i_223130 = add64(x_223118, i_228231);\n                int64_t defunc_0_add_arg_223131;\n                \n                defunc_0_add_arg_223131 = ((__global\n                                            int64_t *) ext_mem_229197)[gtid_223110 *\n                                                                       n_203490 +\n                                                                       i_223130];\n                \n                int64_t defunc_1_add_res_223132 = add64((int64_t) 1,\n                                                        defunc_0_add_arg_223131);\n                \n                defunc_0_f_res_223129 = defunc_1_add_res_223132;\n            }\n            \n            double defunc_0_f_res_223133;\n            \n            if (cond_223128) {\n                defunc_0_f_res_223133 = 0.0;\n            } else {\n                int64_t i_223134 = add64(x_223118, i_228231);\n                double defunc_0_add_arg_223135;\n                \n                defunc_0_add_arg_223135 = ((__global\n                                            double *) mem_231013)[gtid_223110 *\n                                                                  n_203490 +\n                                                                  i_223134];\n                defunc_0_f_res_223133 = defunc_0_add_arg_223135;\n            }\n   ",
            "         \n            int64_t binop_p_223136 = sub64(defunc_0_f_res_223129,\n                                           defunc_0_g_res_223122);\n            double defunc_0_f_res_223137 = sitofp_i64_f64(binop_p_223136);\n            double abs_res_223138 = fabs(defunc_0_f_res_223137);\n            double tmp1_223139 = abs_res_223138 / x_223119;\n            double x_223140 = tmp1_223139 * tmp1_223139;\n            double y_223141 = tmp1_223139 * x_223140;\n            double tmp2_223142 = 1.0 - y_223141;\n            double x_223143 = tmp2_223142 * tmp2_223142;\n            double tmp3_223144 = tmp2_223142 * x_223143;\n            double w_j_223145 = defunc_0_f_res_223133 * tmp3_223144;\n            double defunc_1_op_res_223126 = w_j_223145 + redout_228230;\n            double redout_tmp_235651 = defunc_1_op_res_223126;\n            \n            redout_228230 = redout_tmp_235651;\n        }\n        defunc_2_reduce_res_223123 = redout_228230;\n        \n        double a0_223146 = 1.0 / defunc_2_reduce_res_223123;\n        double defunc_2_reduce_res_223147;\n        double redout_228232 = 0.0;\n        \n        for (int64_t i_228233 = 0; i_228233 < q_t_203494; i_228233++) {\n            bool cond_223152 = sle64(x_223114, i_228233);\n            int64_t defunc_0_f_res_223153;\n            \n            if (cond_223152) {\n                defunc_0_f_res_223153 = (int64_t) 0;\n            } else {\n                int64_t i_223154 = add64(x_223118, i_228233);\n                int64_t defunc_0_add_arg_223155;\n                \n                defunc_0_add_arg_223155 = ((__global\n                                            int64_t *) ext_mem_229197)[gtid_223110 *\n                                                                       n_203490 +\n                                                                       i_223154];\n                \n                int64_t defunc_1_add_res_223156 = add64((int64_t) 1,\n                                                        defunc_0_add_arg_223155);\n          ",
            "      \n                defunc_0_f_res_223153 = defunc_1_add_res_223156;\n            }\n            \n            double defunc_0_f_res_223157;\n            \n            if (cond_223152) {\n                defunc_0_f_res_223157 = 0.0;\n            } else {\n                int64_t i_223158 = add64(x_223118, i_228233);\n                double defunc_0_add_arg_223159;\n                \n                defunc_0_add_arg_223159 = ((__global\n                                            double *) mem_231013)[gtid_223110 *\n                                                                  n_203490 +\n                                                                  i_223158];\n                defunc_0_f_res_223157 = defunc_0_add_arg_223159;\n            }\n            \n            int64_t binop_p_223160 = sub64(defunc_0_f_res_223153,\n                                           defunc_0_g_res_223122);\n            double defunc_0_f_res_223161 = sitofp_i64_f64(binop_p_223160);\n            double abs_res_223162 = fabs(defunc_0_f_res_223161);\n            double tmp1_223163 = abs_res_223162 / x_223119;\n            double x_223164 = tmp1_223163 * tmp1_223163;\n            double y_223165 = tmp1_223163 * x_223164;\n            double tmp2_223166 = 1.0 - y_223165;\n            double x_223167 = tmp2_223166 * tmp2_223166;\n            double tmp3_223168 = tmp2_223166 * x_223167;\n            double tmp4_223169 = defunc_0_f_res_223157 * tmp3_223168;\n            double defunc_0_f_res_223170;\n            \n            if (cond_223152) {\n                defunc_0_f_res_223170 = 0.0;\n            } else {\n                int64_t i_223171 = add64(x_223118, i_228233);\n                double defunc_0_add_arg_223172;\n                \n                defunc_0_add_arg_223172 = ((__global\n                                            double *) mem_231017)[gtid_223110 *\n                                                                  n_203490 +\n                                                                  i_223171];\n",
            "                defunc_0_f_res_223170 = defunc_0_add_arg_223172;\n            }\n            \n            double x_223173 = a0_223146 * tmp4_223169;\n            double defunc_9_fit_fun_res_223174 = defunc_0_f_res_223170 *\n                   x_223173;\n            double defunc_1_op_res_223150 = defunc_9_fit_fun_res_223174 +\n                   redout_228232;\n            double redout_tmp_235652 = defunc_1_op_res_223150;\n            \n            redout_228232 = redout_tmp_235652;\n        }\n        defunc_2_reduce_res_223147 = redout_228232;\n        ((__global double *) mem_231022)[gtid_223110 * t_n_m_203650 +\n                                         gtid_223111] =\n            defunc_2_reduce_res_223147;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_223103\n}\n__kernel void mainzisegmap_223236(__global int *global_failure,\n                                  int64_t partition_sizze_203577,\n                                  int64_t t_n_m_203650, __global\n                                  unsigned char *mem_231027, __global\n                                  unsigned char *mem_231032)\n{\n    #define segmap_group_sizze_223231 (mainzisegmap_group_sizze_222781)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235725;\n    int32_t local_tid_235726;\n    int64_t group_sizze_235729;\n    int32_t wave_sizze_235728;\n    int32_t group_tid_235727;\n    \n    global_tid_235725 = get_global_id(0);\n    local_tid_235726 = get_local_id(0);\n    group_sizze_235729 = get_local_size(0);\n    wave_sizze_235728 = LOCKSTEP_WIDTH;\n    group_tid_235727 = get_group_id(0);\n    \n    int32_t phys_tid_223236 = global_tid_235725;\n    int64_t global_tid_235730 = sext_i32_i64(group_tid_235727) *\n            segmap_group_sizze_223231 + sext_i32_i64(local_tid_235726);\n    int64_t slice_235731 = t_n_m_203650;\n    int64_t slice_235732 = partition_sizze_203577 * slice_235731;\n    i",
            "nt64_t gtid_223234 = squot64(global_tid_235730, slice_235731);\n    int64_t remnant_235733 = global_tid_235730 - gtid_223234 * slice_235731;\n    int64_t gtid_223235 = remnant_235733;\n    int64_t remnant_235734 = remnant_235733 - gtid_223235;\n    \n    if (slt64(gtid_223234, partition_sizze_203577) && slt64(gtid_223235,\n                                                            t_n_m_203650)) {\n        double defunc_2_reduce_res_223237;\n        \n        defunc_2_reduce_res_223237 = ((__global\n                                       double *) mem_231027)[gtid_223234 *\n                                                             t_n_m_203650 +\n                                                             gtid_223235];\n        \n        double a0_223238 = 1.0 / defunc_2_reduce_res_223237;\n        \n        ((__global double *) mem_231032)[gtid_223234 * t_n_m_203650 +\n                                         gtid_223235] = a0_223238;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_223231\n}\n__kernel void mainzisegmap_223423(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203490, int64_t q_t_203494,\n                                  int64_t jump_t_203500,\n                                  int64_t partition_sizze_203577,\n                                  int64_t t_n_m_203650, int64_t i_203670,\n                                  int64_t num_groups_223418,\n                                  int64_t num_threads_232192, __global\n                                  unsigned char *mem_229161, __global\n                                  unsigned char *ext_mem_229196, __global\n                                  unsigned char *mem_231047, __global\n                                  unsigned char *mem_231050, __global\n                                  unsigned char *mem_231053, __global\n                                  uns",
            "igned char *mem_231056, __global\n                                  unsigned char *mem_231059, __global\n                                  unsigned char *mem_231138, __global\n                                  unsigned char *mem_231141, __global\n                                  unsigned char *color_232044, __global\n                                  unsigned char *color_232045, __global\n                                  unsigned char *color_232046, __global\n                                  unsigned char *color_232047)\n{\n    #define segmap_group_sizze_223417 (mainzisegmap_group_sizze_223296)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile __local bool local_failure;\n    \n    if (failure_is_an_option) {\n        int failed = *global_failure >= 0;\n        \n        if (failed)\n            return;\n    }\n    local_failure = false;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t global_tid_235824;\n    int32_t local_tid_235825;\n    int64_t group_sizze_235828;\n    int32_t wave_sizze_235827;\n    int32_t group_tid_235826;\n    \n    global_tid_235824 = get_global_id(0);\n    local_tid_235825 = get_local_id(0);\n    group_sizze_235828 = get_local_size(0);\n    wave_sizze_235827 = LOCKSTEP_WIDTH;\n    group_tid_235826 = get_group_id(0);\n    \n    int32_t phys_tid_223423 = global_tid_235824;\n    int32_t phys_group_id_235829;\n    \n    phys_group_id_235829 = get_group_id(0);\n    for (int32_t i_235830 = 0; i_235830 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577,\n                                          segmap_group_sizze_223417)) -\n                   phys_group_id_235829, sext_i64_i32(num_groups_223418));\n         i_235830++) {\n        int32_t virt_group_id_235831 = phys_group_id_235829 + i_235830 *\n                sext_i64_i32(num_groups_223418);\n        int64_t global_tid_235832 = sext_i32_i64(virt_group_id_235831) *\n                segmap_group_sizze_223417 + sext_i32_i64(local_tid_235825);\n        int64_t ",
            "slice_235833 = partition_sizze_203577;\n        int64_t gtid_223422 = global_tid_235832;\n        int64_t remnant_235834 = global_tid_235832 - gtid_223422;\n        \n        if (slt64(gtid_223422, partition_sizze_203577)) {\n            int64_t x_223428;\n            \n            x_223428 = ((__global int64_t *) ext_mem_229196)[gtid_223422];\n            for (int64_t i_229020 = 0; i_229020 < n_203490; i_229020++) {\n                double x_223432;\n                \n                x_223432 = ((__global double *) mem_229161)[gtid_223422 *\n                                                            n_203490 +\n                                                            i_229020];\n                \n                double x_223433;\n                \n                x_223433 = ((__global double *) mem_231047)[i_229020 *\n                                                            partition_sizze_203577 +\n                                                            gtid_223422];\n                \n                double defunc_1_f_res_223434 = x_223432 - x_223433;\n                \n                ((__global double *) color_232044)[phys_tid_223423 + i_229020 *\n                                                   num_threads_232192] =\n                    defunc_1_f_res_223434;\n            }\n            for (int64_t i_229026 = 0; i_229026 < n_203490; i_229026++) {\n                int64_t x_223437;\n                \n                x_223437 = ((__global int64_t *) mem_231050)[i_229026 *\n                                                             partition_sizze_203577 +\n                                                             gtid_223422];\n                \n                bool cond_223438 = sle64((int64_t) 0, x_223437);\n                double defunc_0_f_res_223439;\n                \n                if (cond_223438) {\n                    bool y_223440 = slt64(x_223437, n_203490);\n                    bool bounds_check_223441 = cond_223438 && y_223440;\n                    bool index_certs_22",
            "3442;\n                    \n                    if (!bounds_check_223441) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          56) == -1) {\n                                global_failure_args[0] = (int64_t) x_223437;\n                                global_failure_args[1] = (int64_t) n_203490;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    double defunc_0_f_res_t_res_223443;\n                    \n                    defunc_0_f_res_t_res_223443 = ((__global\n                                                    double *) color_232044)[phys_tid_223423 +\n                                                                            x_223437 *\n                                                                            num_threads_232192];\n                    defunc_0_f_res_223439 = defunc_0_f_res_t_res_223443;\n                } else {\n                    defunc_0_f_res_223439 = 0.0;\n                }\n                \n                double defunc_0_f_res_223444;\n                \n                if (cond_223438) {\n                    bool y_223445 = slt64(x_223437, n_203490);\n                    bool bounds_check_223446 = cond_223438 && y_223445;\n                    bool index_certs_223447;\n                    \n                    if (!bounds_check_223446) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          57) == -1) {\n                                global_failure_args[0] = (int64_t) x_223437;\n                                global_failure_args[1] = (int64_t) n_203490;\n                                ;\n                            }\n                            local",
            "_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    double defunc_0_f_res_t_res_223448;\n                    \n                    defunc_0_f_res_t_res_223448 = ((__global\n                                                    double *) mem_231059)[x_223437 *\n                                                                          partition_sizze_203577 +\n                                                                          gtid_223422];\n                    defunc_0_f_res_223444 = defunc_0_f_res_t_res_223448;\n                } else {\n                    defunc_0_f_res_223444 = 0.0;\n                }\n                ((__global double *) color_232047)[phys_tid_223423 + i_229026 *\n                                                   num_threads_232192] =\n                    defunc_0_f_res_223444;\n                ((__global double *) color_232046)[phys_tid_223423 + i_229026 *\n                                                   num_threads_232192] =\n                    defunc_0_f_res_223439;\n            }\n            for (int64_t i_229033 = 0; i_229033 < t_n_m_203650; i_229033++) {\n                int64_t x_223452;\n                \n                x_223452 = ((__global int64_t *) mem_231053)[i_229033 *\n                                                             partition_sizze_203577 +\n                                                             gtid_223422];\n                \n                double x_223453;\n                \n                x_223453 = ((__global double *) mem_231056)[i_229033 *\n                                                            partition_sizze_203577 +\n                                                            gtid_223422];\n                \n                int64_t min_arg_223454 = mul64(jump_t_203500, i_229033);\n                int64_t min_res_223455 = smin64(i_203670, min_arg_223454);\n                int64_t defunc_0_g_res_223456 = add64((int64_t) 1,\n",
            "                                                      min_res_223455);\n                double defunc_2_reduce_res_223457;\n                double defunc_2_reduce_res_223458;\n                double defunc_2_reduce_res_223459;\n                double redout_228246;\n                double redout_228247;\n                double redout_228248;\n                \n                redout_228246 = 0.0;\n                redout_228247 = 0.0;\n                redout_228248 = 0.0;\n                for (int64_t i_228249 = 0; i_228249 < q_t_203494; i_228249++) {\n                    bool cond_223470 = sle64(x_223428, i_228249);\n                    int64_t defunc_0_f_res_223471;\n                    \n                    if (cond_223470) {\n                        defunc_0_f_res_223471 = (int64_t) 0;\n                    } else {\n                        int64_t i_223472 = add64(x_223452, i_228249);\n                        int64_t defunc_0_add_arg_223473;\n                        \n                        defunc_0_add_arg_223473 = ((__global\n                                                    int64_t *) mem_231050)[i_223472 *\n                                                                           partition_sizze_203577 +\n                                                                           gtid_223422];\n                        \n                        int64_t defunc_1_add_res_223474 = add64((int64_t) 1,\n                                                                defunc_0_add_arg_223473);\n                        \n                        defunc_0_f_res_223471 = defunc_1_add_res_223474;\n                    }\n                    \n                    double defunc_0_f_res_223475;\n                    \n                    if (cond_223470) {\n                        defunc_0_f_res_223475 = 0.0;\n                    } else {\n                        int64_t i_223476 = add64(x_223452, i_228249);\n                        double defunc_0_add_arg_223477;\n                        \n                       ",
            " defunc_0_add_arg_223477 = ((__global\n                                                    double *) color_232047)[phys_tid_223423 +\n                                                                            i_223476 *\n                                                                            num_threads_232192];\n                        defunc_0_f_res_223475 = defunc_0_add_arg_223477;\n                    }\n                    \n                    int64_t binop_p_223478 = sub64(defunc_0_f_res_223471,\n                                                   defunc_0_g_res_223456);\n                    double defunc_0_f_res_223479 =\n                           sitofp_i64_f64(binop_p_223478);\n                    double abs_res_223480 = fabs(defunc_0_f_res_223479);\n                    double tmp1_223481 = abs_res_223480 / x_223453;\n                    double x_223482 = tmp1_223481 * tmp1_223481;\n                    double y_223483 = tmp1_223481 * x_223482;\n                    double tmp2_223484 = 1.0 - y_223483;\n                    double x_223485 = tmp2_223484 * tmp2_223484;\n                    double tmp3_223486 = tmp2_223484 * x_223485;\n                    double w_j_223487 = defunc_0_f_res_223475 * tmp3_223486;\n                    double xw_j_223488 = defunc_0_f_res_223479 * w_j_223487;\n                    double x2w_j_223489 = defunc_0_f_res_223479 * xw_j_223488;\n                    double defunc_1_op_res_223462 = w_j_223487 + redout_228246;\n                    double defunc_1_op_res_223465 = xw_j_223488 + redout_228247;\n                    double defunc_1_op_res_223468 = x2w_j_223489 +\n                           redout_228248;\n                    double redout_tmp_235840 = defunc_1_op_res_223462;\n                    double redout_tmp_235841 = defunc_1_op_res_223465;\n                    double redout_tmp_235842 = defunc_1_op_res_223468;\n                    \n                    redout_228246 = redout_tmp_235840;\n                    redout_228247 = redout_tmp_235841;\n       ",
            "             redout_228248 = redout_tmp_235842;\n                }\n                defunc_2_reduce_res_223457 = redout_228246;\n                defunc_2_reduce_res_223458 = redout_228247;\n                defunc_2_reduce_res_223459 = redout_228248;\n                \n                double x_223490 = defunc_2_reduce_res_223457 *\n                       defunc_2_reduce_res_223459;\n                double y_223491 = defunc_2_reduce_res_223458 *\n                       defunc_2_reduce_res_223458;\n                double y_223492 = x_223490 - y_223491;\n                double det1_223493 = 1.0 / y_223492;\n                double a11_223494 = defunc_2_reduce_res_223459 * det1_223493;\n                double x_223495 = 0.0 - defunc_2_reduce_res_223458;\n                double b11_223496 = det1_223493 * x_223495;\n                double c11_223497 = defunc_2_reduce_res_223457 * det1_223493;\n                double defunc_2_reduce_res_223498;\n                double defunc_2_reduce_res_223499;\n                double redout_228250;\n                double redout_228251;\n                \n                redout_228250 = 0.0;\n                redout_228251 = 0.0;\n                for (int64_t i_228252 = 0; i_228252 < q_t_203494; i_228252++) {\n                    bool cond_223507 = sle64(x_223428, i_228252);\n                    int64_t defunc_0_f_res_223508;\n                    \n                    if (cond_223507) {\n                        defunc_0_f_res_223508 = (int64_t) 0;\n                    } else {\n                        int64_t i_223509 = add64(x_223452, i_228252);\n                        int64_t defunc_0_add_arg_223510;\n                        \n                        defunc_0_add_arg_223510 = ((__global\n                                                    int64_t *) mem_231050)[i_223509 *\n                                                                           partition_sizze_203577 +\n                                                                           gtid_223422];\n             ",
            "           \n                        int64_t defunc_1_add_res_223511 = add64((int64_t) 1,\n                                                                defunc_0_add_arg_223510);\n                        \n                        defunc_0_f_res_223508 = defunc_1_add_res_223511;\n                    }\n                    \n                    double defunc_0_f_res_223512;\n                    \n                    if (cond_223507) {\n                        defunc_0_f_res_223512 = 0.0;\n                    } else {\n                        int64_t i_223513 = add64(x_223452, i_228252);\n                        double defunc_0_add_arg_223514;\n                        \n                        defunc_0_add_arg_223514 = ((__global\n                                                    double *) color_232047)[phys_tid_223423 +\n                                                                            i_223513 *\n                                                                            num_threads_232192];\n                        defunc_0_f_res_223512 = defunc_0_add_arg_223514;\n                    }\n                    \n                    int64_t binop_p_223515 = sub64(defunc_0_f_res_223508,\n                                                   defunc_0_g_res_223456);\n                    double defunc_0_f_res_223516 =\n                           sitofp_i64_f64(binop_p_223515);\n                    double abs_res_223517 = fabs(defunc_0_f_res_223516);\n                    double tmp1_223518 = abs_res_223517 / x_223453;\n                    double x_223519 = tmp1_223518 * tmp1_223518;\n                    double y_223520 = tmp1_223518 * x_223519;\n                    double tmp2_223521 = 1.0 - y_223520;\n                    double x_223522 = tmp2_223521 * tmp2_223521;\n                    double tmp3_223523 = tmp2_223521 * x_223522;\n                    double tmp4_223524 = defunc_0_f_res_223512 * tmp3_223523;\n                    double defunc_1_f_res_223525 = defunc_0_f_res_223516 *\n               ",
            "            tmp4_223524;\n                    double defunc_0_f_res_223526;\n                    \n                    if (cond_223507) {\n                        defunc_0_f_res_223526 = 0.0;\n                    } else {\n                        int64_t i_223527 = add64(x_223452, i_228252);\n                        double defunc_0_add_arg_223528;\n                        \n                        defunc_0_add_arg_223528 = ((__global\n                                                    double *) color_232046)[phys_tid_223423 +\n                                                                            i_223527 *\n                                                                            num_threads_232192];\n                        defunc_0_f_res_223526 = defunc_0_add_arg_223528;\n                    }\n                    \n                    double x_223529 = a11_223494 * tmp4_223524;\n                    double y_223530 = b11_223496 * defunc_1_f_res_223525;\n                    double x_223531 = x_223529 + y_223530;\n                    double defunc_9_fit_fun_res_223532 = defunc_0_f_res_223526 *\n                           x_223531;\n                    double x_223533 = b11_223496 * tmp4_223524;\n                    double y_223534 = c11_223497 * defunc_1_f_res_223525;\n                    double x_223535 = x_223533 + y_223534;\n                    double defunc_9_slope_fun_res_223536 =\n                           defunc_0_f_res_223526 * x_223535;\n                    double defunc_1_op_res_223502 =\n                           defunc_9_fit_fun_res_223532 + redout_228250;\n                    double defunc_1_op_res_223505 =\n                           defunc_9_slope_fun_res_223536 + redout_228251;\n                    double redout_tmp_235843 = defunc_1_op_res_223502;\n                    double redout_tmp_235844 = defunc_1_op_res_223505;\n                    \n                    redout_228250 = redout_tmp_235843;\n                    redout_228251 = redout_tmp_235844;\n                }\n    ",
            "            defunc_2_reduce_res_223498 = redout_228250;\n                defunc_2_reduce_res_223499 = redout_228251;\n                ((__global double *) color_232045)[phys_tid_223423 + i_229033 *\n                                                   num_threads_232192] =\n                    defunc_2_reduce_res_223498;\n                ((__global double *) color_232044)[phys_tid_223423 + i_229033 *\n                                                   num_threads_232192] =\n                    defunc_2_reduce_res_223499;\n            }\n            for (int64_t i_235845 = 0; i_235845 < t_n_m_203650; i_235845++) {\n                double tmp_235846;\n                \n                tmp_235846 = ((__global\n                               double *) color_232045)[phys_tid_223423 +\n                                                       i_235845 *\n                                                       num_threads_232192];\n                ((__global double *) mem_231138)[gtid_223422 + i_235845 *\n                                                 partition_sizze_203577] =\n                    tmp_235846;\n            }\n            for (int64_t i_235847 = 0; i_235847 < t_n_m_203650; i_235847++) {\n                double tmp_235848;\n                \n                tmp_235848 = ((__global\n                               double *) color_232044)[phys_tid_223423 +\n                                                       i_235847 *\n                                                       num_threads_232192];\n                ((__global double *) mem_231141)[gtid_223422 + i_235847 *\n                                                 partition_sizze_203577] =\n                    tmp_235848;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_223417\n}\n__kernel void mainzisegmap_224073(__global int *global_failure,\n                                  int64_t n_203490,\n                                  int64_t partit",
            "ion_sizze_203577, __global\n                                  unsigned char *mem_229161, __global\n                                  unsigned char *mem_230920, __global\n                                  unsigned char *mem_231146)\n{\n    #define segmap_group_sizze_224068 (mainzisegmap_group_sizze_224042)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235849;\n    int32_t local_tid_235850;\n    int64_t group_sizze_235853;\n    int32_t wave_sizze_235852;\n    int32_t group_tid_235851;\n    \n    global_tid_235849 = get_global_id(0);\n    local_tid_235850 = get_local_id(0);\n    group_sizze_235853 = get_local_size(0);\n    wave_sizze_235852 = LOCKSTEP_WIDTH;\n    group_tid_235851 = get_group_id(0);\n    \n    int32_t phys_tid_224073 = global_tid_235849;\n    int64_t global_tid_235854 = sext_i32_i64(group_tid_235851) *\n            segmap_group_sizze_224068 + sext_i32_i64(local_tid_235850);\n    int64_t slice_235855 = n_203490;\n    int64_t slice_235856 = partition_sizze_203577 * slice_235855;\n    int64_t gtid_224071 = squot64(global_tid_235854, slice_235855);\n    int64_t remnant_235857 = global_tid_235854 - gtid_224071 * slice_235855;\n    int64_t gtid_224072 = remnant_235857;\n    int64_t remnant_235858 = remnant_235857 - gtid_224072;\n    \n    if (slt64(gtid_224071, partition_sizze_203577) && slt64(gtid_224072,\n                                                            n_203490)) {\n        double x_224074;\n        \n        x_224074 = ((__global double *) mem_229161)[gtid_224071 * n_203490 +\n                                                    gtid_224072];\n        \n        double x_224075;\n        \n        x_224075 = ((__global double *) mem_230920)[gtid_224071 * n_203490 +\n                                                    gtid_224072];\n        \n        double defunc_1_f_res_224076 = x_224074 - x_224075;\n        \n        ((__global double *) mem_231146)[gtid_2240",
            "71 * n_203490 + gtid_224072] =\n            defunc_1_f_res_224076;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_224068\n}\n__kernel void mainzisegmap_224090(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203490,\n                                  int64_t partition_sizze_203577,\n                                  int64_t ctx_param_ext_229488,\n                                  int64_t ctx_param_ext_229489,\n                                  int64_t ctx_param_ext_229491, __global\n                                  unsigned char *ext_mem_229197, __global\n                                  unsigned char *mem_param_229493, __global\n                                  unsigned char *mem_231146, __global\n                                  unsigned char *mem_231151, __global\n                                  unsigned char *mem_231155)\n{\n    #define segmap_group_sizze_224084 (mainzisegmap_group_sizze_223986)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235859;\n    int32_t local_tid_235860;\n    int64_t group_sizze_235863;\n    int32_t wave_sizze_235862;\n    int32_t group_tid_235861;\n    \n    global_tid_235859 = get_global_id(0);\n    local_tid_235860 = get_local_id(0);\n    group_sizze_235863 = get_local_size(0);\n    wave_sizze_235862 = LOCKSTEP_WIDTH;\n    group_tid_235861 = get_group_id(0);\n    \n    int32_t phys_tid_224090 = global_tid_235859;\n    int64_t global_tid_235864 = sext_i32_i64(group_tid_235861) *\n            segmap_group_sizze_224084 + sext_i32_i64(local_tid_235860);\n    int64_t slice_235865 = n_203490;\n    int64_t slice_235866 = partition_sizze_203577 * slice_235865;\n    int64_t gtid_224088 = squot64(global_tid_235864, slice_235865);\n    int64_t remnant_235867 = global_tid_23",
            "5864 - gtid_224088 * slice_235865;\n    int64_t gtid_224089 = remnant_235867;\n    int64_t remnant_235868 = remnant_235867 - gtid_224089;\n    \n    if (slt64(gtid_224088, partition_sizze_203577) && slt64(gtid_224089,\n                                                            n_203490)) {\n        int64_t x_224093;\n        \n        x_224093 = ((__global int64_t *) ext_mem_229197)[gtid_224088 *\n                                                         n_203490 +\n                                                         gtid_224089];\n        \n        bool cond_224094 = sle64((int64_t) 0, x_224093);\n        double defunc_0_f_res_224095;\n        \n        if (cond_224094) {\n            bool y_224096 = slt64(x_224093, n_203490);\n            bool bounds_check_224097 = cond_224094 && y_224096;\n            bool index_certs_224098;\n            \n            if (!bounds_check_224097) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 58) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) x_224093;\n                        global_failure_args[1] = (int64_t) n_203490;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            double defunc_0_f_res_t_res_224099;\n            \n            defunc_0_f_res_t_res_224099 = ((__global\n                                            double *) mem_231146)[gtid_224088 *\n                                                                  n_203490 +\n                                                                  x_224093];\n            defunc_0_f_res_224095 = defunc_0_f_res_t_res_224099;\n        } else {\n            defunc_0_f_res_224095 = 0.0;\n        }\n        \n        double defunc_0_f_res_224100;\n        \n        if (cond_224094) {\n            bool y_224101 = slt64(x_224093, n_203490);\n            bool bounds_check_224102 = cond_224094 && y_224101;\n            bool index_certs_224103;\n            \n  ",
            "          if (!bounds_check_224102) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 59) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) x_224093;\n                        global_failure_args[1] = (int64_t) n_203490;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            double defunc_0_f_res_t_res_224104;\n            \n            defunc_0_f_res_t_res_224104 = ((__global\n                                            double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                                        (gtid_224088 *\n                                                                         ctx_param_ext_229489 +\n                                                                         x_224093 *\n                                                                         ctx_param_ext_229491)];\n            defunc_0_f_res_224100 = defunc_0_f_res_t_res_224104;\n        } else {\n            defunc_0_f_res_224100 = 0.0;\n        }\n        ((__global double *) mem_231151)[gtid_224088 * n_203490 + gtid_224089] =\n            defunc_0_f_res_224100;\n        ((__global double *) mem_231155)[gtid_224088 * n_203490 + gtid_224089] =\n            defunc_0_f_res_224095;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_224084\n}\n__kernel void mainzisegmap_224120(__global int *global_failure,\n                                  int64_t n_203490, int64_t q_t_203494,\n                                  int64_t jump_t_203500,\n                                  int64_t partition_sizze_203577,\n                                  int64_t t_n_m_203650, int64_t i_203670,\n                                  __global unsigned char *ext_mem_229196,\n                                  __global unsigned char *ext_mem_229197,\n                                  __global unsigned char *ext_mem_229460,\n            ",
            "                      __global unsigned char *ext_mem_229461,\n                                  __global unsigned char *mem_231151, __global\n                                  unsigned char *mem_231155, __global\n                                  unsigned char *mem_231160, __global\n                                  unsigned char *mem_231164)\n{\n    #define segmap_group_sizze_224109 (mainzisegmap_group_sizze_223544)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235869;\n    int32_t local_tid_235870;\n    int64_t group_sizze_235873;\n    int32_t wave_sizze_235872;\n    int32_t group_tid_235871;\n    \n    global_tid_235869 = get_global_id(0);\n    local_tid_235870 = get_local_id(0);\n    group_sizze_235873 = get_local_size(0);\n    wave_sizze_235872 = LOCKSTEP_WIDTH;\n    group_tid_235871 = get_group_id(0);\n    \n    int32_t phys_tid_224120 = global_tid_235869;\n    int64_t global_tid_235874 = sext_i32_i64(group_tid_235871) *\n            segmap_group_sizze_224109 + sext_i32_i64(local_tid_235870);\n    int64_t slice_235875 = t_n_m_203650;\n    int64_t slice_235876 = partition_sizze_203577 * slice_235875;\n    int64_t gtid_224118 = squot64(global_tid_235874, slice_235875);\n    int64_t remnant_235877 = global_tid_235874 - gtid_224118 * slice_235875;\n    int64_t gtid_224119 = remnant_235877;\n    int64_t remnant_235878 = remnant_235877 - gtid_224119;\n    \n    if (slt64(gtid_224118, partition_sizze_203577) && slt64(gtid_224119,\n                                                            t_n_m_203650)) {\n        int64_t x_224122;\n        \n        x_224122 = ((__global int64_t *) ext_mem_229196)[gtid_224118];\n        \n        int64_t x_224126;\n        \n        x_224126 = ((__global int64_t *) ext_mem_229461)[gtid_224118 *\n                                                         t_n_m_203650 +\n                                                         gtid_224119];\n     ",
            "   \n        double x_224127;\n        \n        x_224127 = ((__global double *) ext_mem_229460)[gtid_224118 *\n                                                        t_n_m_203650 +\n                                                        gtid_224119];\n        \n        int64_t min_arg_224128 = mul64(jump_t_203500, gtid_224119);\n        int64_t min_res_224129 = smin64(i_203670, min_arg_224128);\n        int64_t defunc_0_g_res_224130 = add64((int64_t) 1, min_res_224129);\n        double defunc_2_reduce_res_224131;\n        double defunc_2_reduce_res_224132;\n        double defunc_2_reduce_res_224133;\n        double redout_228257;\n        double redout_228258;\n        double redout_228259;\n        \n        redout_228257 = 0.0;\n        redout_228258 = 0.0;\n        redout_228259 = 0.0;\n        for (int64_t i_228260 = 0; i_228260 < q_t_203494; i_228260++) {\n            bool cond_224144 = sle64(x_224122, i_228260);\n            int64_t defunc_0_f_res_224145;\n            \n            if (cond_224144) {\n                defunc_0_f_res_224145 = (int64_t) 0;\n            } else {\n                int64_t i_224146 = add64(x_224126, i_228260);\n                int64_t defunc_0_add_arg_224147;\n                \n                defunc_0_add_arg_224147 = ((__global\n                                            int64_t *) ext_mem_229197)[gtid_224118 *\n                                                                       n_203490 +\n                                                                       i_224146];\n                \n                int64_t defunc_1_add_res_224148 = add64((int64_t) 1,\n                                                        defunc_0_add_arg_224147);\n                \n                defunc_0_f_res_224145 = defunc_1_add_res_224148;\n            }\n            \n            double defunc_0_f_res_224149;\n            \n            if (cond_224144) {\n                defunc_0_f_res_224149 = 0.0;\n            } else {\n                int64_t i_224150 = add64(x_224126, i_228260);\n    ",
            "            double defunc_0_add_arg_224151;\n                \n                defunc_0_add_arg_224151 = ((__global\n                                            double *) mem_231151)[gtid_224118 *\n                                                                  n_203490 +\n                                                                  i_224150];\n                defunc_0_f_res_224149 = defunc_0_add_arg_224151;\n            }\n            \n            int64_t binop_p_224152 = sub64(defunc_0_f_res_224145,\n                                           defunc_0_g_res_224130);\n            double defunc_0_f_res_224153 = sitofp_i64_f64(binop_p_224152);\n            double abs_res_224154 = fabs(defunc_0_f_res_224153);\n            double tmp1_224155 = abs_res_224154 / x_224127;\n            double x_224156 = tmp1_224155 * tmp1_224155;\n            double y_224157 = tmp1_224155 * x_224156;\n            double tmp2_224158 = 1.0 - y_224157;\n            double x_224159 = tmp2_224158 * tmp2_224158;\n            double tmp3_224160 = tmp2_224158 * x_224159;\n            double w_j_224161 = defunc_0_f_res_224149 * tmp3_224160;\n            double xw_j_224162 = defunc_0_f_res_224153 * w_j_224161;\n            double x2w_j_224163 = defunc_0_f_res_224153 * xw_j_224162;\n            double defunc_1_op_res_224136 = w_j_224161 + redout_228257;\n            double defunc_1_op_res_224139 = xw_j_224162 + redout_228258;\n            double defunc_1_op_res_224142 = x2w_j_224163 + redout_228259;\n            double redout_tmp_235879 = defunc_1_op_res_224136;\n            double redout_tmp_235880 = defunc_1_op_res_224139;\n            double redout_tmp_235881 = defunc_1_op_res_224142;\n            \n            redout_228257 = redout_tmp_235879;\n            redout_228258 = redout_tmp_235880;\n            redout_228259 = redout_tmp_235881;\n        }\n        defunc_2_reduce_res_224131 = redout_228257;\n        defunc_2_reduce_res_224132 = redout_228258;\n        defunc_2_reduce_res_224133 = redout_228259;\n        \n       ",
            " double x_224164 = defunc_2_reduce_res_224131 *\n               defunc_2_reduce_res_224133;\n        double y_224165 = defunc_2_reduce_res_224132 *\n               defunc_2_reduce_res_224132;\n        double y_224166 = x_224164 - y_224165;\n        double det1_224167 = 1.0 / y_224166;\n        double a11_224168 = defunc_2_reduce_res_224133 * det1_224167;\n        double x_224169 = 0.0 - defunc_2_reduce_res_224132;\n        double b11_224170 = det1_224167 * x_224169;\n        double c11_224171 = defunc_2_reduce_res_224131 * det1_224167;\n        double defunc_2_reduce_res_224172;\n        double defunc_2_reduce_res_224173;\n        double redout_228261;\n        double redout_228262;\n        \n        redout_228261 = 0.0;\n        redout_228262 = 0.0;\n        for (int64_t i_228263 = 0; i_228263 < q_t_203494; i_228263++) {\n            bool cond_224181 = sle64(x_224122, i_228263);\n            int64_t defunc_0_f_res_224182;\n            \n            if (cond_224181) {\n                defunc_0_f_res_224182 = (int64_t) 0;\n            } else {\n                int64_t i_224183 = add64(x_224126, i_228263);\n                int64_t defunc_0_add_arg_224184;\n                \n                defunc_0_add_arg_224184 = ((__global\n                                            int64_t *) ext_mem_229197)[gtid_224118 *\n                                                                       n_203490 +\n                                                                       i_224183];\n                \n                int64_t defunc_1_add_res_224185 = add64((int64_t) 1,\n                                                        defunc_0_add_arg_224184);\n                \n                defunc_0_f_res_224182 = defunc_1_add_res_224185;\n            }\n            \n            double defunc_0_f_res_224186;\n            \n            if (cond_224181) {\n                defunc_0_f_res_224186 = 0.0;\n            } else {\n                int64_t i_224187 = add64(x_224126, i_228263);\n                double defunc_0_add_arg_22",
            "4188;\n                \n                defunc_0_add_arg_224188 = ((__global\n                                            double *) mem_231151)[gtid_224118 *\n                                                                  n_203490 +\n                                                                  i_224187];\n                defunc_0_f_res_224186 = defunc_0_add_arg_224188;\n            }\n            \n            int64_t binop_p_224189 = sub64(defunc_0_f_res_224182,\n                                           defunc_0_g_res_224130);\n            double defunc_0_f_res_224190 = sitofp_i64_f64(binop_p_224189);\n            double abs_res_224191 = fabs(defunc_0_f_res_224190);\n            double tmp1_224192 = abs_res_224191 / x_224127;\n            double x_224193 = tmp1_224192 * tmp1_224192;\n            double y_224194 = tmp1_224192 * x_224193;\n            double tmp2_224195 = 1.0 - y_224194;\n            double x_224196 = tmp2_224195 * tmp2_224195;\n            double tmp3_224197 = tmp2_224195 * x_224196;\n            double tmp4_224198 = defunc_0_f_res_224186 * tmp3_224197;\n            double defunc_1_f_res_224199 = defunc_0_f_res_224190 * tmp4_224198;\n            double defunc_0_f_res_224200;\n            \n            if (cond_224181) {\n                defunc_0_f_res_224200 = 0.0;\n            } else {\n                int64_t i_224201 = add64(x_224126, i_228263);\n                double defunc_0_add_arg_224202;\n                \n                defunc_0_add_arg_224202 = ((__global\n                                            double *) mem_231155)[gtid_224118 *\n                                                                  n_203490 +\n                                                                  i_224201];\n                defunc_0_f_res_224200 = defunc_0_add_arg_224202;\n            }\n            \n            double x_224203 = a11_224168 * tmp4_224198;\n            double y_224204 = b11_224170 * defunc_1_f_res_224199;\n            double x_224205 = x_224203 + y_224204;\n          ",
            "  double defunc_9_fit_fun_res_224206 = defunc_0_f_res_224200 *\n                   x_224205;\n            double x_224207 = b11_224170 * tmp4_224198;\n            double y_224208 = c11_224171 * defunc_1_f_res_224199;\n            double x_224209 = x_224207 + y_224208;\n            double defunc_9_slope_fun_res_224210 = defunc_0_f_res_224200 *\n                   x_224209;\n            double defunc_1_op_res_224176 = defunc_9_fit_fun_res_224206 +\n                   redout_228261;\n            double defunc_1_op_res_224179 = defunc_9_slope_fun_res_224210 +\n                   redout_228262;\n            double redout_tmp_235882 = defunc_1_op_res_224176;\n            double redout_tmp_235883 = defunc_1_op_res_224179;\n            \n            redout_228261 = redout_tmp_235882;\n            redout_228262 = redout_tmp_235883;\n        }\n        defunc_2_reduce_res_224172 = redout_228261;\n        defunc_2_reduce_res_224173 = redout_228262;\n        ((__global double *) mem_231160)[gtid_224118 * t_n_m_203650 +\n                                         gtid_224119] =\n            defunc_2_reduce_res_224172;\n        ((__global double *) mem_231164)[gtid_224118 * t_n_m_203650 +\n                                         gtid_224119] =\n            defunc_2_reduce_res_224173;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_224109\n}\n__kernel void mainzisegmap_224284(__global int *global_failure,\n                                  int64_t partition_sizze_203577,\n                                  int64_t t_n_m_203650, __global\n                                  unsigned char *mem_231169, __global\n                                  unsigned char *mem_231173, __global\n                                  unsigned char *mem_231177, __global\n                                  unsigned char *mem_231182, __global\n                                  unsigned char *mem_231186, __global\n                                  unsigned char *mem_231190)\n{\n    #define segmap_group_sizze_224277 (mainzisegmap_g",
            "roup_sizze_223733)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235984;\n    int32_t local_tid_235985;\n    int64_t group_sizze_235988;\n    int32_t wave_sizze_235987;\n    int32_t group_tid_235986;\n    \n    global_tid_235984 = get_global_id(0);\n    local_tid_235985 = get_local_id(0);\n    group_sizze_235988 = get_local_size(0);\n    wave_sizze_235987 = LOCKSTEP_WIDTH;\n    group_tid_235986 = get_group_id(0);\n    \n    int32_t phys_tid_224284 = global_tid_235984;\n    int64_t global_tid_235989 = sext_i32_i64(group_tid_235986) *\n            segmap_group_sizze_224277 + sext_i32_i64(local_tid_235985);\n    int64_t slice_235990 = t_n_m_203650;\n    int64_t slice_235991 = partition_sizze_203577 * slice_235990;\n    int64_t gtid_224282 = squot64(global_tid_235989, slice_235990);\n    int64_t remnant_235992 = global_tid_235989 - gtid_224282 * slice_235990;\n    int64_t gtid_224283 = remnant_235992;\n    int64_t remnant_235993 = remnant_235992 - gtid_224283;\n    \n    if (slt64(gtid_224282, partition_sizze_203577) && slt64(gtid_224283,\n                                                            t_n_m_203650)) {\n        double defunc_2_reduce_res_224285;\n        \n        defunc_2_reduce_res_224285 = ((__global\n                                       double *) mem_231169)[gtid_224282 *\n                                                             t_n_m_203650 +\n                                                             gtid_224283];\n        \n        double defunc_2_reduce_res_224286;\n        \n        defunc_2_reduce_res_224286 = ((__global\n                                       double *) mem_231173)[gtid_224282 *\n                                                             t_n_m_203650 +\n                                                             gtid_224283];\n        \n        double defunc_2_reduce_res_224287;\n        \n        defunc_2_reduce_res_224287 = ((__glo",
            "bal\n                                       double *) mem_231177)[gtid_224282 *\n                                                             t_n_m_203650 +\n                                                             gtid_224283];\n        \n        double x_224288 = defunc_2_reduce_res_224285 *\n               defunc_2_reduce_res_224287;\n        double y_224289 = defunc_2_reduce_res_224286 *\n               defunc_2_reduce_res_224286;\n        double y_224290 = x_224288 - y_224289;\n        double det1_224291 = 1.0 / y_224290;\n        double a11_224292 = defunc_2_reduce_res_224287 * det1_224291;\n        double x_224293 = 0.0 - defunc_2_reduce_res_224286;\n        double b11_224294 = det1_224291 * x_224293;\n        double c11_224295 = defunc_2_reduce_res_224285 * det1_224291;\n        \n        ((__global double *) mem_231182)[gtid_224282 * t_n_m_203650 +\n                                         gtid_224283] = a11_224292;\n        ((__global double *) mem_231186)[gtid_224282 * t_n_m_203650 +\n                                         gtid_224283] = b11_224294;\n        ((__global double *) mem_231190)[gtid_224282 * t_n_m_203650 +\n                                         gtid_224283] = c11_224295;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_224277\n}\n__kernel void mainzisegmap_224529(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203490, int64_t q_t_203494,\n                                  int64_t jump_t_203500,\n                                  int64_t partition_sizze_203577,\n                                  int64_t t_n_m_203650, int64_t i_203670,\n                                  int64_t num_groups_224524,\n                                  int64_t num_threads_232203, __global\n                                  unsigned char *mem_229161, __global\n                                  unsigned char *ext_mem_",
            "229196, __global\n                                  unsigned char *mem_231216, __global\n                                  unsigned char *mem_231219, __global\n                                  unsigned char *mem_231222, __global\n                                  unsigned char *mem_231225, __global\n                                  unsigned char *mem_231228, __global\n                                  unsigned char *mem_231307, __global\n                                  unsigned char *mem_231310, __global\n                                  unsigned char *color_232049, __global\n                                  unsigned char *color_232050, __global\n                                  unsigned char *color_232051, __global\n                                  unsigned char *color_232052)\n{\n    #define segmap_group_sizze_224523 (mainzisegmap_group_sizze_224370)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile __local bool local_failure;\n    \n    if (failure_is_an_option) {\n        int failed = *global_failure >= 0;\n        \n        if (failed)\n            return;\n    }\n    local_failure = false;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t global_tid_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_224529 = global_tid_236097;\n    int32_t phys_group_id_236102;\n    \n    phys_group_id_236102 = get_group_id(0);\n    for (int32_t i_236103 = 0; i_236103 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577,\n                                          segmap_group_sizze_224523)) -\n                   phys_group_id_236102, sext_i64_i32(num_groups_224524));\n         i_236103++) {\n        int32_t virt_gr",
            "oup_id_236104 = phys_group_id_236102 + i_236103 *\n                sext_i64_i32(num_groups_224524);\n        int64_t global_tid_236105 = sext_i32_i64(virt_group_id_236104) *\n                segmap_group_sizze_224523 + sext_i32_i64(local_tid_236098);\n        int64_t slice_236106 = partition_sizze_203577;\n        int64_t gtid_224528 = global_tid_236105;\n        int64_t remnant_236107 = global_tid_236105 - gtid_224528;\n        \n        if (slt64(gtid_224528, partition_sizze_203577)) {\n            int64_t x_224534;\n            \n            x_224534 = ((__global int64_t *) ext_mem_229196)[gtid_224528];\n            for (int64_t i_229038 = 0; i_229038 < n_203490; i_229038++) {\n                double x_224538;\n                \n                x_224538 = ((__global double *) mem_229161)[gtid_224528 *\n                                                            n_203490 +\n                                                            i_229038];\n                \n                double x_224539;\n                \n                x_224539 = ((__global double *) mem_231216)[i_229038 *\n                                                            partition_sizze_203577 +\n                                                            gtid_224528];\n                \n                double defunc_1_f_res_224540 = x_224538 - x_224539;\n                \n                ((__global double *) color_232049)[phys_tid_224529 + i_229038 *\n                                                   num_threads_232203] =\n                    defunc_1_f_res_224540;\n            }\n            for (int64_t i_229044 = 0; i_229044 < n_203490; i_229044++) {\n                int64_t x_224543;\n                \n                x_224543 = ((__global int64_t *) mem_231219)[i_229044 *\n                                                             partition_sizze_203577 +\n                                                             gtid_224528];\n                \n                bool cond_224544 = sle64((int64_t) 0, x_224543);\n        ",
            "        double defunc_0_f_res_224545;\n                \n                if (cond_224544) {\n                    bool y_224546 = slt64(x_224543, n_203490);\n                    bool bounds_check_224547 = cond_224544 && y_224546;\n                    bool index_certs_224548;\n                    \n                    if (!bounds_check_224547) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          60) == -1) {\n                                global_failure_args[0] = (int64_t) x_224543;\n                                global_failure_args[1] = (int64_t) n_203490;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    double defunc_0_f_res_t_res_224549;\n                    \n                    defunc_0_f_res_t_res_224549 = ((__global\n                                                    double *) color_232049)[phys_tid_224529 +\n                                                                            x_224543 *\n                                                                            num_threads_232203];\n                    defunc_0_f_res_224545 = defunc_0_f_res_t_res_224549;\n                } else {\n                    defunc_0_f_res_224545 = 0.0;\n                }\n                \n                double defunc_0_f_res_224550;\n                \n                if (cond_224544) {\n                    bool y_224551 = slt64(x_224543, n_203490);\n                    bool bounds_check_224552 = cond_224544 && y_224551;\n                    bool index_certs_224553;\n                    \n                    if (!bounds_check_224552) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          ",
            "61) == -1) {\n                                global_failure_args[0] = (int64_t) x_224543;\n                                global_failure_args[1] = (int64_t) n_203490;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    double defunc_0_f_res_t_res_224554;\n                    \n                    defunc_0_f_res_t_res_224554 = ((__global\n                                                    double *) mem_231228)[x_224543 *\n                                                                          partition_sizze_203577 +\n                                                                          gtid_224528];\n                    defunc_0_f_res_224550 = defunc_0_f_res_t_res_224554;\n                } else {\n                    defunc_0_f_res_224550 = 0.0;\n                }\n                ((__global double *) color_232052)[phys_tid_224529 + i_229044 *\n                                                   num_threads_232203] =\n                    defunc_0_f_res_224550;\n                ((__global double *) color_232051)[phys_tid_224529 + i_229044 *\n                                                   num_threads_232203] =\n                    defunc_0_f_res_224545;\n            }\n            for (int64_t i_229051 = 0; i_229051 < t_n_m_203650; i_229051++) {\n                int64_t x_224558;\n                \n                x_224558 = ((__global int64_t *) mem_231222)[i_229051 *\n                                                             partition_sizze_203577 +\n                                                             gtid_224528];\n                \n                double x_224559;\n                \n                x_224559 = ((__global double *) mem_231225)[i_229051 *\n                                                            partition_sizze_203577 +\n                                          ",
            "                  gtid_224528];\n                \n                int64_t min_arg_224560 = mul64(jump_t_203500, i_229051);\n                int64_t min_res_224561 = smin64(i_203670, min_arg_224560);\n                int64_t defunc_0_g_res_224562 = add64((int64_t) 1,\n                                                      min_res_224561);\n                double defunc_2_reduce_res_224563;\n                double defunc_2_reduce_res_224564;\n                double defunc_2_reduce_res_224565;\n                double defunc_2_reduce_res_224566;\n                double defunc_2_reduce_res_224567;\n                double redout_228276;\n                double redout_228277;\n                double redout_228278;\n                double redout_228279;\n                double redout_228280;\n                \n                redout_228276 = 0.0;\n                redout_228277 = 0.0;\n                redout_228278 = 0.0;\n                redout_228279 = 0.0;\n                redout_228280 = 0.0;\n                for (int64_t i_228281 = 0; i_228281 < q_t_203494; i_228281++) {\n                    bool cond_224584 = sle64(x_224534, i_228281);\n                    int64_t defunc_0_f_res_224585;\n                    \n                    if (cond_224584) {\n                        defunc_0_f_res_224585 = (int64_t) 0;\n                    } else {\n                        int64_t i_224586 = add64(x_224558, i_228281);\n                        int64_t defunc_0_add_arg_224587;\n                        \n                        defunc_0_add_arg_224587 = ((__global\n                                                    int64_t *) mem_231219)[i_224586 *\n                                                                           partition_sizze_203577 +\n                                                                           gtid_224528];\n                        \n                        int64_t defunc_1_add_res_224588 = add64((int64_t) 1,\n                                                                defunc_0_add_arg_",
            "224587);\n                        \n                        defunc_0_f_res_224585 = defunc_1_add_res_224588;\n                    }\n                    \n                    double defunc_0_f_res_224589;\n                    \n                    if (cond_224584) {\n                        defunc_0_f_res_224589 = 0.0;\n                    } else {\n                        int64_t i_224590 = add64(x_224558, i_228281);\n                        double defunc_0_add_arg_224591;\n                        \n                        defunc_0_add_arg_224591 = ((__global\n                                                    double *) color_232052)[phys_tid_224529 +\n                                                                            i_224590 *\n                                                                            num_threads_232203];\n                        defunc_0_f_res_224589 = defunc_0_add_arg_224591;\n                    }\n                    \n                    int64_t binop_p_224592 = sub64(defunc_0_f_res_224585,\n                                                   defunc_0_g_res_224562);\n                    double defunc_0_f_res_224593 =\n                           sitofp_i64_f64(binop_p_224592);\n                    double abs_res_224594 = fabs(defunc_0_f_res_224593);\n                    double tmp1_224595 = abs_res_224594 / x_224559;\n                    double x_224596 = tmp1_224595 * tmp1_224595;\n                    double y_224597 = tmp1_224595 * x_224596;\n                    double tmp2_224598 = 1.0 - y_224597;\n                    double x_224599 = tmp2_224598 * tmp2_224598;\n                    double tmp3_224600 = tmp2_224598 * x_224599;\n                    double w_j_224601 = defunc_0_f_res_224589 * tmp3_224600;\n                    double xw_j_224602 = defunc_0_f_res_224593 * w_j_224601;\n                    double x2w_j_224603 = defunc_0_f_res_224593 * xw_j_224602;\n                    double x3w_j_224604 = defunc_0_f_res_224593 * x2w_j_224603;\n                    doubl",
            "e x4w_j_224605 = defunc_0_f_res_224593 * x3w_j_224604;\n                    double defunc_1_op_res_224570 = w_j_224601 + redout_228276;\n                    double defunc_1_op_res_224573 = xw_j_224602 + redout_228277;\n                    double defunc_1_op_res_224576 = x2w_j_224603 +\n                           redout_228278;\n                    double defunc_1_op_res_224579 = x3w_j_224604 +\n                           redout_228279;\n                    double defunc_1_op_res_224582 = x4w_j_224605 +\n                           redout_228280;\n                    double redout_tmp_236113 = defunc_1_op_res_224570;\n                    double redout_tmp_236114 = defunc_1_op_res_224573;\n                    double redout_tmp_236115 = defunc_1_op_res_224576;\n                    double redout_tmp_236116 = defunc_1_op_res_224579;\n                    double redout_tmp_236117 = defunc_1_op_res_224582;\n                    \n                    redout_228276 = redout_tmp_236113;\n                    redout_228277 = redout_tmp_236114;\n                    redout_228278 = redout_tmp_236115;\n                    redout_228279 = redout_tmp_236116;\n                    redout_228280 = redout_tmp_236117;\n                }\n                defunc_2_reduce_res_224563 = redout_228276;\n                defunc_2_reduce_res_224564 = redout_228277;\n                defunc_2_reduce_res_224565 = redout_228278;\n                defunc_2_reduce_res_224566 = redout_228279;\n                defunc_2_reduce_res_224567 = redout_228280;\n                \n                double x_224606 = defunc_2_reduce_res_224565 *\n                       defunc_2_reduce_res_224567;\n                double y_224607 = defunc_2_reduce_res_224566 *\n                       defunc_2_reduce_res_224566;\n                double a12_224608 = x_224606 - y_224607;\n                double x_224609 = defunc_2_reduce_res_224565 *\n                       defunc_2_reduce_res_224566;\n                double y_224610 = defunc_2_reduce_res_224564 *\n         ",
            "              defunc_2_reduce_res_224567;\n                double b12_224611 = x_224609 - y_224610;\n                double x_224612 = defunc_2_reduce_res_224564 *\n                       defunc_2_reduce_res_224566;\n                double y_224613 = defunc_2_reduce_res_224565 *\n                       defunc_2_reduce_res_224565;\n                double c12_224614 = x_224612 - y_224613;\n                double x_224615 = defunc_2_reduce_res_224563 *\n                       defunc_2_reduce_res_224567;\n                double b2_224616 = x_224615 - y_224613;\n                double x_224617 = defunc_2_reduce_res_224564 *\n                       defunc_2_reduce_res_224565;\n                double y_224618 = defunc_2_reduce_res_224563 *\n                       defunc_2_reduce_res_224566;\n                double c2_224619 = x_224617 - y_224618;\n                double x_224620 = defunc_2_reduce_res_224563 * a12_224608;\n                double y_224621 = defunc_2_reduce_res_224564 * b12_224611;\n                double x_224622 = x_224620 + y_224621;\n                double y_224623 = defunc_2_reduce_res_224565 * c12_224614;\n                double y_224624 = x_224622 + y_224623;\n                double det_224625 = 1.0 / y_224624;\n                double a12_224626 = a12_224608 * det_224625;\n                double b12_224627 = b12_224611 * det_224625;\n                double c12_224628 = c12_224614 * det_224625;\n                double b2_224629 = b2_224616 * det_224625;\n                double c2_224630 = c2_224619 * det_224625;\n                double defunc_2_reduce_res_224631;\n                double defunc_2_reduce_res_224632;\n                double redout_228282;\n                double redout_228283;\n                \n                redout_228282 = 0.0;\n                redout_228283 = 0.0;\n                for (int64_t i_228284 = 0; i_228284 < q_t_203494; i_228284++) {\n                    bool cond_224640 = sle64(x_224534, i_228284);\n                    int64_t defunc_0_f_res_224641;\n        ",
            "            \n                    if (cond_224640) {\n                        defunc_0_f_res_224641 = (int64_t) 0;\n                    } else {\n                        int64_t i_224642 = add64(x_224558, i_228284);\n                        int64_t defunc_0_add_arg_224643;\n                        \n                        defunc_0_add_arg_224643 = ((__global\n                                                    int64_t *) mem_231219)[i_224642 *\n                                                                           partition_sizze_203577 +\n                                                                           gtid_224528];\n                        \n                        int64_t defunc_1_add_res_224644 = add64((int64_t) 1,\n                                                                defunc_0_add_arg_224643);\n                        \n                        defunc_0_f_res_224641 = defunc_1_add_res_224644;\n                    }\n                    \n                    double defunc_0_f_res_224645;\n                    \n                    if (cond_224640) {\n                        defunc_0_f_res_224645 = 0.0;\n                    } else {\n                        int64_t i_224646 = add64(x_224558, i_228284);\n                        double defunc_0_add_arg_224647;\n                        \n                        defunc_0_add_arg_224647 = ((__global\n                                                    double *) color_232052)[phys_tid_224529 +\n                                                                            i_224646 *\n                                                                            num_threads_232203];\n                        defunc_0_f_res_224645 = defunc_0_add_arg_224647;\n                    }\n                    \n                    int64_t binop_p_224648 = sub64(defunc_0_f_res_224641,\n                                                   defunc_0_g_res_224562);\n                    double defunc_0_f_res_224649 =\n                           sitofp_i64_f",
            "64(binop_p_224648);\n                    double abs_res_224650 = fabs(defunc_0_f_res_224649);\n                    double tmp1_224651 = abs_res_224650 / x_224559;\n                    double x_224652 = tmp1_224651 * tmp1_224651;\n                    double y_224653 = tmp1_224651 * x_224652;\n                    double tmp2_224654 = 1.0 - y_224653;\n                    double x_224655 = tmp2_224654 * tmp2_224654;\n                    double tmp3_224656 = tmp2_224654 * x_224655;\n                    double tmp4_224657 = defunc_0_f_res_224645 * tmp3_224656;\n                    double defunc_1_f_res_224658 = defunc_0_f_res_224649 *\n                           tmp4_224657;\n                    double defunc_1_f_res_224659 = defunc_0_f_res_224649 *\n                           defunc_1_f_res_224658;\n                    double defunc_0_f_res_224660;\n                    \n                    if (cond_224640) {\n                        defunc_0_f_res_224660 = 0.0;\n                    } else {\n                        int64_t i_224661 = add64(x_224558, i_228284);\n                        double defunc_0_add_arg_224662;\n                        \n                        defunc_0_add_arg_224662 = ((__global\n                                                    double *) color_232051)[phys_tid_224529 +\n                                                                            i_224661 *\n                                                                            num_threads_232203];\n                        defunc_0_f_res_224660 = defunc_0_add_arg_224662;\n                    }\n                    \n                    double x_224663 = a12_224626 * tmp4_224657;\n                    double y_224664 = b12_224627 * defunc_1_f_res_224658;\n                    double x_224665 = x_224663 + y_224664;\n                    double y_224666 = c12_224628 * defunc_1_f_res_224659;\n                    double x_224667 = x_224665 + y_224666;\n                    double defunc_9_fit_fun_res_224668 = defunc_0_f_res_224660 ",
            "*\n                           x_224667;\n                    double x_224669 = b12_224627 * tmp4_224657;\n                    double y_224670 = b2_224629 * defunc_1_f_res_224658;\n                    double x_224671 = x_224669 + y_224670;\n                    double y_224672 = c2_224630 * defunc_1_f_res_224659;\n                    double x_224673 = x_224671 + y_224672;\n                    double defunc_9_slope_fun_res_224674 =\n                           defunc_0_f_res_224660 * x_224673;\n                    double defunc_1_op_res_224635 =\n                           defunc_9_fit_fun_res_224668 + redout_228282;\n                    double defunc_1_op_res_224638 =\n                           defunc_9_slope_fun_res_224674 + redout_228283;\n                    double redout_tmp_236118 = defunc_1_op_res_224635;\n                    double redout_tmp_236119 = defunc_1_op_res_224638;\n                    \n                    redout_228282 = redout_tmp_236118;\n                    redout_228283 = redout_tmp_236119;\n                }\n                defunc_2_reduce_res_224631 = redout_228282;\n                defunc_2_reduce_res_224632 = redout_228283;\n                ((__global double *) color_232050)[phys_tid_224529 + i_229051 *\n                                                   num_threads_232203] =\n                    defunc_2_reduce_res_224631;\n                ((__global double *) color_232049)[phys_tid_224529 + i_229051 *\n                                                   num_threads_232203] =\n                    defunc_2_reduce_res_224632;\n            }\n            for (int64_t i_236120 = 0; i_236120 < t_n_m_203650; i_236120++) {\n                double tmp_236121;\n                \n                tmp_236121 = ((__global\n                               double *) color_232050)[phys_tid_224529 +\n                                                       i_236120 *\n                                                       num_threads_232203];\n                ((__global double *) mem_231307)[gt",
            "id_224528 + i_236120 *\n                                                 partition_sizze_203577] =\n                    tmp_236121;\n            }\n            for (int64_t i_236122 = 0; i_236122 < t_n_m_203650; i_236122++) {\n                double tmp_236123;\n                \n                tmp_236123 = ((__global\n                               double *) color_232049)[phys_tid_224529 +\n                                                       i_236122 *\n                                                       num_threads_232203];\n                ((__global double *) mem_231310)[gtid_224528 + i_236122 *\n                                                 partition_sizze_203577] =\n                    tmp_236123;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_224523\n}\n__kernel void mainzisegmap_225327(__global int *global_failure,\n                                  int64_t n_203490,\n                                  int64_t partition_sizze_203577, __global\n                                  unsigned char *mem_229161, __global\n                                  unsigned char *mem_230920, __global\n                                  unsigned char *mem_231315)\n{\n    #define segmap_group_sizze_225322 (mainzisegmap_group_sizze_225296)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236124;\n    int32_t local_tid_236125;\n    int64_t group_sizze_236128;\n    int32_t wave_sizze_236127;\n    int32_t group_tid_236126;\n    \n    global_tid_236124 = get_global_id(0);\n    local_tid_236125 = get_local_id(0);\n    group_sizze_236128 = get_local_size(0);\n    wave_sizze_236127 = LOCKSTEP_WIDTH;\n    group_tid_236126 = get_group_id(0);\n    \n    int32_t phys_tid_225327 = global_tid_236124;\n    int64_t global_tid_236129 = sext_i32_i64(group_tid_236126) *\n            segmap_group_sizze_",
            "225322 + sext_i32_i64(local_tid_236125);\n    int64_t slice_236130 = n_203490;\n    int64_t slice_236131 = partition_sizze_203577 * slice_236130;\n    int64_t gtid_225325 = squot64(global_tid_236129, slice_236130);\n    int64_t remnant_236132 = global_tid_236129 - gtid_225325 * slice_236130;\n    int64_t gtid_225326 = remnant_236132;\n    int64_t remnant_236133 = remnant_236132 - gtid_225326;\n    \n    if (slt64(gtid_225325, partition_sizze_203577) && slt64(gtid_225326,\n                                                            n_203490)) {\n        double x_225328;\n        \n        x_225328 = ((__global double *) mem_229161)[gtid_225325 * n_203490 +\n                                                    gtid_225326];\n        \n        double x_225329;\n        \n        x_225329 = ((__global double *) mem_230920)[gtid_225325 * n_203490 +\n                                                    gtid_225326];\n        \n        double defunc_1_f_res_225330 = x_225328 - x_225329;\n        \n        ((__global double *) mem_231315)[gtid_225325 * n_203490 + gtid_225326] =\n            defunc_1_f_res_225330;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_225322\n}\n__kernel void mainzisegmap_225344(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203490,\n                                  int64_t partition_sizze_203577,\n                                  int64_t ctx_param_ext_229488,\n                                  int64_t ctx_param_ext_229489,\n                                  int64_t ctx_param_ext_229491, __global\n                                  unsigned char *ext_mem_229197, __global\n                                  unsigned char *mem_param_229493, __global\n                                  unsigned char *mem_231315, __global\n                                  unsigned char *mem_231320, __global\n                       ",
            "           unsigned char *mem_231324)\n{\n    #define segmap_group_sizze_225338 (mainzisegmap_group_sizze_225240)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236134;\n    int32_t local_tid_236135;\n    int64_t group_sizze_236138;\n    int32_t wave_sizze_236137;\n    int32_t group_tid_236136;\n    \n    global_tid_236134 = get_global_id(0);\n    local_tid_236135 = get_local_id(0);\n    group_sizze_236138 = get_local_size(0);\n    wave_sizze_236137 = LOCKSTEP_WIDTH;\n    group_tid_236136 = get_group_id(0);\n    \n    int32_t phys_tid_225344 = global_tid_236134;\n    int64_t global_tid_236139 = sext_i32_i64(group_tid_236136) *\n            segmap_group_sizze_225338 + sext_i32_i64(local_tid_236135);\n    int64_t slice_236140 = n_203490;\n    int64_t slice_236141 = partition_sizze_203577 * slice_236140;\n    int64_t gtid_225342 = squot64(global_tid_236139, slice_236140);\n    int64_t remnant_236142 = global_tid_236139 - gtid_225342 * slice_236140;\n    int64_t gtid_225343 = remnant_236142;\n    int64_t remnant_236143 = remnant_236142 - gtid_225343;\n    \n    if (slt64(gtid_225342, partition_sizze_203577) && slt64(gtid_225343,\n                                                            n_203490)) {\n        int64_t x_225347;\n        \n        x_225347 = ((__global int64_t *) ext_mem_229197)[gtid_225342 *\n                                                         n_203490 +\n                                                         gtid_225343];\n        \n        bool cond_225348 = sle64((int64_t) 0, x_225347);\n        double defunc_0_f_res_225349;\n        \n        if (cond_225348) {\n            bool y_225350 = slt64(x_225347, n_203490);\n            bool bounds_check_225351 = cond_225348 && y_225350;\n            bool index_certs_225352;\n            \n            if (!bounds_check_225351) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1,",
            " 62) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) x_225347;\n                        global_failure_args[1] = (int64_t) n_203490;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            double defunc_0_f_res_t_res_225353;\n            \n            defunc_0_f_res_t_res_225353 = ((__global\n                                            double *) mem_231315)[gtid_225342 *\n                                                                  n_203490 +\n                                                                  x_225347];\n            defunc_0_f_res_225349 = defunc_0_f_res_t_res_225353;\n        } else {\n            defunc_0_f_res_225349 = 0.0;\n        }\n        \n        double defunc_0_f_res_225354;\n        \n        if (cond_225348) {\n            bool y_225355 = slt64(x_225347, n_203490);\n            bool bounds_check_225356 = cond_225348 && y_225355;\n            bool index_certs_225357;\n            \n            if (!bounds_check_225356) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 63) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) x_225347;\n                        global_failure_args[1] = (int64_t) n_203490;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            double defunc_0_f_res_t_res_225358;\n            \n            defunc_0_f_res_t_res_225358 = ((__global\n                                            double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                                        (gtid_225342 *\n                                                                         ctx_param_ext_229489 +\n                                                                         x_225347 *\n                                                                      ",
            "   ctx_param_ext_229491)];\n            defunc_0_f_res_225354 = defunc_0_f_res_t_res_225358;\n        } else {\n            defunc_0_f_res_225354 = 0.0;\n        }\n        ((__global double *) mem_231320)[gtid_225342 * n_203490 + gtid_225343] =\n            defunc_0_f_res_225354;\n        ((__global double *) mem_231324)[gtid_225342 * n_203490 + gtid_225343] =\n            defunc_0_f_res_225349;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_225338\n}\n__kernel void mainzisegmap_225374(__global int *global_failure,\n                                  int64_t n_203490, int64_t q_t_203494,\n                                  int64_t jump_t_203500,\n                                  int64_t partition_sizze_203577,\n                                  int64_t t_n_m_203650, int64_t i_203670,\n                                  __global unsigned char *ext_mem_229196,\n                                  __global unsigned char *ext_mem_229197,\n                                  __global unsigned char *ext_mem_229460,\n                                  __global unsigned char *ext_mem_229461,\n                                  __global unsigned char *mem_231320, __global\n                                  unsigned char *mem_231324, __global\n                                  unsigned char *mem_231329, __global\n                                  unsigned char *mem_231333)\n{\n    #define segmap_group_sizze_225363 (mainzisegmap_group_sizze_224682)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236144;\n    int32_t local_tid_236145;\n    int64_t group_sizze_236148;\n    int32_t wave_sizze_236147;\n    int32_t group_tid_236146;\n    \n    global_tid_236144 = get_global_id(0);\n    local_tid_236145 = get_local_id(0);\n    group_sizze_236148 = get_local_size(0);\n    wave_sizze_236147 = LOCKSTEP_WIDTH;\n    group_tid_236146 = get_group_id(0);\n    \n    int32_t phys_tid_225374 = g",
            "lobal_tid_236144;\n    int64_t global_tid_236149 = sext_i32_i64(group_tid_236146) *\n            segmap_group_sizze_225363 + sext_i32_i64(local_tid_236145);\n    int64_t slice_236150 = t_n_m_203650;\n    int64_t slice_236151 = partition_sizze_203577 * slice_236150;\n    int64_t gtid_225372 = squot64(global_tid_236149, slice_236150);\n    int64_t remnant_236152 = global_tid_236149 - gtid_225372 * slice_236150;\n    int64_t gtid_225373 = remnant_236152;\n    int64_t remnant_236153 = remnant_236152 - gtid_225373;\n    \n    if (slt64(gtid_225372, partition_sizze_203577) && slt64(gtid_225373,\n                                                            t_n_m_203650)) {\n        int64_t x_225376;\n        \n        x_225376 = ((__global int64_t *) ext_mem_229196)[gtid_225372];\n        \n        int64_t x_225380;\n        \n        x_225380 = ((__global int64_t *) ext_mem_229461)[gtid_225372 *\n                                                         t_n_m_203650 +\n                                                         gtid_225373];\n        \n        double x_225381;\n        \n        x_225381 = ((__global double *) ext_mem_229460)[gtid_225372 *\n                                                        t_n_m_203650 +\n                                                        gtid_225373];\n        \n        int64_t min_arg_225382 = mul64(jump_t_203500, gtid_225373);\n        int64_t min_res_225383 = smin64(i_203670, min_arg_225382);\n        int64_t defunc_0_g_res_225384 = add64((int64_t) 1, min_res_225383);\n        double defunc_2_reduce_res_225385;\n        double defunc_2_reduce_res_225386;\n        double defunc_2_reduce_res_225387;\n        double defunc_2_reduce_res_225388;\n        double defunc_2_reduce_res_225389;\n        double redout_228289;\n        double redout_228290;\n        double redout_228291;\n        double redout_228292;\n        double redout_228293;\n        \n        redout_228289 = 0.0;\n        redout_228290 = 0.0;\n        redout_228291 = 0.0;\n        redout_228292 = 0.0;\n        r",
            "edout_228293 = 0.0;\n        for (int64_t i_228294 = 0; i_228294 < q_t_203494; i_228294++) {\n            bool cond_225406 = sle64(x_225376, i_228294);\n            int64_t defunc_0_f_res_225407;\n            \n            if (cond_225406) {\n                defunc_0_f_res_225407 = (int64_t) 0;\n            } else {\n                int64_t i_225408 = add64(x_225380, i_228294);\n                int64_t defunc_0_add_arg_225409;\n                \n                defunc_0_add_arg_225409 = ((__global\n                                            int64_t *) ext_mem_229197)[gtid_225372 *\n                                                                       n_203490 +\n                                                                       i_225408];\n                \n                int64_t defunc_1_add_res_225410 = add64((int64_t) 1,\n                                                        defunc_0_add_arg_225409);\n                \n                defunc_0_f_res_225407 = defunc_1_add_res_225410;\n            }\n            \n            double defunc_0_f_res_225411;\n            \n            if (cond_225406) {\n                defunc_0_f_res_225411 = 0.0;\n            } else {\n                int64_t i_225412 = add64(x_225380, i_228294);\n                double defunc_0_add_arg_225413;\n                \n                defunc_0_add_arg_225413 = ((__global\n                                            double *) mem_231320)[gtid_225372 *\n                                                                  n_203490 +\n                                                                  i_225412];\n                defunc_0_f_res_225411 = defunc_0_add_arg_225413;\n            }\n            \n            int64_t binop_p_225414 = sub64(defunc_0_f_res_225407,\n                                           defunc_0_g_res_225384);\n            double defunc_0_f_res_225415 = sitofp_i64_f64(binop_p_225414);\n            double abs_res_225416 = fabs(defunc_0_f_res_225415);\n            double tmp1_225417 = abs_res_225416 / x",
            "_225381;\n            double x_225418 = tmp1_225417 * tmp1_225417;\n            double y_225419 = tmp1_225417 * x_225418;\n            double tmp2_225420 = 1.0 - y_225419;\n            double x_225421 = tmp2_225420 * tmp2_225420;\n            double tmp3_225422 = tmp2_225420 * x_225421;\n            double w_j_225423 = defunc_0_f_res_225411 * tmp3_225422;\n            double xw_j_225424 = defunc_0_f_res_225415 * w_j_225423;\n            double x2w_j_225425 = defunc_0_f_res_225415 * xw_j_225424;\n            double x3w_j_225426 = defunc_0_f_res_225415 * x2w_j_225425;\n            double x4w_j_225427 = defunc_0_f_res_225415 * x3w_j_225426;\n            double defunc_1_op_res_225392 = w_j_225423 + redout_228289;\n            double defunc_1_op_res_225395 = xw_j_225424 + redout_228290;\n            double defunc_1_op_res_225398 = x2w_j_225425 + redout_228291;\n            double defunc_1_op_res_225401 = x3w_j_225426 + redout_228292;\n            double defunc_1_op_res_225404 = x4w_j_225427 + redout_228293;\n            double redout_tmp_236154 = defunc_1_op_res_225392;\n            double redout_tmp_236155 = defunc_1_op_res_225395;\n            double redout_tmp_236156 = defunc_1_op_res_225398;\n            double redout_tmp_236157 = defunc_1_op_res_225401;\n            double redout_tmp_236158 = defunc_1_op_res_225404;\n            \n            redout_228289 = redout_tmp_236154;\n            redout_228290 = redout_tmp_236155;\n            redout_228291 = redout_tmp_236156;\n            redout_228292 = redout_tmp_236157;\n            redout_228293 = redout_tmp_236158;\n        }\n        defunc_2_reduce_res_225385 = redout_228289;\n        defunc_2_reduce_res_225386 = redout_228290;\n        defunc_2_reduce_res_225387 = redout_228291;\n        defunc_2_reduce_res_225388 = redout_228292;\n        defunc_2_reduce_res_225389 = redout_228293;\n        \n        double x_225428 = defunc_2_reduce_res_225387 *\n               defunc_2_reduce_res_225389;\n        double y_225429 = defunc_2_reduce_res_225388 *\n  ",
            "             defunc_2_reduce_res_225388;\n        double a12_225430 = x_225428 - y_225429;\n        double x_225431 = defunc_2_reduce_res_225387 *\n               defunc_2_reduce_res_225388;\n        double y_225432 = defunc_2_reduce_res_225386 *\n               defunc_2_reduce_res_225389;\n        double b12_225433 = x_225431 - y_225432;\n        double x_225434 = defunc_2_reduce_res_225386 *\n               defunc_2_reduce_res_225388;\n        double y_225435 = defunc_2_reduce_res_225387 *\n               defunc_2_reduce_res_225387;\n        double c12_225436 = x_225434 - y_225435;\n        double x_225437 = defunc_2_reduce_res_225385 *\n               defunc_2_reduce_res_225389;\n        double b2_225438 = x_225437 - y_225435;\n        double x_225439 = defunc_2_reduce_res_225386 *\n               defunc_2_reduce_res_225387;\n        double y_225440 = defunc_2_reduce_res_225385 *\n               defunc_2_reduce_res_225388;\n        double c2_225441 = x_225439 - y_225440;\n        double x_225442 = defunc_2_reduce_res_225385 * a12_225430;\n        double y_225443 = defunc_2_reduce_res_225386 * b12_225433;\n        double x_225444 = x_225442 + y_225443;\n        double y_225445 = defunc_2_reduce_res_225387 * c12_225436;\n        double y_225446 = x_225444 + y_225445;\n        double det_225447 = 1.0 / y_225446;\n        double a12_225448 = a12_225430 * det_225447;\n        double b12_225449 = b12_225433 * det_225447;\n        double c12_225450 = c12_225436 * det_225447;\n        double b2_225451 = b2_225438 * det_225447;\n        double c2_225452 = c2_225441 * det_225447;\n        double defunc_2_reduce_res_225453;\n        double defunc_2_reduce_res_225454;\n        double redout_228295;\n        double redout_228296;\n        \n        redout_228295 = 0.0;\n        redout_228296 = 0.0;\n        for (int64_t i_228297 = 0; i_228297 < q_t_203494; i_228297++) {\n            bool cond_225462 = sle64(x_225376, i_228297);\n            int64_t defunc_0_f_res_225463;\n            \n            if (cond_225462) {\n",
            "                defunc_0_f_res_225463 = (int64_t) 0;\n            } else {\n                int64_t i_225464 = add64(x_225380, i_228297);\n                int64_t defunc_0_add_arg_225465;\n                \n                defunc_0_add_arg_225465 = ((__global\n                                            int64_t *) ext_mem_229197)[gtid_225372 *\n                                                                       n_203490 +\n                                                                       i_225464];\n                \n                int64_t defunc_1_add_res_225466 = add64((int64_t) 1,\n                                                        defunc_0_add_arg_225465);\n                \n                defunc_0_f_res_225463 = defunc_1_add_res_225466;\n            }\n            \n            double defunc_0_f_res_225467;\n            \n            if (cond_225462) {\n                defunc_0_f_res_225467 = 0.0;\n            } else {\n                int64_t i_225468 = add64(x_225380, i_228297);\n                double defunc_0_add_arg_225469;\n                \n                defunc_0_add_arg_225469 = ((__global\n                                            double *) mem_231320)[gtid_225372 *\n                                                                  n_203490 +\n                                                                  i_225468];\n                defunc_0_f_res_225467 = defunc_0_add_arg_225469;\n            }\n            \n            int64_t binop_p_225470 = sub64(defunc_0_f_res_225463,\n                                           defunc_0_g_res_225384);\n            double defunc_0_f_res_225471 = sitofp_i64_f64(binop_p_225470);\n            double abs_res_225472 = fabs(defunc_0_f_res_225471);\n            double tmp1_225473 = abs_res_225472 / x_225381;\n            double x_225474 = tmp1_225473 * tmp1_225473;\n            double y_225475 = tmp1_225473 * x_225474;\n            double tmp2_225476 = 1.0 - y_225475;\n            double x_225477 = tmp2_225476 * tmp2_225476;\n           ",
            " double tmp3_225478 = tmp2_225476 * x_225477;\n            double tmp4_225479 = defunc_0_f_res_225467 * tmp3_225478;\n            double defunc_1_f_res_225480 = defunc_0_f_res_225471 * tmp4_225479;\n            double defunc_1_f_res_225481 = defunc_0_f_res_225471 *\n                   defunc_1_f_res_225480;\n            double defunc_0_f_res_225482;\n            \n            if (cond_225462) {\n                defunc_0_f_res_225482 = 0.0;\n            } else {\n                int64_t i_225483 = add64(x_225380, i_228297);\n                double defunc_0_add_arg_225484;\n                \n                defunc_0_add_arg_225484 = ((__global\n                                            double *) mem_231324)[gtid_225372 *\n                                                                  n_203490 +\n                                                                  i_225483];\n                defunc_0_f_res_225482 = defunc_0_add_arg_225484;\n            }\n            \n            double x_225485 = a12_225448 * tmp4_225479;\n            double y_225486 = b12_225449 * defunc_1_f_res_225480;\n            double x_225487 = x_225485 + y_225486;\n            double y_225488 = c12_225450 * defunc_1_f_res_225481;\n            double x_225489 = x_225487 + y_225488;\n            double defunc_9_fit_fun_res_225490 = defunc_0_f_res_225482 *\n                   x_225489;\n            double x_225491 = b12_225449 * tmp4_225479;\n            double y_225492 = b2_225451 * defunc_1_f_res_225480;\n            double x_225493 = x_225491 + y_225492;\n            double y_225494 = c2_225452 * defunc_1_f_res_225481;\n            double x_225495 = x_225493 + y_225494;\n            double defunc_9_slope_fun_res_225496 = defunc_0_f_res_225482 *\n                   x_225495;\n            double defunc_1_op_res_225457 = defunc_9_fit_fun_res_225490 +\n                   redout_228295;\n            double defunc_1_op_res_225460 = defunc_9_slope_fun_res_225496 +\n                   redout_228296;\n            double redout_tmp_23615",
            "9 = defunc_1_op_res_225457;\n            double redout_tmp_236160 = defunc_1_op_res_225460;\n            \n            redout_228295 = redout_tmp_236159;\n            redout_228296 = redout_tmp_236160;\n        }\n        defunc_2_reduce_res_225453 = redout_228295;\n        defunc_2_reduce_res_225454 = redout_228296;\n        ((__global double *) mem_231329)[gtid_225372 * t_n_m_203650 +\n                                         gtid_225373] =\n            defunc_2_reduce_res_225453;\n        ((__global double *) mem_231333)[gtid_225372 * t_n_m_203650 +\n                                         gtid_225373] =\n            defunc_2_reduce_res_225454;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_225363\n}\n__kernel void mainzisegmap_225582(__global int *global_failure,\n                                  int64_t partition_sizze_203577,\n                                  int64_t t_n_m_203650, __global\n                                  unsigned char *mem_231338, __global\n                                  unsigned char *mem_231342, __global\n                                  unsigned char *mem_231346, __global\n                                  unsigned char *mem_231350, __global\n                                  unsigned char *mem_231354, __global\n                                  unsigned char *mem_231359, __global\n                                  unsigned char *mem_231363, __global\n                                  unsigned char *mem_231367, __global\n                                  unsigned char *mem_231371, __global\n                                  unsigned char *mem_231375)\n{\n    #define segmap_group_sizze_225573 (mainzisegmap_group_sizze_224920)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236289;\n    int32_t local_tid_236290;\n    int64_t group_sizze_236293;\n    int32_t wave_sizze_236292;\n    int32_t group_tid_236291;\n    \n    global_ti",
            "d_236289 = get_global_id(0);\n    local_tid_236290 = get_local_id(0);\n    group_sizze_236293 = get_local_size(0);\n    wave_sizze_236292 = LOCKSTEP_WIDTH;\n    group_tid_236291 = get_group_id(0);\n    \n    int32_t phys_tid_225582 = global_tid_236289;\n    int64_t global_tid_236294 = sext_i32_i64(group_tid_236291) *\n            segmap_group_sizze_225573 + sext_i32_i64(local_tid_236290);\n    int64_t slice_236295 = t_n_m_203650;\n    int64_t slice_236296 = partition_sizze_203577 * slice_236295;\n    int64_t gtid_225580 = squot64(global_tid_236294, slice_236295);\n    int64_t remnant_236297 = global_tid_236294 - gtid_225580 * slice_236295;\n    int64_t gtid_225581 = remnant_236297;\n    int64_t remnant_236298 = remnant_236297 - gtid_225581;\n    \n    if (slt64(gtid_225580, partition_sizze_203577) && slt64(gtid_225581,\n                                                            t_n_m_203650)) {\n        double defunc_2_reduce_res_225583;\n        \n        defunc_2_reduce_res_225583 = ((__global\n                                       double *) mem_231338)[gtid_225580 *\n                                                             t_n_m_203650 +\n                                                             gtid_225581];\n        \n        double defunc_2_reduce_res_225584;\n        \n        defunc_2_reduce_res_225584 = ((__global\n                                       double *) mem_231342)[gtid_225580 *\n                                                             t_n_m_203650 +\n                                                             gtid_225581];\n        \n        double defunc_2_reduce_res_225585;\n        \n        defunc_2_reduce_res_225585 = ((__global\n                                       double *) mem_231346)[gtid_225580 *\n                                                             t_n_m_203650 +\n                                                             gtid_225581];\n        \n        double defunc_2_reduce_res_225586;\n        \n        defunc_2_reduce_res_225586 = ((__global\n   ",
            "                                    double *) mem_231350)[gtid_225580 *\n                                                             t_n_m_203650 +\n                                                             gtid_225581];\n        \n        double defunc_2_reduce_res_225587;\n        \n        defunc_2_reduce_res_225587 = ((__global\n                                       double *) mem_231354)[gtid_225580 *\n                                                             t_n_m_203650 +\n                                                             gtid_225581];\n        \n        double x_225588 = defunc_2_reduce_res_225585 *\n               defunc_2_reduce_res_225587;\n        double y_225589 = defunc_2_reduce_res_225586 *\n               defunc_2_reduce_res_225586;\n        double a12_225590 = x_225588 - y_225589;\n        double x_225591 = defunc_2_reduce_res_225585 *\n               defunc_2_reduce_res_225586;\n        double y_225592 = defunc_2_reduce_res_225584 *\n               defunc_2_reduce_res_225587;\n        double b12_225593 = x_225591 - y_225592;\n        double x_225594 = defunc_2_reduce_res_225584 *\n               defunc_2_reduce_res_225586;\n        double y_225595 = defunc_2_reduce_res_225585 *\n               defunc_2_reduce_res_225585;\n        double c12_225596 = x_225594 - y_225595;\n        double x_225597 = defunc_2_reduce_res_225583 *\n               defunc_2_reduce_res_225587;\n        double b2_225598 = x_225597 - y_225595;\n        double x_225599 = defunc_2_reduce_res_225584 *\n               defunc_2_reduce_res_225585;\n        double y_225600 = defunc_2_reduce_res_225583 *\n               defunc_2_reduce_res_225586;\n        double c2_225601 = x_225599 - y_225600;\n        double x_225602 = defunc_2_reduce_res_225583 * a12_225590;\n        double y_225603 = defunc_2_reduce_res_225584 * b12_225593;\n        double x_225604 = x_225602 + y_225603;\n        double y_225605 = defunc_2_reduce_res_225585 * c12_225596;\n        double y_225606 = x_225604 + y_225605;\n        doubl",
            "e det_225607 = 1.0 / y_225606;\n        double a12_225608 = a12_225590 * det_225607;\n        double b12_225609 = b12_225593 * det_225607;\n        double c12_225610 = c12_225596 * det_225607;\n        double b2_225611 = b2_225598 * det_225607;\n        double c2_225612 = c2_225601 * det_225607;\n        \n        ((__global double *) mem_231359)[gtid_225580 * t_n_m_203650 +\n                                         gtid_225581] = a12_225608;\n        ((__global double *) mem_231363)[gtid_225580 * t_n_m_203650 +\n                                         gtid_225581] = b12_225609;\n        ((__global double *) mem_231367)[gtid_225580 * t_n_m_203650 +\n                                         gtid_225581] = c12_225610;\n        ((__global double *) mem_231371)[gtid_225580 * t_n_m_203650 +\n                                         gtid_225581] = b2_225611;\n        ((__global double *) mem_231375)[gtid_225580 * t_n_m_203650 +\n                                         gtid_225581] = c2_225612;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_225573\n}\n__kernel void mainzisegmap_225873(__global int *global_failure,\n                                  int64_t n_203490,\n                                  int64_t partition_sizze_203577, __global\n                                  unsigned char *mem_229161, __global\n                                  unsigned char *mem_230920, __global\n                                  unsigned char *mem_231411)\n{\n    #define segmap_group_sizze_225868 (mainzisegmap_group_sizze_225842)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236387;\n    int32_t local_tid_236388;\n    int64_t group_sizze_236391;\n    int32_t wave_sizze_236390;\n    int32_t group_tid_236389;\n    \n    global_tid_236387 = get_global_id(0);\n    local_tid_236388 = get_local_id(0);\n    group_sizze_236391 = get_local_size(0);\n    wave_sizze_236390 = LOCKSTEP_WID",
            "TH;\n    group_tid_236389 = get_group_id(0);\n    \n    int32_t phys_tid_225873 = global_tid_236387;\n    int64_t global_tid_236392 = sext_i32_i64(group_tid_236389) *\n            segmap_group_sizze_225868 + sext_i32_i64(local_tid_236388);\n    int64_t slice_236393 = n_203490;\n    int64_t slice_236394 = partition_sizze_203577 * slice_236393;\n    int64_t gtid_225871 = squot64(global_tid_236392, slice_236393);\n    int64_t remnant_236395 = global_tid_236392 - gtid_225871 * slice_236393;\n    int64_t gtid_225872 = remnant_236395;\n    int64_t remnant_236396 = remnant_236395 - gtid_225872;\n    \n    if (slt64(gtid_225871, partition_sizze_203577) && slt64(gtid_225872,\n                                                            n_203490)) {\n        double x_225874;\n        \n        x_225874 = ((__global double *) mem_229161)[gtid_225871 * n_203490 +\n                                                    gtid_225872];\n        \n        double x_225875;\n        \n        x_225875 = ((__global double *) mem_230920)[gtid_225871 * n_203490 +\n                                                    gtid_225872];\n        \n        double defunc_1_f_res_225876 = x_225874 - x_225875;\n        \n        ((__global double *) mem_231411)[gtid_225871 * n_203490 + gtid_225872] =\n            defunc_1_f_res_225876;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_225868\n}\n__kernel void mainzisegmap_225890(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203490,\n                                  int64_t partition_sizze_203577,\n                                  int64_t ctx_param_ext_229488,\n                                  int64_t ctx_param_ext_229489,\n                                  int64_t ctx_param_ext_229491, __global\n                                  unsigned char *ext_mem_229197, __global\n                                  unsigned ch",
            "ar *mem_param_229493, __global\n                                  unsigned char *mem_231411, __global\n                                  unsigned char *mem_231416, __global\n                                  unsigned char *mem_231420)\n{\n    #define segmap_group_sizze_225884 (mainzisegmap_group_sizze_225786)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236397;\n    int32_t local_tid_236398;\n    int64_t group_sizze_236401;\n    int32_t wave_sizze_236400;\n    int32_t group_tid_236399;\n    \n    global_tid_236397 = get_global_id(0);\n    local_tid_236398 = get_local_id(0);\n    group_sizze_236401 = get_local_size(0);\n    wave_sizze_236400 = LOCKSTEP_WIDTH;\n    group_tid_236399 = get_group_id(0);\n    \n    int32_t phys_tid_225890 = global_tid_236397;\n    int64_t global_tid_236402 = sext_i32_i64(group_tid_236399) *\n            segmap_group_sizze_225884 + sext_i32_i64(local_tid_236398);\n    int64_t slice_236403 = n_203490;\n    int64_t slice_236404 = partition_sizze_203577 * slice_236403;\n    int64_t gtid_225888 = squot64(global_tid_236402, slice_236403);\n    int64_t remnant_236405 = global_tid_236402 - gtid_225888 * slice_236403;\n    int64_t gtid_225889 = remnant_236405;\n    int64_t remnant_236406 = remnant_236405 - gtid_225889;\n    \n    if (slt64(gtid_225888, partition_sizze_203577) && slt64(gtid_225889,\n                                                            n_203490)) {\n        int64_t x_225893;\n        \n        x_225893 = ((__global int64_t *) ext_mem_229197)[gtid_225888 *\n                                                         n_203490 +\n                                                         gtid_225889];\n        \n        bool cond_225894 = sle64((int64_t) 0, x_225893);\n        double defunc_0_f_res_225895;\n        \n        if (cond_225894) {\n            bool y_225896 = slt64(x_225893, n_203490);\n            bool bounds_check_225897 = cond_225",
            "894 && y_225896;\n            bool index_certs_225898;\n            \n            if (!bounds_check_225897) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 64) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) x_225893;\n                        global_failure_args[1] = (int64_t) n_203490;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            double defunc_0_f_res_t_res_225899;\n            \n            defunc_0_f_res_t_res_225899 = ((__global\n                                            double *) mem_231411)[gtid_225888 *\n                                                                  n_203490 +\n                                                                  x_225893];\n            defunc_0_f_res_225895 = defunc_0_f_res_t_res_225899;\n        } else {\n            defunc_0_f_res_225895 = 0.0;\n        }\n        \n        double defunc_0_f_res_225900;\n        \n        if (cond_225894) {\n            bool y_225901 = slt64(x_225893, n_203490);\n            bool bounds_check_225902 = cond_225894 && y_225901;\n            bool index_certs_225903;\n            \n            if (!bounds_check_225902) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 65) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) x_225893;\n                        global_failure_args[1] = (int64_t) n_203490;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            double defunc_0_f_res_t_res_225904;\n            \n            defunc_0_f_res_t_res_225904 = ((__global\n                                            double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                                        (gtid_225888 *\n                                                        ",
            "                 ctx_param_ext_229489 +\n                                                                         x_225893 *\n                                                                         ctx_param_ext_229491)];\n            defunc_0_f_res_225900 = defunc_0_f_res_t_res_225904;\n        } else {\n            defunc_0_f_res_225900 = 0.0;\n        }\n        ((__global double *) mem_231416)[gtid_225888 * n_203490 + gtid_225889] =\n            defunc_0_f_res_225900;\n        ((__global double *) mem_231420)[gtid_225888 * n_203490 + gtid_225889] =\n            defunc_0_f_res_225895;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_225884\n}\n__kernel void mainzisegmap_226185(__global int *global_failure,\n                                  int64_t n_203490,\n                                  int64_t partition_sizze_203577, __global\n                                  unsigned char *mem_229161, __global\n                                  unsigned char *mem_230920, __global\n                                  unsigned char *mem_231435)\n{\n    #define segmap_group_sizze_226180 (mainzisegmap_group_sizze_226154)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236427;\n    int32_t local_tid_236428;\n    int64_t group_sizze_236431;\n    int32_t wave_sizze_236430;\n    int32_t group_tid_236429;\n    \n    global_tid_236427 = get_global_id(0);\n    local_tid_236428 = get_local_id(0);\n    group_sizze_236431 = get_local_size(0);\n    wave_sizze_236430 = LOCKSTEP_WIDTH;\n    group_tid_236429 = get_group_id(0);\n    \n    int32_t phys_tid_226185 = global_tid_236427;\n    int64_t global_tid_236432 = sext_i32_i64(group_tid_236429) *\n            segmap_group_sizze_226180 + sext_i32_i64(local_tid_236428);\n    int64_t slice_236433 = n_203490;\n    int64_t slice_236434 = partition_sizze_203577 * slice_236433;\n    int64_t gtid_226183 = squot64(global_tid_236432, slice_236433",
            ");\n    int64_t remnant_236435 = global_tid_236432 - gtid_226183 * slice_236433;\n    int64_t gtid_226184 = remnant_236435;\n    int64_t remnant_236436 = remnant_236435 - gtid_226184;\n    \n    if (slt64(gtid_226183, partition_sizze_203577) && slt64(gtid_226184,\n                                                            n_203490)) {\n        double x_226186;\n        \n        x_226186 = ((__global double *) mem_229161)[gtid_226183 * n_203490 +\n                                                    gtid_226184];\n        \n        double x_226187;\n        \n        x_226187 = ((__global double *) mem_230920)[gtid_226183 * n_203490 +\n                                                    gtid_226184];\n        \n        double defunc_1_f_res_226188 = x_226186 - x_226187;\n        \n        ((__global double *) mem_231435)[gtid_226183 * n_203490 + gtid_226184] =\n            defunc_1_f_res_226188;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_226180\n}\n__kernel void mainzisegmap_226202(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203490,\n                                  int64_t partition_sizze_203577,\n                                  int64_t ctx_param_ext_229488,\n                                  int64_t ctx_param_ext_229489,\n                                  int64_t ctx_param_ext_229491, __global\n                                  unsigned char *ext_mem_229197, __global\n                                  unsigned char *mem_param_229493, __global\n                                  unsigned char *mem_231435, __global\n                                  unsigned char *mem_231440, __global\n                                  unsigned char *mem_231444)\n{\n    #define segmap_group_sizze_226196 (mainzisegmap_group_sizze_226098)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n  ",
            "  \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236437;\n    int32_t local_tid_236438;\n    int64_t group_sizze_236441;\n    int32_t wave_sizze_236440;\n    int32_t group_tid_236439;\n    \n    global_tid_236437 = get_global_id(0);\n    local_tid_236438 = get_local_id(0);\n    group_sizze_236441 = get_local_size(0);\n    wave_sizze_236440 = LOCKSTEP_WIDTH;\n    group_tid_236439 = get_group_id(0);\n    \n    int32_t phys_tid_226202 = global_tid_236437;\n    int64_t global_tid_236442 = sext_i32_i64(group_tid_236439) *\n            segmap_group_sizze_226196 + sext_i32_i64(local_tid_236438);\n    int64_t slice_236443 = n_203490;\n    int64_t slice_236444 = partition_sizze_203577 * slice_236443;\n    int64_t gtid_226200 = squot64(global_tid_236442, slice_236443);\n    int64_t remnant_236445 = global_tid_236442 - gtid_226200 * slice_236443;\n    int64_t gtid_226201 = remnant_236445;\n    int64_t remnant_236446 = remnant_236445 - gtid_226201;\n    \n    if (slt64(gtid_226200, partition_sizze_203577) && slt64(gtid_226201,\n                                                            n_203490)) {\n        int64_t x_226205;\n        \n        x_226205 = ((__global int64_t *) ext_mem_229197)[gtid_226200 *\n                                                         n_203490 +\n                                                         gtid_226201];\n        \n        bool cond_226206 = sle64((int64_t) 0, x_226205);\n        double defunc_0_f_res_226207;\n        \n        if (cond_226206) {\n            bool y_226208 = slt64(x_226205, n_203490);\n            bool bounds_check_226209 = cond_226206 && y_226208;\n            bool index_certs_226210;\n            \n            if (!bounds_check_226209) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 66) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) x_226205;\n                        global_failure_args[1] = (int64_t) n_203490;\n                        ;\n       ",
            "             }\n                    return;\n                }\n            }\n            \n            double defunc_0_f_res_t_res_226211;\n            \n            defunc_0_f_res_t_res_226211 = ((__global\n                                            double *) mem_231435)[gtid_226200 *\n                                                                  n_203490 +\n                                                                  x_226205];\n            defunc_0_f_res_226207 = defunc_0_f_res_t_res_226211;\n        } else {\n            defunc_0_f_res_226207 = 0.0;\n        }\n        \n        double defunc_0_f_res_226212;\n        \n        if (cond_226206) {\n            bool y_226213 = slt64(x_226205, n_203490);\n            bool bounds_check_226214 = cond_226206 && y_226213;\n            bool index_certs_226215;\n            \n            if (!bounds_check_226214) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 67) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) x_226205;\n                        global_failure_args[1] = (int64_t) n_203490;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            double defunc_0_f_res_t_res_226216;\n            \n            defunc_0_f_res_t_res_226216 = ((__global\n                                            double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                                        (gtid_226200 *\n                                                                         ctx_param_ext_229489 +\n                                                                         x_226205 *\n                                                                         ctx_param_ext_229491)];\n            defunc_0_f_res_226212 = defunc_0_f_res_t_res_226216;\n        } else {\n            defunc_0_f_res_226212 = 0.0;\n        }\n        ((__global double *) mem_231440)[gtid_226",
            "200 * n_203490 + gtid_226201] =\n            defunc_0_f_res_226212;\n        ((__global double *) mem_231444)[gtid_226200 * n_203490 + gtid_226201] =\n            defunc_0_f_res_226207;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_226196\n}\n__kernel void mainzisegmap_226589(__global int *global_failure,\n                                  int64_t n_203490,\n                                  int64_t partition_sizze_203577, __global\n                                  unsigned char *mem_229161, __global\n                                  unsigned char *mem_230920, __global\n                                  unsigned char *mem_231466)\n{\n    #define segmap_group_sizze_226584 (mainzisegmap_group_sizze_226558)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236473;\n    int32_t local_tid_236474;\n    int64_t group_sizze_236477;\n    int32_t wave_sizze_236476;\n    int32_t group_tid_236475;\n    \n    global_tid_236473 = get_global_id(0);\n    local_tid_236474 = get_local_id(0);\n    group_sizze_236477 = get_local_size(0);\n    wave_sizze_236476 = LOCKSTEP_WIDTH;\n    group_tid_236475 = get_group_id(0);\n    \n    int32_t phys_tid_226589 = global_tid_236473;\n    int64_t global_tid_236478 = sext_i32_i64(group_tid_236475) *\n            segmap_group_sizze_226584 + sext_i32_i64(local_tid_236474);\n    int64_t slice_236479 = n_203490;\n    int64_t slice_236480 = partition_sizze_203577 * slice_236479;\n    int64_t gtid_226587 = squot64(global_tid_236478, slice_236479);\n    int64_t remnant_236481 = global_tid_236478 - gtid_226587 * slice_236479;\n    int64_t gtid_226588 = remnant_236481;\n    int64_t remnant_236482 = remnant_236481 - gtid_226588;\n    \n    if (slt64(gtid_226587, partition_sizze_203577) && slt64(gtid_226588,\n                                                            n_203490)) {\n        double x_226590;\n        \n        x_226590 = ((__global double ",
            "*) mem_229161)[gtid_226587 * n_203490 +\n                                                    gtid_226588];\n        \n        double x_226591;\n        \n        x_226591 = ((__global double *) mem_230920)[gtid_226587 * n_203490 +\n                                                    gtid_226588];\n        \n        double defunc_1_f_res_226592 = x_226590 - x_226591;\n        \n        ((__global double *) mem_231466)[gtid_226587 * n_203490 + gtid_226588] =\n            defunc_1_f_res_226592;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_226584\n}\n__kernel void mainzisegmap_226606(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203490,\n                                  int64_t partition_sizze_203577,\n                                  int64_t ctx_param_ext_229488,\n                                  int64_t ctx_param_ext_229489,\n                                  int64_t ctx_param_ext_229491, __global\n                                  unsigned char *ext_mem_229197, __global\n                                  unsigned char *mem_param_229493, __global\n                                  unsigned char *mem_231466, __global\n                                  unsigned char *mem_231471, __global\n                                  unsigned char *mem_231475)\n{\n    #define segmap_group_sizze_226600 (mainzisegmap_group_sizze_226502)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236483;\n    int32_t local_tid_236484;\n    int64_t group_sizze_236487;\n    int32_t wave_sizze_236486;\n    int32_t group_tid_236485;\n    \n    global_tid_236483 = get_global_id(0);\n    local_tid_236484 = get_local_id(0);\n    group_sizze_236487 = get_local_size(0);\n    wave_sizze_236486 = LOCKSTEP_WIDTH;\n    group_tid_236485 = g",
            "et_group_id(0);\n    \n    int32_t phys_tid_226606 = global_tid_236483;\n    int64_t global_tid_236488 = sext_i32_i64(group_tid_236485) *\n            segmap_group_sizze_226600 + sext_i32_i64(local_tid_236484);\n    int64_t slice_236489 = n_203490;\n    int64_t slice_236490 = partition_sizze_203577 * slice_236489;\n    int64_t gtid_226604 = squot64(global_tid_236488, slice_236489);\n    int64_t remnant_236491 = global_tid_236488 - gtid_226604 * slice_236489;\n    int64_t gtid_226605 = remnant_236491;\n    int64_t remnant_236492 = remnant_236491 - gtid_226605;\n    \n    if (slt64(gtid_226604, partition_sizze_203577) && slt64(gtid_226605,\n                                                            n_203490)) {\n        int64_t x_226609;\n        \n        x_226609 = ((__global int64_t *) ext_mem_229197)[gtid_226604 *\n                                                         n_203490 +\n                                                         gtid_226605];\n        \n        bool cond_226610 = sle64((int64_t) 0, x_226609);\n        double defunc_0_f_res_226611;\n        \n        if (cond_226610) {\n            bool y_226612 = slt64(x_226609, n_203490);\n            bool bounds_check_226613 = cond_226610 && y_226612;\n            bool index_certs_226614;\n            \n            if (!bounds_check_226613) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 68) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) x_226609;\n                        global_failure_args[1] = (int64_t) n_203490;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            double defunc_0_f_res_t_res_226615;\n            \n            defunc_0_f_res_t_res_226615 = ((__global\n                                            double *) mem_231466)[gtid_226604 *\n                                                                  n_203490 +\n                                            ",
            "                      x_226609];\n            defunc_0_f_res_226611 = defunc_0_f_res_t_res_226615;\n        } else {\n            defunc_0_f_res_226611 = 0.0;\n        }\n        \n        double defunc_0_f_res_226616;\n        \n        if (cond_226610) {\n            bool y_226617 = slt64(x_226609, n_203490);\n            bool bounds_check_226618 = cond_226610 && y_226617;\n            bool index_certs_226619;\n            \n            if (!bounds_check_226618) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 69) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) x_226609;\n                        global_failure_args[1] = (int64_t) n_203490;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            double defunc_0_f_res_t_res_226620;\n            \n            defunc_0_f_res_t_res_226620 = ((__global\n                                            double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                                        (gtid_226604 *\n                                                                         ctx_param_ext_229489 +\n                                                                         x_226609 *\n                                                                         ctx_param_ext_229491)];\n            defunc_0_f_res_226616 = defunc_0_f_res_t_res_226620;\n        } else {\n            defunc_0_f_res_226616 = 0.0;\n        }\n        ((__global double *) mem_231471)[gtid_226604 * n_203490 + gtid_226605] =\n            defunc_0_f_res_226616;\n        ((__global double *) mem_231475)[gtid_226604 * n_203490 + gtid_226605] =\n            defunc_0_f_res_226611;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_226600\n}\n__kernel void mainzisegmap_226894(__global int *global_failure,\n                                  int failure_is_an_option, __global\n              ",
            "                    int64_t *global_failure_args,\n                                  int64_t n_203490, int64_t jump_t_203500,\n                                  int64_t partition_sizze_203577,\n                                  int64_t t_n_m_203650, int64_t i_203670,\n                                  int64_t y_206583, __global\n                                  unsigned char *ext_mem_231504, __global\n                                  unsigned char *ext_mem_231505, __global\n                                  unsigned char *mem_231510)\n{\n    #define segmap_group_sizze_226889 (mainzisegmap_group_sizze_226771)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236523;\n    int32_t local_tid_236524;\n    int64_t group_sizze_236527;\n    int32_t wave_sizze_236526;\n    int32_t group_tid_236525;\n    \n    global_tid_236523 = get_global_id(0);\n    local_tid_236524 = get_local_id(0);\n    group_sizze_236527 = get_local_size(0);\n    wave_sizze_236526 = LOCKSTEP_WIDTH;\n    group_tid_236525 = get_group_id(0);\n    \n    int32_t phys_tid_226894 = global_tid_236523;\n    int64_t global_tid_236528 = sext_i32_i64(group_tid_236525) *\n            segmap_group_sizze_226889 + sext_i32_i64(local_tid_236524);\n    int64_t slice_236529 = n_203490;\n    int64_t slice_236530 = partition_sizze_203577 * slice_236529;\n    int64_t gtid_226892 = squot64(global_tid_236528, slice_236529);\n    int64_t remnant_236531 = global_tid_236528 - gtid_226892 * slice_236529;\n    int64_t gtid_226893 = remnant_236531;\n    int64_t remnant_236532 = remnant_236531 - gtid_226893;\n    \n    if (slt64(gtid_226892, partition_sizze_203577) && slt64(gtid_226893,\n                                                            n_203490)) {\n        int64_t m_v_226898 = sdiv64(gtid_226893, jump_t_203500);\n        bool cond_226899 = m_v_226898 == y_206583;\n        int64_t j_226900;\n        \n        if (cond_226899) {\n      ",
            "      int64_t j_t_res_226901 = sub64(m_v_226898, (int64_t) 1);\n            \n            j_226900 = j_t_res_226901;\n        } else {\n            j_226900 = m_v_226898;\n        }\n        \n        int64_t min_arg_226902 = mul64(jump_t_203500, j_226900);\n        int64_t min_res_226903 = smin64(i_203670, min_arg_226902);\n        int64_t defunc_0_m_fun_arg_226904 = add64((int64_t) 1, j_226900);\n        int64_t min_arg_226905 = mul64(jump_t_203500,\n                                       defunc_0_m_fun_arg_226904);\n        int64_t min_res_226906 = smin64(i_203670, min_arg_226905);\n        int64_t i64_arg_226907 = sub64(min_res_226906, min_res_226903);\n        double i64_res_226908 = sitofp_i64_f64(i64_arg_226907);\n        int64_t i64_arg_226909 = sub64(gtid_226893, min_res_226903);\n        double i64_res_226910 = sitofp_i64_f64(i64_arg_226909);\n        double u_226911 = i64_res_226910 / i64_res_226908;\n        double u2_226912 = u_226911 * u_226911;\n        double u3_226913 = u_226911 * u2_226912;\n        double x_226914 = 2.0 * u3_226913;\n        double y_226915 = 3.0 * u2_226912;\n        double x_226916 = x_226914 - y_226915;\n        double x_226917 = 1.0 + x_226916;\n        bool x_226918 = sle64((int64_t) 0, j_226900);\n        bool y_226919 = slt64(j_226900, t_n_m_203650);\n        bool bounds_check_226920 = x_226918 && y_226919;\n        bool index_certs_226921;\n        \n        if (!bounds_check_226920) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 70) == -1) {\n                    global_failure_args[0] = (int64_t) j_226900;\n                    global_failure_args[1] = (int64_t) t_n_m_203650;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        double y_226922;\n        \n        y_226922 = ((__global double *) ext_mem_231505)[gtid_226892 *\n                                                        t_n_m_203650 +\n                                                        j_226900];\n        \n ",
            "       double x_226923 = x_226917 * y_226922;\n        double x_226924 = y_226915 - x_226914;\n        bool x_226925 = sle64((int64_t) 0, defunc_0_m_fun_arg_226904);\n        bool y_226926 = slt64(defunc_0_m_fun_arg_226904, t_n_m_203650);\n        bool bounds_check_226927 = x_226925 && y_226926;\n        bool index_certs_226928;\n        \n        if (!bounds_check_226927) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 71) == -1) {\n                    global_failure_args[0] =\n                        (int64_t) defunc_0_m_fun_arg_226904;\n                    global_failure_args[1] = (int64_t) t_n_m_203650;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        double y_226929;\n        \n        y_226929 = ((__global double *) ext_mem_231505)[gtid_226892 *\n                                                        t_n_m_203650 +\n                                                        defunc_0_m_fun_arg_226904];\n        \n        double y_226930 = x_226924 * y_226929;\n        double x_226931 = x_226923 + y_226930;\n        double y_226932 = 2.0 * u2_226912;\n        double x_226933 = u3_226913 - y_226932;\n        double x_226934 = u_226911 + x_226933;\n        double y_226935;\n        \n        y_226935 = ((__global double *) ext_mem_231504)[gtid_226892 *\n                                                        t_n_m_203650 +\n                                                        j_226900];\n        \n        double x_226936 = x_226934 * y_226935;\n        double y_226937 = i64_res_226908 * x_226936;\n        double x_226938 = x_226931 + y_226937;\n        double x_226939 = u3_226913 - u2_226912;\n        double y_226940;\n        \n        y_226940 = ((__global double *) ext_mem_231504)[gtid_226892 *\n                                                        t_n_m_203650 +\n                                                        defunc_0_m_fun_arg_226904];\n        \n        double x_226941 = x_226939 * y_226940;\n  ",
            "      double y_226942 = i64_res_226908 * x_226941;\n        double defunc_4_interpolate_proc_res_226943 = x_226938 + y_226942;\n        \n        ((__global double *) mem_231510)[gtid_226892 * n_203490 + gtid_226893] =\n            defunc_4_interpolate_proc_res_226943;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_226889\n}\n__kernel void mainzisegmap_227111(__global int *global_failure,\n                                  int64_t n_203490,\n                                  int64_t partition_sizze_203577,\n                                  int64_t ext_231522, __global\n                                  unsigned char *mem_229161, __global\n                                  unsigned char *ext_mem_231517, __global\n                                  unsigned char *ext_mem_231518, __global\n                                  unsigned char *mem_231554)\n{\n    #define segmap_group_sizze_227106 (mainzisegmap_group_sizze_227070)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236545;\n    int32_t local_tid_236546;\n    int64_t group_sizze_236549;\n    int32_t wave_sizze_236548;\n    int32_t group_tid_236547;\n    \n    global_tid_236545 = get_global_id(0);\n    local_tid_236546 = get_local_id(0);\n    group_sizze_236549 = get_local_size(0);\n    wave_sizze_236548 = LOCKSTEP_WIDTH;\n    group_tid_236547 = get_group_id(0);\n    \n    int32_t phys_tid_227111 = global_tid_236545;\n    int64_t global_tid_236550 = sext_i32_i64(group_tid_236547) *\n            segmap_group_sizze_227106 + sext_i32_i64(local_tid_236546);\n    int64_t slice_236551 = n_203490;\n    int64_t slice_236552 = partition_sizze_203577 * slice_236551;\n    int64_t gtid_227109 = squot64(global_tid_236550, slice_236551);\n    int64_t remnant_236553 = global_tid_236550 - gtid_227109 * slice_236551;\n    int64_t gtid_227110 = remnant_236553;\n    int64_t remnant_236554 = remnant_236553 - gtid_227110;\n    \n  ",
            "  if (slt64(gtid_227109, partition_sizze_203577) && slt64(gtid_227110,\n                                                            n_203490)) {\n        double x_227112;\n        \n        x_227112 = ((__global double *) mem_229161)[gtid_227109 * n_203490 +\n                                                    gtid_227110];\n        \n        double x_227113;\n        \n        x_227113 = ((__global double *) ext_mem_231518)[gtid_227109 * n_203490 +\n                                                        gtid_227110];\n        \n        double x_227114;\n        \n        x_227114 = ((__global double *) ext_mem_231517)[gtid_227109 *\n                                                        ext_231522 +\n                                                        gtid_227110];\n        \n        double x_227115 = x_227112 - x_227113;\n        double defunc_2_f_res_227116 = x_227115 - x_227114;\n        bool isnan_res_227117;\n        \n        isnan_res_227117 = futrts_isnan64(defunc_2_f_res_227116);\n        \n        double defunc_0_f_res_227118;\n        \n        if (isnan_res_227117) {\n            defunc_0_f_res_227118 = defunc_2_f_res_227116;\n        } else {\n            double abs_res_227119 = fabs(defunc_2_f_res_227116);\n            \n            defunc_0_f_res_227118 = abs_res_227119;\n        }\n        ((__global double *) mem_231554)[gtid_227109 * n_203490 + gtid_227110] =\n            defunc_0_f_res_227118;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_227106\n}\n__kernel void mainzisegmap_227132(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203490,\n                                  int64_t partition_sizze_203577, __global\n                                  unsigned char *ext_mem_229197, __global\n                                  unsigned char *mem_231554, __global\n                                  unsigned char *m",
            "em_231559)\n{\n    #define segmap_group_sizze_227127 (mainzisegmap_group_sizze_227027)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236555;\n    int32_t local_tid_236556;\n    int64_t group_sizze_236559;\n    int32_t wave_sizze_236558;\n    int32_t group_tid_236557;\n    \n    global_tid_236555 = get_global_id(0);\n    local_tid_236556 = get_local_id(0);\n    group_sizze_236559 = get_local_size(0);\n    wave_sizze_236558 = LOCKSTEP_WIDTH;\n    group_tid_236557 = get_group_id(0);\n    \n    int32_t phys_tid_227132 = global_tid_236555;\n    int64_t global_tid_236560 = sext_i32_i64(group_tid_236557) *\n            segmap_group_sizze_227127 + sext_i32_i64(local_tid_236556);\n    int64_t slice_236561 = n_203490;\n    int64_t slice_236562 = partition_sizze_203577 * slice_236561;\n    int64_t gtid_227130 = squot64(global_tid_236560, slice_236561);\n    int64_t remnant_236563 = global_tid_236560 - gtid_227130 * slice_236561;\n    int64_t gtid_227131 = remnant_236563;\n    int64_t remnant_236564 = remnant_236563 - gtid_227131;\n    \n    if (slt64(gtid_227130, partition_sizze_203577) && slt64(gtid_227131,\n                                                            n_203490)) {\n        int64_t x_227134;\n        \n        x_227134 = ((__global int64_t *) ext_mem_229197)[gtid_227130 *\n                                                         n_203490 +\n                                                         gtid_227131];\n        \n        bool cond_227135 = sle64((int64_t) 0, x_227134);\n        double defunc_0_f_res_227136;\n        \n        if (cond_227135) {\n            bool y_227137 = slt64(x_227134, n_203490);\n            bool bounds_check_227138 = cond_227135 && y_227137;\n            bool index_certs_227139;\n            \n            if (!bounds_check_227138) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 73) ==\n                   ",
            "     -1) {\n                        global_failure_args[0] = (int64_t) x_227134;\n                        global_failure_args[1] = (int64_t) n_203490;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            double defunc_0_f_res_t_res_227140;\n            \n            defunc_0_f_res_t_res_227140 = ((__global\n                                            double *) mem_231554)[gtid_227130 *\n                                                                  n_203490 +\n                                                                  x_227134];\n            defunc_0_f_res_227136 = defunc_0_f_res_t_res_227140;\n        } else {\n            defunc_0_f_res_227136 = INFINITY;\n        }\n        ((__global double *) mem_231559)[gtid_227130 * n_203490 + gtid_227131] =\n            defunc_0_f_res_227136;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_227127\n}\n__kernel void mainzisegmap_227261(__global int *global_failure,\n                                  int64_t n_203490,\n                                  int64_t partition_sizze_203577,\n                                  int64_t i_203670, int32_t iters_206665,\n                                  int64_t num_groups_227257,\n                                  int64_t num_threads_232227, __global\n                                  unsigned char *mem_231564, __global\n                                  unsigned char *mem_231674, __global\n                                  unsigned char *color_232062, __global\n                                  unsigned char *color_232063, __global\n                                  unsigned char *color_232064, __global\n                                  unsigned char *color_232065, __global\n                                  unsigned char *color_232066, __global\n                                  unsigned char *color_232067, __global\n                                  unsigned char *color_232068)\n{\n    #define segmap_group_sizze",
            "_227256 (mainzisegmap_group_sizze_227158)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236568;\n    int32_t local_tid_236569;\n    int64_t group_sizze_236572;\n    int32_t wave_sizze_236571;\n    int32_t group_tid_236570;\n    \n    global_tid_236568 = get_global_id(0);\n    local_tid_236569 = get_local_id(0);\n    group_sizze_236572 = get_local_size(0);\n    wave_sizze_236571 = LOCKSTEP_WIDTH;\n    group_tid_236570 = get_group_id(0);\n    \n    int32_t phys_tid_227261 = global_tid_236568;\n    int32_t phys_group_id_236573;\n    \n    phys_group_id_236573 = get_group_id(0);\n    for (int32_t i_236574 = 0; i_236574 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577,\n                                          segmap_group_sizze_227256)) -\n                   phys_group_id_236573, sext_i64_i32(num_groups_227257));\n         i_236574++) {\n        int32_t virt_group_id_236575 = phys_group_id_236573 + i_236574 *\n                sext_i64_i32(num_groups_227257);\n        int64_t global_tid_236576 = sext_i32_i64(virt_group_id_236575) *\n                segmap_group_sizze_227256 + sext_i32_i64(local_tid_236569);\n        int64_t slice_236577 = partition_sizze_203577;\n        int64_t gtid_227260 = global_tid_236576;\n        int64_t remnant_236578 = global_tid_236576 - gtid_227260;\n        \n        if (slt64(gtid_227260, partition_sizze_203577)) {\n            for (int64_t i_236579 = 0; i_236579 < n_203490; i_236579++) {\n                double tmp_236580;\n                \n                tmp_236580 = ((__global double *) mem_231564)[gtid_227260 +\n                                                              i_236579 *\n                                                              partition_sizze_203577];\n                ((__global double *) color_232062)[phys_tid_227261 + i_236579 *\n                                                   num_threads_232227] =\n    ",
            "                tmp_236580;\n            }\n            \n            __global unsigned char *ext_mem_231667;\n            __global unsigned char *ext_mem_unused_231956;\n            __global unsigned char *mem_param_231574;\n            __global unsigned char *mem_param_out_231957;\n            \n            mem_param_231574 = color_232062;\n            mem_param_out_231957 = color_232063;\n            for (int32_t i_227264 = 0; i_227264 < iters_206665; i_227264++) {\n                int32_t defunc_2_radix_sort_step_arg_227266 = mul32(2,\n                                                                    i_227264);\n                int32_t defunc_0_get_bit_arg_227267 = add32(1,\n                                                            defunc_2_radix_sort_step_arg_227266);\n                bool cond_f_res_227268 = defunc_0_get_bit_arg_227267 == 63;\n                bool cond_f_res_227269 = defunc_2_radix_sort_step_arg_227266 ==\n                     63;\n                int64_t unsign_arg_227270 =\n                        zext_i32_i64(defunc_0_get_bit_arg_227267);\n                int64_t unsign_arg_227271 =\n                        zext_i32_i64(defunc_2_radix_sort_step_arg_227266);\n                int64_t discard_229074;\n                int64_t discard_229075;\n                int64_t discard_229076;\n                int64_t discard_229077;\n                int64_t scanacc_229059;\n                int64_t scanacc_229060;\n                int64_t scanacc_229061;\n                int64_t scanacc_229062;\n                \n                scanacc_229059 = (int64_t) 0;\n                scanacc_229060 = (int64_t) 0;\n                scanacc_229061 = (int64_t) 0;\n                scanacc_229062 = (int64_t) 0;\n                for (int64_t i_229068 = 0; i_229068 < n_203490; i_229068++) {\n                    double x_227289;\n                    \n                    x_227289 = ((__global\n                                 double *) mem_param_231574)[phys_tid_227261 +\n                                     ",
            "                        i_229068 *\n                                                             num_threads_232227];\n                    \n                    int64_t i64_arg_227290;\n                    \n                    i64_arg_227290 = futrts_to_bits64(x_227289);\n                    \n                    int64_t unsign_arg_227291 = ashr64(i64_arg_227290,\n                                                       unsign_arg_227270);\n                    int64_t unsign_arg_227292 = (int64_t) 1 & unsign_arg_227291;\n                    int32_t to_i32_res_227293 = zext_i64_i32(unsign_arg_227292);\n                    int64_t unsign_arg_227294 = ashr64(i64_arg_227290,\n                                                       (int64_t) 63);\n                    int64_t unsign_arg_227295 = (int64_t) 1 & unsign_arg_227294;\n                    int32_t to_i32_res_227296 = zext_i64_i32(unsign_arg_227295);\n                    bool cond_227297 = to_i32_res_227296 == 1;\n                    bool x_227298 = !cond_227297;\n                    bool y_227299 = cond_f_res_227268 && x_227298;\n                    bool cond_227300 = cond_227297 || y_227299;\n                    int32_t defunc_1_get_bit_res_227301;\n                    \n                    if (cond_227300) {\n                        int32_t defunc_1_get_bit_res_t_res_227302 = 1 ^\n                                to_i32_res_227293;\n                        \n                        defunc_1_get_bit_res_227301 =\n                            defunc_1_get_bit_res_t_res_227302;\n                    } else {\n                        defunc_1_get_bit_res_227301 = to_i32_res_227293;\n                    }\n                    \n                    int32_t x_227303 = mul32(2, defunc_1_get_bit_res_227301);\n                    int64_t unsign_arg_227304 = ashr64(i64_arg_227290,\n                                                       unsign_arg_227271);\n                    int64_t unsign_arg_227305 = (int64_t) 1 & unsign_arg_227304;\n                    int3",
            "2_t to_i32_res_227306 = zext_i64_i32(unsign_arg_227305);\n                    bool y_227307 = cond_f_res_227269 && x_227298;\n                    bool cond_227308 = cond_227297 || y_227307;\n                    int32_t defunc_1_get_bit_res_227309;\n                    \n                    if (cond_227308) {\n                        int32_t defunc_1_get_bit_res_t_res_227310 = 1 ^\n                                to_i32_res_227306;\n                        \n                        defunc_1_get_bit_res_227309 =\n                            defunc_1_get_bit_res_t_res_227310;\n                    } else {\n                        defunc_1_get_bit_res_227309 = to_i32_res_227306;\n                    }\n                    \n                    int32_t defunc_0_f_res_227311 = add32(x_227303,\n                                                          defunc_1_get_bit_res_227309);\n                    bool cond_227312 = defunc_0_f_res_227311 == 0;\n                    int64_t defunc_0_f_res_227313 = btoi_bool_i64(cond_227312);\n                    int64_t defunc_0_f_res_227314;\n                    int64_t defunc_0_f_res_227315;\n                    int64_t defunc_0_f_res_227316;\n                    \n                    if (cond_227312) {\n                        defunc_0_f_res_227314 = (int64_t) 0;\n                        defunc_0_f_res_227315 = (int64_t) 0;\n                        defunc_0_f_res_227316 = (int64_t) 0;\n                    } else {\n                        bool cond_227317 = defunc_0_f_res_227311 == 1;\n                        int64_t defunc_0_f_res_f_res_227318 =\n                                btoi_bool_i64(cond_227317);\n                        int64_t defunc_0_f_res_f_res_227319;\n                        int64_t defunc_0_f_res_f_res_227320;\n                        \n                        if (cond_227317) {\n                            defunc_0_f_res_f_res_227319 = (int64_t) 0;\n                            defunc_0_f_res_f_res_227320 = (int64_t) 0;\n                        } else {",
            "\n                            bool cond_227321 = defunc_0_f_res_227311 == 2;\n                            int64_t defunc_0_f_res_f_res_f_res_227322 =\n                                    btoi_bool_i64(cond_227321);\n                            bool cond_neg_227323 = !cond_227321;\n                            int64_t defunc_0_f_res_f_res_f_res_227324 =\n                                    btoi_bool_i64(cond_neg_227323);\n                            \n                            defunc_0_f_res_f_res_227319 =\n                                defunc_0_f_res_f_res_f_res_227322;\n                            defunc_0_f_res_f_res_227320 =\n                                defunc_0_f_res_f_res_f_res_227324;\n                        }\n                        defunc_0_f_res_227314 = defunc_0_f_res_f_res_227318;\n                        defunc_0_f_res_227315 = defunc_0_f_res_f_res_227319;\n                        defunc_0_f_res_227316 = defunc_0_f_res_f_res_227320;\n                    }\n                    \n                    int64_t defunc_1_op_res_227285 =\n                            add64(defunc_0_f_res_227313, scanacc_229059);\n                    int64_t defunc_1_op_res_227286 =\n                            add64(defunc_0_f_res_227314, scanacc_229060);\n                    int64_t defunc_1_op_res_227287 =\n                            add64(defunc_0_f_res_227315, scanacc_229061);\n                    int64_t defunc_1_op_res_227288 =\n                            add64(defunc_0_f_res_227316, scanacc_229062);\n                    \n                    ((__global int64_t *) color_232068)[phys_tid_227261 +\n                                                        i_229068 *\n                                                        num_threads_232227] =\n                        defunc_1_op_res_227285;\n                    ((__global int64_t *) color_232067)[phys_tid_227261 +\n                                                        i_229068 *\n                                                        num_threads",
            "_232227] =\n                        defunc_1_op_res_227286;\n                    ((__global int64_t *) color_232066)[phys_tid_227261 +\n                                                        i_229068 *\n                                                        num_threads_232227] =\n                        defunc_1_op_res_227287;\n                    ((__global int64_t *) color_232065)[phys_tid_227261 +\n                                                        i_229068 *\n                                                        num_threads_232227] =\n                        defunc_1_op_res_227288;\n                    ((__global int32_t *) color_232064)[phys_tid_227261 +\n                                                        i_229068 *\n                                                        num_threads_232227] =\n                        defunc_0_f_res_227311;\n                    \n                    int64_t scanacc_tmp_236584 = defunc_1_op_res_227285;\n                    int64_t scanacc_tmp_236585 = defunc_1_op_res_227286;\n                    int64_t scanacc_tmp_236586 = defunc_1_op_res_227287;\n                    int64_t scanacc_tmp_236587 = defunc_1_op_res_227288;\n                    \n                    scanacc_229059 = scanacc_tmp_236584;\n                    scanacc_229060 = scanacc_tmp_236585;\n                    scanacc_229061 = scanacc_tmp_236586;\n                    scanacc_229062 = scanacc_tmp_236587;\n                }\n                discard_229074 = scanacc_229059;\n                discard_229075 = scanacc_229060;\n                discard_229076 = scanacc_229061;\n                discard_229077 = scanacc_229062;\n                \n                int64_t last_res_227325;\n                \n                last_res_227325 = ((__global\n                                    int64_t *) color_232068)[phys_tid_227261 +\n                                                             i_203670 *\n                                                             num_threads_232227];\n            ",
            "    \n                int64_t last_res_227326;\n                \n                last_res_227326 = ((__global\n                                    int64_t *) color_232067)[phys_tid_227261 +\n                                                             i_203670 *\n                                                             num_threads_232227];\n                \n                int64_t last_res_227327;\n                \n                last_res_227327 = ((__global\n                                    int64_t *) color_232066)[phys_tid_227261 +\n                                                             i_203670 *\n                                                             num_threads_232227];\n                for (int64_t i_236593 = 0; i_236593 < n_203490; i_236593++) {\n                    double tmp_236594;\n                    \n                    tmp_236594 = ((__global\n                                   double *) mem_param_231574)[phys_tid_227261 +\n                                                               i_236593 *\n                                                               num_threads_232227];\n                    ((__global double *) mem_param_out_231957)[phys_tid_227261 +\n                                                               i_236593 *\n                                                               num_threads_232227] =\n                        tmp_236594;\n                }\n                for (int64_t write_iter_229078 = 0; write_iter_229078 <\n                     n_203490; write_iter_229078++) {\n                    int32_t write_iv_229080;\n                    \n                    write_iv_229080 = ((__global\n                                        int32_t *) color_232064)[phys_tid_227261 +\n                                                                 write_iter_229078 *\n                                                                 num_threads_232227];\n                    \n                    bool match_lit_227336 = 0 == write_iv_229080;\n         ",
            "           int64_t defunc_1_f_res_227337;\n                    \n                    if (match_lit_227336) {\n                        int64_t write_iv_229081;\n                        \n                        write_iv_229081 = ((__global\n                                            int64_t *) color_232068)[phys_tid_227261 +\n                                                                     write_iter_229078 *\n                                                                     num_threads_232227];\n                        \n                        int64_t case_res_227338 = sub64(write_iv_229081,\n                                                        (int64_t) 1);\n                        \n                        defunc_1_f_res_227337 = case_res_227338;\n                    } else {\n                        bool match_lit_227339 = 1 == write_iv_229080;\n                        int64_t x_227340;\n                        \n                        if (match_lit_227339) {\n                            int64_t write_iv_229082;\n                            \n                            write_iv_229082 = ((__global\n                                                int64_t *) color_232067)[phys_tid_227261 +\n                                                                         write_iter_229078 *\n                                                                         num_threads_232227];\n                            \n                            int64_t x_227341 = add64(last_res_227325,\n                                                     write_iv_229082);\n                            int64_t case_res_227342 = sub64(x_227341,\n                                                            (int64_t) 1);\n                            \n                            x_227340 = case_res_227342;\n                        } else {\n                            bool match_lit_227343 = 2 == write_iv_229080;\n                            int64_t x_227344;\n                            \n                            if",
            " (match_lit_227343) {\n                                int64_t write_iv_229083;\n                                \n                                write_iv_229083 = ((__global\n                                                    int64_t *) color_232066)[phys_tid_227261 +\n                                                                             write_iter_229078 *\n                                                                             num_threads_232227];\n                                \n                                int64_t x_227345 = add64(last_res_227325,\n                                                         last_res_227326);\n                                int64_t x_227346 = add64(x_227345,\n                                                         write_iv_229083);\n                                int64_t case_res_227347 = sub64(x_227346,\n                                                                (int64_t) 1);\n                                \n                                x_227344 = case_res_227347;\n                            } else {\n                                int64_t write_iv_229084;\n                                \n                                write_iv_229084 = ((__global\n                                                    int64_t *) color_232065)[phys_tid_227261 +\n                                                                             write_iter_229078 *\n                                                                             num_threads_232227];\n                                \n                                int64_t x_227348 = add64(last_res_227325,\n                                                         last_res_227326);\n                                int64_t x_227349 = add64(last_res_227327,\n                                                         x_227348);\n                                int64_t x_227350 = add64(x_227349,\n                                                         write_iv_229084);\n                        ",
            "        int64_t defunc_1_f_res_res_227351 =\n                                        sub64(x_227350, (int64_t) 1);\n                                \n                                x_227344 = defunc_1_f_res_res_227351;\n                            }\n                            x_227340 = x_227344;\n                        }\n                        defunc_1_f_res_227337 = x_227340;\n                    }\n                    if (sle64((int64_t) 0, defunc_1_f_res_227337) &&\n                        slt64(defunc_1_f_res_227337, n_203490)) {\n                        for (int64_t i_236596 = 0; i_236596 < (int64_t) 1;\n                             i_236596++) {\n                            double tmp_236597;\n                            \n                            tmp_236597 = ((__global\n                                           double *) mem_param_231574)[phys_tid_227261 +\n                                                                       num_threads_232227 *\n                                                                       write_iter_229078 +\n                                                                       i_236596 *\n                                                                       num_threads_232227];\n                            ((__global\n                              double *) mem_param_out_231957)[phys_tid_227261 +\n                                                              num_threads_232227 *\n                                                              defunc_1_f_res_227337 +\n                                                              i_236596 *\n                                                              num_threads_232227] =\n                                tmp_236597;\n                        }\n                    }\n                }\n                \n                __global unsigned char *mem_param_tmp_236581;\n                \n                mem_param_tmp_236581 = mem_param_out_231957;\n                \n                __global unsigned char *me",
            "m_param_out_tmp_236582;\n                \n                mem_param_out_tmp_236582 = mem_param_231574;\n                mem_param_231574 = mem_param_tmp_236581;\n                mem_param_out_231957 = mem_param_out_tmp_236582;\n            }\n            ext_mem_231667 = mem_param_231574;\n            ext_mem_unused_231956 = mem_param_out_231957;\n            for (int64_t i_236598 = 0; i_236598 < n_203490; i_236598++) {\n                double tmp_236599;\n                \n                tmp_236599 = ((__global\n                               double *) ext_mem_231667)[phys_tid_227261 +\n                                                         i_236598 *\n                                                         num_threads_232227];\n                ((__global double *) mem_231674)[gtid_227260 + i_236598 *\n                                                 partition_sizze_203577] =\n                    tmp_236599;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_227256\n}\n__kernel void mainzisegmap_227986(__global int *global_failure,\n                                  int64_t n_203490,\n                                  int64_t partition_sizze_203577,\n                                  int64_t i_203670, __global\n                                  unsigned char *mem_param_231733, __global\n                                  unsigned char *mem_231739, __global\n                                  unsigned char *mem_231769, __global\n                                  unsigned char *mem_231773, __global\n                                  unsigned char *mem_231777, __global\n                                  unsigned char *mem_231781, __global\n                                  unsigned char *mem_231785)\n{\n    #define segmap_group_sizze_227981 (mainzisegmap_group_sizze_227577)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= ",
            "0)\n        return;\n    \n    int32_t global_tid_236943;\n    int32_t local_tid_236944;\n    int64_t group_sizze_236947;\n    int32_t wave_sizze_236946;\n    int32_t group_tid_236945;\n    \n    global_tid_236943 = get_global_id(0);\n    local_tid_236944 = get_local_id(0);\n    group_sizze_236947 = get_local_size(0);\n    wave_sizze_236946 = LOCKSTEP_WIDTH;\n    group_tid_236945 = get_group_id(0);\n    \n    int32_t phys_tid_227986 = global_tid_236943;\n    int64_t global_tid_236948 = sext_i32_i64(group_tid_236945) *\n            segmap_group_sizze_227981 + sext_i32_i64(local_tid_236944);\n    int64_t slice_236949 = n_203490;\n    int64_t slice_236950 = partition_sizze_203577 * slice_236949;\n    int64_t gtid_227984 = squot64(global_tid_236948, slice_236949);\n    int64_t remnant_236951 = global_tid_236948 - gtid_227984 * slice_236949;\n    int64_t gtid_227985 = remnant_236951;\n    int64_t remnant_236952 = remnant_236951 - gtid_227985;\n    \n    if (slt64(gtid_227984, partition_sizze_203577) && slt64(gtid_227985,\n                                                            n_203490)) {\n        int32_t x_227990;\n        \n        x_227990 = ((__global int32_t *) mem_231785)[gtid_227984 * n_203490 +\n                                                     gtid_227985];\n        \n        double write_value_227995;\n        \n        write_value_227995 = ((__global\n                               double *) mem_param_231733)[gtid_227984 *\n                                                           n_203490 +\n                                                           gtid_227985];\n        \n        bool match_lit_227996 = 0 == x_227990;\n        int64_t defunc_1_f_res_227997;\n        \n        if (match_lit_227996) {\n            int64_t x_227991;\n            \n            x_227991 = ((__global int64_t *) mem_231769)[gtid_227984 *\n                                                         n_203490 +\n                                                         gtid_227985];\n            \n            int64_t case_res_",
            "227998 = sub64(x_227991, (int64_t) 1);\n            \n            defunc_1_f_res_227997 = case_res_227998;\n        } else {\n            int64_t last_res_227987;\n            \n            last_res_227987 = ((__global int64_t *) mem_231769)[gtid_227984 *\n                                                                n_203490 +\n                                                                i_203670];\n            \n            bool match_lit_227999 = 1 == x_227990;\n            int64_t x_228000;\n            \n            if (match_lit_227999) {\n                int64_t x_227992;\n                \n                x_227992 = ((__global int64_t *) mem_231773)[gtid_227984 *\n                                                             n_203490 +\n                                                             gtid_227985];\n                \n                int64_t x_228001 = add64(last_res_227987, x_227992);\n                int64_t case_res_228002 = sub64(x_228001, (int64_t) 1);\n                \n                x_228000 = case_res_228002;\n            } else {\n                int64_t last_res_227988;\n                \n                last_res_227988 = ((__global\n                                    int64_t *) mem_231773)[gtid_227984 *\n                                                           n_203490 + i_203670];\n                \n                bool match_lit_228003 = 2 == x_227990;\n                int64_t x_228004;\n                \n                if (match_lit_228003) {\n                    int64_t x_227993;\n                    \n                    x_227993 = ((__global int64_t *) mem_231777)[gtid_227984 *\n                                                                 n_203490 +\n                                                                 gtid_227985];\n                    \n                    int64_t x_228005 = add64(last_res_227987, last_res_227988);\n                    int64_t x_228006 = add64(x_227993, x_228005);\n                    int64_t case_res_228007 = sub64(x_228006, (i",
            "nt64_t) 1);\n                    \n                    x_228004 = case_res_228007;\n                } else {\n                    int64_t last_res_227989;\n                    \n                    last_res_227989 = ((__global\n                                        int64_t *) mem_231777)[gtid_227984 *\n                                                               n_203490 +\n                                                               i_203670];\n                    \n                    int64_t x_227994;\n                    \n                    x_227994 = ((__global int64_t *) mem_231781)[gtid_227984 *\n                                                                 n_203490 +\n                                                                 gtid_227985];\n                    \n                    int64_t x_228008 = add64(last_res_227987, last_res_227988);\n                    int64_t x_228009 = add64(last_res_227989, x_228008);\n                    int64_t x_228010 = add64(x_227994, x_228009);\n                    int64_t defunc_1_f_res_res_228011 = sub64(x_228010,\n                                                              (int64_t) 1);\n                    \n                    x_228004 = defunc_1_f_res_res_228011;\n                }\n                x_228000 = x_228004;\n            }\n            defunc_1_f_res_227997 = x_228000;\n        }\n        if ((sle64((int64_t) 0, gtid_227984) && slt64(gtid_227984,\n                                                      partition_sizze_203577)) &&\n            (sle64((int64_t) 0, defunc_1_f_res_227997) &&\n             slt64(defunc_1_f_res_227997, n_203490))) {\n            ((__global double *) mem_231739)[gtid_227984 * n_203490 +\n                                             defunc_1_f_res_227997] =\n                write_value_227995;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_227981\n}\n__kernel void mainzisegmap_228041(__global int *global_failure,\n                                  int64_t partition_sizze_2035",
            "77,\n                                  int64_t stl_res_203664, int64_t j_m_i_204133,\n                                  __global unsigned char *mem_231819, __global\n                                  unsigned char *mem_231823, __global\n                                  unsigned char *mem_231826, __global\n                                  unsigned char *mem_231829)\n{\n    #define segmap_group_sizze_228035 (mainzisegmap_group_sizze_228020)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236957;\n    int32_t local_tid_236958;\n    int64_t group_sizze_236961;\n    int32_t wave_sizze_236960;\n    int32_t group_tid_236959;\n    \n    global_tid_236957 = get_global_id(0);\n    local_tid_236958 = get_local_id(0);\n    group_sizze_236961 = get_local_size(0);\n    wave_sizze_236960 = LOCKSTEP_WIDTH;\n    group_tid_236959 = get_group_id(0);\n    \n    int32_t phys_tid_228041 = global_tid_236957;\n    int64_t global_tid_236962 = sext_i32_i64(group_tid_236959) *\n            segmap_group_sizze_228035 + sext_i32_i64(local_tid_236958);\n    int64_t slice_236963 = partition_sizze_203577;\n    int64_t gtid_228040 = global_tid_236962;\n    int64_t remnant_236964 = global_tid_236962 - gtid_228040;\n    \n    if (slt64(gtid_228040, partition_sizze_203577)) {\n        double defunc_2_reduce_res_228043;\n        double redout_229087 = 0.0;\n        \n        for (int64_t i_229088 = 0; i_229088 < j_m_i_204133; i_229088++) {\n            int64_t slice_229093 = stl_res_203664 + i_229088;\n            double x_228047;\n            \n            x_228047 = ((__global double *) mem_231819)[slice_229093 *\n                                                        partition_sizze_203577 +\n                                                        gtid_228040];\n            \n            double defunc_1_op_res_228046 = x_228047 + redout_229087;\n            double redout_tmp_236965 = defunc_1_op_res_228046;\n    ",
            "        \n            redout_229087 = redout_tmp_236965;\n        }\n        defunc_2_reduce_res_228043 = redout_229087;\n        \n        double h_228048 = 3.0 * defunc_2_reduce_res_228043;\n        double h9_228049 = 0.999 * h_228048;\n        double h1_228050 = 1.0e-3 * h_228048;\n        \n        ((__global double *) mem_231823)[gtid_228040] = h_228048;\n        ((__global double *) mem_231826)[gtid_228040] = h9_228049;\n        ((__global double *) mem_231829)[gtid_228040] = h1_228050;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_228035\n}\n__kernel void mainzisegmap_228103(__global int *global_failure,\n                                  int64_t partition_sizze_203577, __global\n                                  unsigned char *mem_231833, __global\n                                  unsigned char *mem_231837, __global\n                                  unsigned char *mem_231840, __global\n                                  unsigned char *mem_231843)\n{\n    #define segmap_group_sizze_228097 (mainzisegmap_group_sizze_228055)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_237034;\n    int32_t local_tid_237035;\n    int64_t group_sizze_237038;\n    int32_t wave_sizze_237037;\n    int32_t group_tid_237036;\n    \n    global_tid_237034 = get_global_id(0);\n    local_tid_237035 = get_local_id(0);\n    group_sizze_237038 = get_local_size(0);\n    wave_sizze_237037 = LOCKSTEP_WIDTH;\n    group_tid_237036 = get_group_id(0);\n    \n    int32_t phys_tid_228103 = global_tid_237034;\n    int64_t global_tid_237039 = sext_i32_i64(group_tid_237036) *\n            segmap_group_sizze_228097 + sext_i32_i64(local_tid_237035);\n    int64_t slice_237040 = partition_sizze_203577;\n    int64_t gtid_228102 = global_tid_237039;\n    int64_t remnant_237041 = global_tid_237039 - gtid_228102;\n    \n    if (slt64(gtid_228102, partition_sizze_203577)) {\n        double defunc_2_reduce_r",
            "es_228104;\n        \n        defunc_2_reduce_res_228104 = ((__global\n                                       double *) mem_231833)[gtid_228102];\n        \n        double h_228105 = 3.0 * defunc_2_reduce_res_228104;\n        double h9_228106 = 0.999 * h_228105;\n        double h1_228107 = 1.0e-3 * h_228105;\n        \n        ((__global double *) mem_231837)[gtid_228102] = h_228105;\n        ((__global double *) mem_231840)[gtid_228102] = h9_228106;\n        ((__global double *) mem_231843)[gtid_228102] = h1_228107;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_228097\n}\n__kernel void mainzisegmap_228189(__global int *global_failure,\n                                  int64_t n_203490,\n                                  int64_t partition_sizze_203577, __global\n                                  unsigned char *ext_mem_231560, __global\n                                  unsigned char *ext_mem_231844, __global\n                                  unsigned char *ext_mem_231845, __global\n                                  unsigned char *ext_mem_231846, __global\n                                  unsigned char *mem_231851)\n{\n    #define segmap_group_sizze_228184 (mainzisegmap_group_sizze_228124)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_237043;\n    int32_t local_tid_237044;\n    int64_t group_sizze_237047;\n    int32_t wave_sizze_237046;\n    int32_t group_tid_237045;\n    \n    global_tid_237043 = get_global_id(0);\n    local_tid_237044 = get_local_id(0);\n    group_sizze_237047 = get_local_size(0);\n    wave_sizze_237046 = LOCKSTEP_WIDTH;\n    group_tid_237045 = get_group_id(0);\n    \n    int32_t phys_tid_228189 = global_tid_237043;\n    int64_t global_tid_237048 = sext_i32_i64(group_tid_237045) *\n            segmap_group_sizze_228184 + sext_i32_i64(local_tid_237044);\n    int64_t slice_237049 = n_203490;\n    int64_t slice_237050 = partition_sizze_203577",
            " * slice_237049;\n    int64_t gtid_228187 = squot64(global_tid_237048, slice_237049);\n    int64_t remnant_237051 = global_tid_237048 - gtid_228187 * slice_237049;\n    int64_t gtid_228188 = remnant_237051;\n    int64_t remnant_237052 = remnant_237051 - gtid_228188;\n    \n    if (slt64(gtid_228187, partition_sizze_203577) && slt64(gtid_228188,\n                                                            n_203490)) {\n        double x_228190;\n        \n        x_228190 = ((__global double *) ext_mem_231846)[gtid_228187];\n        \n        double x_228192;\n        \n        x_228192 = ((__global double *) ext_mem_231844)[gtid_228187];\n        \n        double x_228193;\n        \n        x_228193 = ((__global double *) ext_mem_231560)[gtid_228187 * n_203490 +\n                                                        gtid_228188];\n        \n        double x_228194 = x_228193 / x_228190;\n        double y_228195 = fpow64(x_228194, 2.0);\n        double x_228196 = 1.0 - y_228195;\n        double bicube_228197 = fpow64(x_228196, 2.0);\n        bool isnan_res_228198;\n        \n        isnan_res_228198 = futrts_isnan64(x_228193);\n        \n        bool cond_f_res_228199 = x_228193 <= x_228192;\n        bool x_228200 = !isnan_res_228198;\n        bool y_228201 = cond_f_res_228199 && x_228200;\n        bool cond_228202 = isnan_res_228198 || y_228201;\n        double defunc_0_f_res_228203;\n        \n        if (cond_228202) {\n            defunc_0_f_res_228203 = 1.0;\n        } else {\n            double x_228191;\n            \n            x_228191 = ((__global double *) ext_mem_231845)[gtid_228187];\n            \n            bool cond_228204 = x_228191 <= x_228193;\n            bool cond_f_res_228205 = x_228193 <= 1.0e-6;\n            bool x_228206 = !cond_228204;\n            bool y_228207 = cond_f_res_228205 && x_228206;\n            bool cond_228208 = cond_228204 || y_228207;\n            double defunc_0_f_res_f_res_228209;\n            \n            if (cond_228208) {\n                defunc_0_f_res_f_res_22820",
            "9 = 1.0e-6;\n            } else {\n                defunc_0_f_res_f_res_228209 = bicube_228197;\n            }\n            defunc_0_f_res_228203 = defunc_0_f_res_f_res_228209;\n        }\n        ((__global double *) mem_231851)[gtid_228187 * n_203490 + gtid_228188] =\n            defunc_0_f_res_228203;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_228184\n}\n__kernel void mainzisegmap_228212(__global int *global_failure,\n                                  int64_t m_203489, int64_t n_203490,\n                                  int64_t partition_sizze_203577,\n                                  int64_t num_groups_228217,\n                                  int64_t num_threads_232245, __global\n                                  unsigned char *mem_229161, __global\n                                  unsigned char *mem_229164, __global\n                                  unsigned char *mem_231887, __global\n                                  unsigned char *mem_231891, __global\n                                  unsigned char *mem_231895, __global\n                                  unsigned char *mem_231898, __global\n                                  unsigned char *mem_231901, __global\n                                  unsigned char *color_232083)\n{\n    #define segmap_group_sizze_228215 (mainzisegmap_group_sizze_228214)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_237054;\n    int32_t local_tid_237055;\n    int64_t group_sizze_237058;\n    int32_t wave_sizze_237057;\n    int32_t group_tid_237056;\n    \n    global_tid_237054 = get_global_id(0);\n    local_tid_237055 = get_local_id(0);\n    group_sizze_237058 = get_local_size(0);\n    wave_sizze_237057 = LOCKSTEP_WIDTH;\n    group_tid_237056 = get_group_id(0);\n    \n    int32_t phys_tid_228212 = global_tid_237054;\n    int32_t phys_group_id_237059;\n    \n    phys_group_id_237059 = get_group_id(0);\n    for (int32_t",
            " i_237060 = 0; i_237060 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577,\n                                          segmap_group_sizze_228215)) -\n                   phys_group_id_237059, sext_i64_i32(num_groups_228217));\n         i_237060++) {\n        int32_t virt_group_id_237061 = phys_group_id_237059 + i_237060 *\n                sext_i64_i32(num_groups_228217);\n        int64_t global_tid_237062 = sext_i32_i64(virt_group_id_237061) *\n                segmap_group_sizze_228215 + sext_i32_i64(local_tid_237055);\n        int64_t slice_237063 = partition_sizze_203577;\n        int64_t write_i_228211 = global_tid_237062;\n        int64_t remnant_237064 = global_tid_237062 - write_i_228211;\n        \n        if (slt64(write_i_228211, partition_sizze_203577)) {\n            int64_t write_index_206853;\n            \n            write_index_206853 = ((__global\n                                   int64_t *) mem_229164)[write_i_228211];\n            for (int64_t i_229091 = 0; i_229091 < n_203490; i_229091++) {\n                double x_206855;\n                \n                x_206855 = ((__global double *) mem_229161)[write_i_228211 *\n                                                            n_203490 +\n                                                            i_229091];\n                \n                double x_206856;\n                \n                x_206856 = ((__global double *) mem_231898)[i_229091 *\n                                                            partition_sizze_203577 +\n                                                            write_i_228211];\n                \n                double x_206857;\n                \n                x_206857 = ((__global double *) mem_231901)[i_229091 *\n                                                            partition_sizze_203577 +\n                                                            write_i_228211];\n                \n                double x_206858 = x_206855 - x_206856;\n                double defunc_2_f_",
            "res_206859 = x_206858 - x_206857;\n                \n                ((__global double *) color_232083)[phys_tid_228212 + i_229091 *\n                                                   num_threads_232245] =\n                    defunc_2_f_res_206859;\n            }\n            if (sle64((int64_t) 0, write_index_206853) &&\n                slt64(write_index_206853, m_203489)) {\n                for (int64_t i_237066 = 0; i_237066 < n_203490; i_237066++) {\n                    double tmp_237067;\n                    \n                    tmp_237067 = ((__global\n                                   double *) color_232083)[phys_tid_228212 +\n                                                           i_237066 *\n                                                           num_threads_232245];\n                    ((__global double *) mem_231895)[write_index_206853 *\n                                                     n_203490 + i_237066] =\n                        tmp_237067;\n                }\n            }\n            if (sle64((int64_t) 0, write_index_206853) &&\n                slt64(write_index_206853, m_203489)) {\n                for (int64_t i_237068 = 0; i_237068 < n_203490; i_237068++) {\n                    double tmp_237069;\n                    \n                    tmp_237069 = ((__global\n                                   double *) mem_231901)[write_i_228211 +\n                                                         i_237068 *\n                                                         partition_sizze_203577];\n                    ((__global double *) mem_231891)[write_index_206853 *\n                                                     n_203490 + i_237068] =\n                        tmp_237069;\n                }\n            }\n            if (sle64((int64_t) 0, write_index_206853) &&\n                slt64(write_index_206853, m_203489)) {\n                for (int64_t i_237070 = 0; i_237070 < n_203490; i_237070++) {\n                    double tmp_237071;\n                    \n           ",
            "         tmp_237071 = ((__global\n                                   double *) mem_231898)[write_i_228211 +\n                                                         i_237070 *\n                                                         partition_sizze_203577];\n                    ((__global double *) mem_231887)[write_index_206853 *\n                                                     n_203490 + i_237070] =\n                        tmp_237071;\n                }\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_228215\n}\n__kernel void mainzisegmap_intragroup_206893(__global int *global_failure,\n                                             uint color_231965_backing_offset_0,\n                                             uint color_231964_backing_offset_1,\n                                             int64_t n_203490,\n                                             int64_t partition_sizze_203577,\n                                             int64_t i_203670, __global\n                                             unsigned char *mem_229161, __global\n                                             unsigned char *mem_229178, __global\n                                             unsigned char *mem_229181)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *color_231965_backing_1 =\n                           &shared_mem[color_231965_backing_offset_0];\n    volatile unsigned char *color_231964_backing_0 =\n                           &shared_mem[color_231964_backing_offset_1];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_232375;\n    int32_t local_tid_232376;\n    int64_t group_sizze_232379;\n    int32_t wave_sizze_232378;\n    int32_t group_tid_232377;\n    \n    global_tid_232375 = get_global_id(0);\n    local_tid_232376 = get_local_id(0);\n    group_sizze_232379 = get_local_size(0);\n    wave_sizze_23",
            "2378 = LOCKSTEP_WIDTH;\n    group_tid_232377 = get_group_id(0);\n    \n    int32_t phys_tid_206893 = group_tid_232377;\n    int64_t slice_232381 = n_203490;\n    int64_t ltid_pre_232380 = sext_i32_i64(local_tid_232376);\n    int64_t remnant_232382 = sext_i32_i64(local_tid_232376) - ltid_pre_232380;\n    int64_t slice_232383 = partition_sizze_203577;\n    int64_t gtid_206892 = sext_i32_i64(group_tid_232377);\n    int64_t remnant_232384 = sext_i32_i64(group_tid_232377) - gtid_206892;\n    __local unsigned char *color_231964;\n    \n    color_231964 = (__local unsigned char *) color_231964_backing_0;\n    \n    __local unsigned char *color_231965;\n    \n    color_231965 = (__local unsigned char *) color_231965_backing_1;\n    \n    int64_t gtid_206897 = sext_i32_i64(sext_i64_i32(ltid_pre_232380));\n    int32_t phys_tid_206898 = local_tid_232376;\n    double x_206902;\n    \n    x_206902 = ((__global double *) mem_229161)[gtid_206892 * n_203490 +\n                                                gtid_206897];\n    \n    bool isnan_res_206903;\n    \n    isnan_res_206903 = futrts_isnan64(x_206902);\n    \n    bool defunc_0_p_res_206904 = !isnan_res_206903;\n    int64_t defunc_0_f_res_206905 = btoi_bool_i64(defunc_0_p_res_206904);\n    \n    ((__local int64_t *) color_231965)[gtid_206897] = defunc_0_f_res_206905;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t dims_flat_232385 = n_203490;\n    int64_t x_206899;\n    int64_t x_206900;\n    int64_t x_232387;\n    int64_t x_232388;\n    bool ltid_in_bounds_232390 = slt64(sext_i32_i64(local_tid_232376),\n                                       n_203490);\n    int32_t skip_threads_232391;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_232390) {\n            x_206900 = ((volatile __local\n                         int64_t *) color_231965)[sext_i32_i64(local_tid_232376)];\n            if ((local_tid_232376 - squot32(local_tid_232376, 32) * 32) == 0) {\n                x_206899 = x_206900;\n            }\n        }\n    }\n    // in-block scan (hop",
            "efully no barriers needed)\n    {\n        skip_threads_232391 = 1;\n        while (slt32(skip_threads_232391, 32)) {\n            bool thread_active_232392 = sle32(skip_threads_232391,\n                                              local_tid_232376 -\n                                              squot32(local_tid_232376, 32) *\n                                              32) && ltid_in_bounds_232390;\n            \n            if (thread_active_232392) {\n                // read operands\n                {\n                    x_206899 = ((volatile __local\n                                 int64_t *) color_231965)[sext_i32_i64(local_tid_232376) -\n                                                          sext_i32_i64(skip_threads_232391)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_232393 =\n                     slt64(srem64(sext_i32_i64(local_tid_232376), n_203490),\n                           sext_i32_i64(local_tid_232376) -\n                           sext_i32_i64(local_tid_232376 -\n                           skip_threads_232391));\n                \n                if (thread_active_232392 && inactive_232393) {\n                    x_206899 = x_206900;\n                }\n                if (thread_active_232392) {\n                    if (!inactive_232393) {\n                        int64_t defunc_1_op_res_206901 = add64(x_206899,\n                                                               x_206900);\n                        \n                        x_206899 = defunc_1_op_res_206901;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_232378, skip_threads_232391)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (thread_active_232392) {\n                // write result\n                {\n                    ((volatile __local\n                      int64_t *) color_231965)[sext_i32_i64(local_tid_232376)] =\n                        x_206899;\n               ",
            "     x_206900 = x_206899;\n                }\n            }\n            if (sle32(wave_sizze_232378, skip_threads_232391)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_232391 *= 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_232376 - squot32(local_tid_232376, 32) * 32) == 31 &&\n            ltid_in_bounds_232390) {\n            ((volatile __local\n              int64_t *) color_231965)[sext_i32_i64(squot32(local_tid_232376,\n                                                            32))] = x_206899;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n    {\n        int32_t skip_threads_232394;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_232376, 32) == 0 && ltid_in_bounds_232390) {\n                x_232388 = ((volatile __local\n                             int64_t *) color_231965)[sext_i32_i64(local_tid_232376)];\n                if ((local_tid_232376 - squot32(local_tid_232376, 32) * 32) ==\n                    0) {\n                    x_232387 = x_232388;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_232394 = 1;\n            while (slt32(skip_threads_232394, 32)) {\n                bool thread_active_232395 = sle32(skip_threads_232394,\n                                                  local_tid_232376 -\n                                                  squot32(local_tid_232376,\n                                                          32) * 32) &&\n                     (squot32(local_tid_232376, 32) == 0 &&\n                      ltid_in_bounds_232390);\n                \n                if (thread_active_232395) {\n                    // read operands\n                    {\n                        x_232387 = ((volatile __loca",
            "l\n                                     int64_t *) color_231965)[sext_i32_i64(local_tid_232376) -\n                                                              sext_i32_i64(skip_threads_232394)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_232396 =\n                         slt64(srem64(sext_i32_i64(local_tid_232376 * 32 + 32 -\n                                      1), n_203490),\n                               sext_i32_i64(local_tid_232376 * 32 + 32 - 1) -\n                               sext_i32_i64((local_tid_232376 -\n                                             skip_threads_232394) * 32 + 32 -\n                               1));\n                    \n                    if (thread_active_232395 && inactive_232396) {\n                        x_232387 = x_232388;\n                    }\n                    if (thread_active_232395) {\n                        if (!inactive_232396) {\n                            int64_t defunc_1_op_res_232389 = add64(x_232387,\n                                                                   x_232388);\n                            \n                            x_232387 = defunc_1_op_res_232389;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_232378, skip_threads_232394)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_232395) {\n                    // write result\n                    {\n                        ((volatile __local\n                          int64_t *) color_231965)[sext_i32_i64(local_tid_232376)] =\n                            x_232387;\n                        x_232388 = x_232387;\n                    }\n                }\n                if (sle32(wave_sizze_232378, skip_threads_232394)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_232394 *= 2;\n            }\n        }\n    }\n    barrier(CLK",
            "_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_232397 = squot32(local_tid_232376, 32) == 0 ||\n         !ltid_in_bounds_232390;\n    \n    // carry-in for every block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_232397) {\n                x_206900 = x_206899;\n                x_206899 = ((__local\n                             int64_t *) color_231965)[sext_i32_i64(squot32(local_tid_232376,\n                                                                           32)) -\n                                                      (int64_t) 1];\n            }\n        }\n        // perform operation\n        {\n            bool inactive_232398 = slt64(srem64(sext_i32_i64(local_tid_232376),\n                                                n_203490),\n                                         sext_i32_i64(local_tid_232376) -\n                                         sext_i32_i64(squot32(local_tid_232376,\n                                                              32) * 32 - 1));\n            \n            if (!no_carry_in_232397) {\n                if (inactive_232398) {\n                    x_206899 = x_206900;\n                }\n            }\n            if (!no_carry_in_232397) {\n                if (!inactive_232398) {\n                    int64_t defunc_1_op_res_206901 = add64(x_206899, x_206900);\n                    \n                    x_206899 = defunc_1_op_res_206901;\n                }\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_232397) {\n                ((__local\n                  int64_t *) color_231965)[sext_i32_i64(local_tid_232376)] =\n                    x_206899;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_232376, 32) == 0 && ltid_in_bounds_232390) {\n            ((__local int64_t *) color_231965)[sext_i32_i64(local_tid_232376)] =\n                x_206900;\n        }\n    }\n    barrier(CLK_LOCAL_M",
            "EM_FENCE);\n    \n    int64_t last_res_206906;\n    \n    last_res_206906 = ((__local int64_t *) color_231965)[i_203670];\n    ((__local int64_t *) color_231964)[sext_i32_i64(local_tid_232376)] =\n        (int64_t) -1;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t write_i_206909 = sext_i32_i64(sext_i64_i32(ltid_pre_232380));\n    int32_t phys_tid_206910 = local_tid_232376;\n    double x_206911;\n    \n    x_206911 = ((__global double *) mem_229161)[gtid_206892 * n_203490 +\n                                                write_i_206909];\n    \n    bool isnan_res_206914;\n    \n    isnan_res_206914 = futrts_isnan64(x_206911);\n    \n    bool defunc_0_p_res_206915 = !isnan_res_206914;\n    int64_t defunc_1_f_res_206916;\n    \n    if (defunc_0_p_res_206915) {\n        int64_t x_206912;\n        \n        x_206912 = ((__local int64_t *) color_231965)[write_i_206909];\n        \n        int64_t defunc_1_f_res_t_res_206917 = sub64(x_206912, (int64_t) 1);\n        \n        defunc_1_f_res_206916 = defunc_1_f_res_t_res_206917;\n    } else {\n        defunc_1_f_res_206916 = (int64_t) -1;\n    }\n    if (sle64((int64_t) 0, defunc_1_f_res_206916) &&\n        slt64(defunc_1_f_res_206916, n_203490)) {\n        ((__local int64_t *) color_231964)[defunc_1_f_res_206916] =\n            write_i_206909;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t tmp_232399;\n    \n    tmp_232399 = ((__local\n                   int64_t *) color_231964)[sext_i32_i64(local_tid_232376)];\n    ((__global int64_t *) mem_229178)[gtid_206892 * n_203490 +\n                                      sext_i32_i64(local_tid_232376)] =\n        tmp_232399;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    if (local_tid_232376 == 0) {\n        ((__global int64_t *) mem_229181)[gtid_206892] = last_res_206906;\n    }\n    \n  error_2:\n    return;\n}\n__kernel void mainzisegmap_intragroup_207248(__global int *global_failure,\n                                             uint color_231967_backing_offset_0,\n                                             uint color",
            "_231966_backing_offset_1,\n                                             int64_t n_p_203492,\n                                             int64_t partition_sizze_203577,\n                                             int64_t defunc_0_f_res_203631,\n                                             int64_t i_203718,\n                                             int64_t computed_group_sizze_207187,\n                                             __global unsigned char *mem_229206,\n                                             __global unsigned char *mem_229222,\n                                             __global unsigned char *mem_229226)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *color_231967_backing_1 =\n                           &shared_mem[color_231967_backing_offset_0];\n    volatile unsigned char *color_231966_backing_0 =\n                           &shared_mem[color_231966_backing_offset_1];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_232548;\n    int32_t local_tid_232549;\n    int64_t group_sizze_232552;\n    int32_t wave_sizze_232551;\n    int32_t group_tid_232550;\n    \n    global_tid_232548 = get_global_id(0);\n    local_tid_232549 = get_local_id(0);\n    group_sizze_232552 = get_local_size(0);\n    wave_sizze_232551 = LOCKSTEP_WIDTH;\n    group_tid_232550 = get_group_id(0);\n    \n    int32_t phys_tid_207248 = group_tid_232550;\n    int64_t slice_232555 = defunc_0_f_res_203631;\n    int64_t slice_232556 = n_p_203492 * slice_232555;\n    int64_t ltid_pre_232553 = squot64(sext_i32_i64(local_tid_232549),\n                                      slice_232555);\n    int64_t remnant_232557 = sext_i32_i64(local_tid_232549) - ltid_pre_232553 *\n            slice_232555;\n    int64_t ltid_pre_232554 = remnant_232557;\n    int64_t remnant_232558 = remnant_232557 - ltid_pre_232554;\n    int64_t slice_232559 = partition_sizze_203577;\n    int64_t gtid_207247 = sext_i32_i64(group_tid_232550);\n   ",
            " int64_t remnant_232560 = sext_i32_i64(group_tid_232550) - gtid_207247;\n    __local unsigned char *color_231966;\n    \n    color_231966 = (__local unsigned char *) color_231966_backing_0;\n    \n    __local unsigned char *color_231967;\n    \n    color_231967 = (__local unsigned char *) color_231967_backing_1;\n    \n    int64_t gtid_207252 = sext_i32_i64(sext_i64_i32(ltid_pre_232553));\n    int64_t gtid_207253 = sext_i32_i64(sext_i64_i32(ltid_pre_232554));\n    int32_t phys_tid_207254 = local_tid_232549;\n    \n    if (slt64(gtid_207252, n_p_203492) && slt64(gtid_207253,\n                                                defunc_0_f_res_203631)) {\n        double x_207259;\n        \n        x_207259 = ((__global double *) mem_229206)[gtid_207247 *\n                                                    (defunc_0_f_res_203631 *\n                                                     n_p_203492) + gtid_207252 *\n                                                    defunc_0_f_res_203631 +\n                                                    gtid_207253];\n        \n        bool isnan_res_207260;\n        \n        isnan_res_207260 = futrts_isnan64(x_207259);\n        \n        bool defunc_0_p_res_207261 = !isnan_res_207260;\n        int64_t defunc_0_f_res_207262 = btoi_bool_i64(defunc_0_p_res_207261);\n        \n        ((__local int64_t *) color_231967)[gtid_207252 * defunc_0_f_res_203631 +\n                                           gtid_207253] = defunc_0_f_res_207262;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t dims_flat_232561 = n_p_203492 * defunc_0_f_res_203631;\n    int64_t x_207255;\n    int64_t x_207256;\n    int64_t x_232563;\n    int64_t x_232564;\n    bool ltid_in_bounds_232566 = slt64(sext_i32_i64(local_tid_232549),\n                                       n_p_203492 * defunc_0_f_res_203631);\n    int32_t skip_threads_232567;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_232566) {\n            x_207256 = ((volatile __local\n                         int64_t *) ",
            "color_231967)[sext_i32_i64(local_tid_232549)];\n            if ((local_tid_232549 - squot32(local_tid_232549, 32) * 32) == 0) {\n                x_207255 = x_207256;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_232567 = 1;\n        while (slt32(skip_threads_232567, 32)) {\n            bool thread_active_232568 = sle32(skip_threads_232567,\n                                              local_tid_232549 -\n                                              squot32(local_tid_232549, 32) *\n                                              32) && ltid_in_bounds_232566;\n            \n            if (thread_active_232568) {\n                // read operands\n                {\n                    x_207255 = ((volatile __local\n                                 int64_t *) color_231967)[sext_i32_i64(local_tid_232549) -\n                                                          sext_i32_i64(skip_threads_232567)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_232569 =\n                     slt64(srem64(sext_i32_i64(local_tid_232549),\n                                  defunc_0_f_res_203631),\n                           sext_i32_i64(local_tid_232549) -\n                           sext_i32_i64(local_tid_232549 -\n                           skip_threads_232567));\n                \n                if (thread_active_232568 && inactive_232569) {\n                    x_207255 = x_207256;\n                }\n                if (thread_active_232568) {\n                    if (!inactive_232569) {\n                        int64_t defunc_1_op_res_207257 = add64(x_207255,\n                                                               x_207256);\n                        \n                        x_207255 = defunc_1_op_res_207257;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_232551, skip_threads_232567)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n       ",
            "     }\n            if (thread_active_232568) {\n                // write result\n                {\n                    ((volatile __local\n                      int64_t *) color_231967)[sext_i32_i64(local_tid_232549)] =\n                        x_207255;\n                    x_207256 = x_207255;\n                }\n            }\n            if (sle32(wave_sizze_232551, skip_threads_232567)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_232567 *= 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_232549 - squot32(local_tid_232549, 32) * 32) == 31 &&\n            ltid_in_bounds_232566) {\n            ((volatile __local\n              int64_t *) color_231967)[sext_i32_i64(squot32(local_tid_232549,\n                                                            32))] = x_207255;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n    {\n        int32_t skip_threads_232570;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_232549, 32) == 0 && ltid_in_bounds_232566) {\n                x_232564 = ((volatile __local\n                             int64_t *) color_231967)[sext_i32_i64(local_tid_232549)];\n                if ((local_tid_232549 - squot32(local_tid_232549, 32) * 32) ==\n                    0) {\n                    x_232563 = x_232564;\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_232549 -\n                                                  squot32(local_tid_232549,\n                                                          32) * 32) &&\n            ",
            "         (squot32(local_tid_232549, 32) == 0 &&\n                      ltid_in_bounds_232566);\n                \n                if (thread_active_232571) {\n                    // read operands\n                    {\n                        x_232563 = ((volatile __local\n                                     int64_t *) color_231967)[sext_i32_i64(local_tid_232549) -\n                                                              sext_i32_i64(skip_threads_232570)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_232572 =\n                         slt64(srem64(sext_i32_i64(local_tid_232549 * 32 + 32 -\n                                      1), defunc_0_f_res_203631),\n                               sext_i32_i64(local_tid_232549 * 32 + 32 - 1) -\n                               sext_i32_i64((local_tid_232549 -\n                                             skip_threads_232570) * 32 + 32 -\n                               1));\n                    \n                    if (thread_active_232571 && inactive_232572) {\n                        x_232563 = x_232564;\n                    }\n                    if (thread_active_232571) {\n                        if (!inactive_232572) {\n                            int64_t defunc_1_op_res_232565 = add64(x_232563,\n                                                                   x_232564);\n                            \n                            x_232563 = defunc_1_op_res_232565;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_232551, 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 *) color_231967)[sext_i32_i64(local_tid_232549)] =\n                            x_232563;\n                        x_2325",
            "64 = x_232563;\n                    }\n                }\n                if (sle32(wave_sizze_232551, skip_threads_232570)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_232570 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_232573 = squot32(local_tid_232549, 32) == 0 ||\n         !ltid_in_bounds_232566;\n    \n    // carry-in for every block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_232573) {\n                x_207256 = x_207255;\n                x_207255 = ((__local\n                             int64_t *) color_231967)[sext_i32_i64(squot32(local_tid_232549,\n                                                                           32)) -\n                                                      (int64_t) 1];\n            }\n        }\n        // perform operation\n        {\n            bool inactive_232574 = slt64(srem64(sext_i32_i64(local_tid_232549),\n                                                defunc_0_f_res_203631),\n                                         sext_i32_i64(local_tid_232549) -\n                                         sext_i32_i64(squot32(local_tid_232549,\n                                                              32) * 32 - 1));\n            \n            if (!no_carry_in_232573) {\n                if (inactive_232574) {\n                    x_207255 = x_207256;\n                }\n            }\n            if (!no_carry_in_232573) {\n                if (!inactive_232574) {\n                    int64_t defunc_1_op_res_207257 = add64(x_207255, x_207256);\n                    \n                    x_207255 = defunc_1_op_res_207257;\n                }\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_232573) {\n                ((__local\n                  int64_t *) color_231967)[sext_i32_i64(local_tid_232549)] =\n                    x_207255;\n            }\n        }\n    }\n    barrier(CLK",
            "_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_232549, 32) == 0 && ltid_in_bounds_232566) {\n            ((__local int64_t *) color_231967)[sext_i32_i64(local_tid_232549)] =\n                x_207256;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_232575 = 0; i_232575 < sdiv_up64(n_p_203492 *\n                                                    defunc_0_f_res_203631 -\n                                                    sext_i32_i64(local_tid_232549),\n                                                    computed_group_sizze_207187);\n         i_232575++) {\n        ((__local int64_t *) color_231966)[squot64(i_232575 *\n                                                   computed_group_sizze_207187 +\n                                                   sext_i32_i64(local_tid_232549),\n                                                   defunc_0_f_res_203631) *\n                                           defunc_0_f_res_203631 + (i_232575 *\n                                                                    computed_group_sizze_207187 +\n                                                                    sext_i32_i64(local_tid_232549) -\n                                                                    squot64(i_232575 *\n                                                                            computed_group_sizze_207187 +\n                                                                            sext_i32_i64(local_tid_232549),\n                                                                            defunc_0_f_res_203631) *\n                                                                    defunc_0_f_res_203631)] =\n            (int64_t) -1;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_207274 = sext_i32_i64(sext_i64_i32(ltid_pre_232553));\n    int64_t gtid_207275 = sext_i32_i64(sext_i64_i32(ltid_pre_232554));\n    int32_t phys_tid_207276 = local_tid_232549;\n    \n    if (slt64(gtid_207274",
            ", n_p_203492) && slt64(gtid_207275,\n                                                defunc_0_f_res_203631)) {\n        double x_207277;\n        \n        x_207277 = ((__global double *) mem_229206)[gtid_207247 *\n                                                    (defunc_0_f_res_203631 *\n                                                     n_p_203492) + gtid_207274 *\n                                                    defunc_0_f_res_203631 +\n                                                    gtid_207275];\n        \n        bool isnan_res_207280;\n        \n        isnan_res_207280 = futrts_isnan64(x_207277);\n        \n        bool defunc_0_p_res_207281 = !isnan_res_207280;\n        int64_t defunc_1_f_res_207282;\n        \n        if (defunc_0_p_res_207281) {\n            int64_t x_207278;\n            \n            x_207278 = ((__local int64_t *) color_231967)[gtid_207274 *\n                                                          defunc_0_f_res_203631 +\n                                                          gtid_207275];\n            \n            int64_t defunc_1_f_res_t_res_207283 = sub64(x_207278, (int64_t) 1);\n            \n            defunc_1_f_res_207282 = defunc_1_f_res_t_res_207283;\n        } else {\n            defunc_1_f_res_207282 = (int64_t) -1;\n        }\n        if ((sle64((int64_t) 0, gtid_207274) && slt64(gtid_207274,\n                                                      n_p_203492)) &&\n            (sle64((int64_t) 0, defunc_1_f_res_207282) &&\n             slt64(defunc_1_f_res_207282, defunc_0_f_res_203631))) {\n            ((__local int64_t *) color_231966)[gtid_207274 *\n                                               defunc_0_f_res_203631 +\n                                               defunc_1_f_res_207282] =\n                gtid_207275;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_232576 = 0; i_232576 < sdiv_up64(n_p_203492 *\n                                                    defunc_0_f_res_203631 -\n                                 ",
            "                   sext_i32_i64(local_tid_232549),\n                                                    computed_group_sizze_207187);\n         i_232576++) {\n        int64_t tmp_232577;\n        \n        tmp_232577 = ((__local int64_t *) color_231966)[squot64(i_232576 *\n                                                                computed_group_sizze_207187 +\n                                                                sext_i32_i64(local_tid_232549),\n                                                                defunc_0_f_res_203631) *\n                                                        defunc_0_f_res_203631 +\n                                                        (i_232576 *\n                                                         computed_group_sizze_207187 +\n                                                         sext_i32_i64(local_tid_232549) -\n                                                         squot64(i_232576 *\n                                                                 computed_group_sizze_207187 +\n                                                                 sext_i32_i64(local_tid_232549),\n                                                                 defunc_0_f_res_203631) *\n                                                         defunc_0_f_res_203631)];\n        ((__global int64_t *) mem_229222)[gtid_207247 * (defunc_0_f_res_203631 *\n                                                         n_p_203492) +\n                                          squot64(i_232576 *\n                                                  computed_group_sizze_207187 +\n                                                  sext_i32_i64(local_tid_232549),\n                                                  defunc_0_f_res_203631) *\n                                          defunc_0_f_res_203631 + (i_232576 *\n                                                                   computed_group_sizze_207187 +\n                                                               ",
            "    sext_i32_i64(local_tid_232549) -\n                                                                   squot64(i_232576 *\n                                                                           computed_group_sizze_207187 +\n                                                                           sext_i32_i64(local_tid_232549),\n                                                                           defunc_0_f_res_203631) *\n                                                                   defunc_0_f_res_203631)] =\n            tmp_232577;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_232578 = 0; i_232578 < sdiv_up64(n_p_203492 -\n                                                    sext_i32_i64(local_tid_232549),\n                                                    computed_group_sizze_207187);\n         i_232578++) {\n        int64_t tmp_232579;\n        \n        tmp_232579 = ((__local int64_t *) color_231967)[i_203718 + (i_232578 *\n                                                                    computed_group_sizze_207187 +\n                                                                    sext_i32_i64(local_tid_232549)) *\n                                                        defunc_0_f_res_203631];\n        ((__global int64_t *) mem_229226)[gtid_207247 * n_p_203492 + (i_232578 *\n                                                                      computed_group_sizze_207187 +\n                                                                      sext_i32_i64(local_tid_232549))] =\n            tmp_232579;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n  error_2:\n    return;\n}\n__kernel void mainzisegmap_intragroup_207524(__global int *global_failure,\n                                             uint color_231969_backing_offset_0,\n                                             uint color_231968_backing_offset_1,\n                                             int64_t n_p_203492,\n                                             int64_t partition_sizze_203577,",
            "\n                                             int64_t defunc_0_f_res_203631,\n                                             int64_t i_203718, __global\n                                             unsigned char *mem_229206, __global\n                                             unsigned char *mem_229240, __global\n                                             unsigned char *mem_229244)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *color_231969_backing_1 =\n                           &shared_mem[color_231969_backing_offset_0];\n    volatile unsigned char *color_231968_backing_0 =\n                           &shared_mem[color_231968_backing_offset_1];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_232580;\n    int32_t local_tid_232581;\n    int64_t group_sizze_232584;\n    int32_t wave_sizze_232583;\n    int32_t group_tid_232582;\n    \n    global_tid_232580 = get_global_id(0);\n    local_tid_232581 = get_local_id(0);\n    group_sizze_232584 = get_local_size(0);\n    wave_sizze_232583 = LOCKSTEP_WIDTH;\n    group_tid_232582 = get_group_id(0);\n    \n    int32_t phys_tid_207524 = group_tid_232582;\n    int64_t slice_232586 = defunc_0_f_res_203631;\n    int64_t ltid_pre_232585 = sext_i32_i64(local_tid_232581);\n    int64_t remnant_232587 = sext_i32_i64(local_tid_232581) - ltid_pre_232585;\n    int64_t slice_232588 = n_p_203492;\n    int64_t slice_232589 = partition_sizze_203577 * slice_232588;\n    int64_t gtid_207522 = squot64(sext_i32_i64(group_tid_232582), slice_232588);\n    int64_t remnant_232590 = sext_i32_i64(group_tid_232582) - gtid_207522 *\n            slice_232588;\n    int64_t gtid_207523 = remnant_232590;\n    int64_t remnant_232591 = remnant_232590 - gtid_207523;\n    __local unsigned char *color_231968;\n    \n    color_231968 = (__local unsigned char *) color_231968_backing_0;\n    \n    __local unsigned char *color_231969;\n    \n    color_231969 = (__local unsigned char *) color_231969",
            "_backing_1;\n    \n    int64_t gtid_207528 = sext_i32_i64(sext_i64_i32(ltid_pre_232585));\n    int32_t phys_tid_207529 = local_tid_232581;\n    double x_207533;\n    \n    x_207533 = ((__global double *) mem_229206)[gtid_207522 *\n                                                (defunc_0_f_res_203631 *\n                                                 n_p_203492) + gtid_207523 *\n                                                defunc_0_f_res_203631 +\n                                                gtid_207528];\n    \n    bool isnan_res_207534;\n    \n    isnan_res_207534 = futrts_isnan64(x_207533);\n    \n    bool defunc_0_p_res_207535 = !isnan_res_207534;\n    int64_t defunc_0_f_res_207536 = btoi_bool_i64(defunc_0_p_res_207535);\n    \n    ((__local int64_t *) color_231969)[gtid_207528] = defunc_0_f_res_207536;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t dims_flat_232592 = defunc_0_f_res_203631;\n    int64_t x_207530;\n    int64_t x_207531;\n    int64_t x_232594;\n    int64_t x_232595;\n    bool ltid_in_bounds_232597 = slt64(sext_i32_i64(local_tid_232581),\n                                       defunc_0_f_res_203631);\n    int32_t skip_threads_232598;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_232597) {\n            x_207531 = ((volatile __local\n                         int64_t *) color_231969)[sext_i32_i64(local_tid_232581)];\n            if ((local_tid_232581 - squot32(local_tid_232581, 32) * 32) == 0) {\n                x_207530 = x_207531;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_232598 = 1;\n        while (slt32(skip_threads_232598, 32)) {\n            bool thread_active_232599 = sle32(skip_threads_232598,\n                                              local_tid_232581 -\n                                              squot32(local_tid_232581, 32) *\n                                              32) && ltid_in_bounds_232597;\n            \n            if (thread_active_232599) {\n          ",
            "      // read operands\n                {\n                    x_207530 = ((volatile __local\n                                 int64_t *) color_231969)[sext_i32_i64(local_tid_232581) -\n                                                          sext_i32_i64(skip_threads_232598)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_232600 =\n                     slt64(srem64(sext_i32_i64(local_tid_232581),\n                                  defunc_0_f_res_203631),\n                           sext_i32_i64(local_tid_232581) -\n                           sext_i32_i64(local_tid_232581 -\n                           skip_threads_232598));\n                \n                if (thread_active_232599 && inactive_232600) {\n                    x_207530 = x_207531;\n                }\n                if (thread_active_232599) {\n                    if (!inactive_232600) {\n                        int64_t defunc_1_op_res_207532 = add64(x_207530,\n                                                               x_207531);\n                        \n                        x_207530 = defunc_1_op_res_207532;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_232583, skip_threads_232598)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (thread_active_232599) {\n                // write result\n                {\n                    ((volatile __local\n                      int64_t *) color_231969)[sext_i32_i64(local_tid_232581)] =\n                        x_207530;\n                    x_207531 = x_207530;\n                }\n            }\n            if (sle32(wave_sizze_232583, skip_threads_232598)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_232598 *= 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_232581 - squot32(local_tid_232581, 32) * 32) == 31 &&",
            "\n            ltid_in_bounds_232597) {\n            ((volatile __local\n              int64_t *) color_231969)[sext_i32_i64(squot32(local_tid_232581,\n                                                            32))] = x_207530;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n    {\n        int32_t skip_threads_232601;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_232581, 32) == 0 && ltid_in_bounds_232597) {\n                x_232595 = ((volatile __local\n                             int64_t *) color_231969)[sext_i32_i64(local_tid_232581)];\n                if ((local_tid_232581 - squot32(local_tid_232581, 32) * 32) ==\n                    0) {\n                    x_232594 = x_232595;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_232601 = 1;\n            while (slt32(skip_threads_232601, 32)) {\n                bool thread_active_232602 = sle32(skip_threads_232601,\n                                                  local_tid_232581 -\n                                                  squot32(local_tid_232581,\n                                                          32) * 32) &&\n                     (squot32(local_tid_232581, 32) == 0 &&\n                      ltid_in_bounds_232597);\n                \n                if (thread_active_232602) {\n                    // read operands\n                    {\n                        x_232594 = ((volatile __local\n                                     int64_t *) color_231969)[sext_i32_i64(local_tid_232581) -\n                                                              sext_i32_i64(skip_threads_232601)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_232603 =\n                         slt64(srem64(sext_i32_i64(local_tid_232581 * 32 + 32 -\n    ",
            "                                  1), defunc_0_f_res_203631),\n                               sext_i32_i64(local_tid_232581 * 32 + 32 - 1) -\n                               sext_i32_i64((local_tid_232581 -\n                                             skip_threads_232601) * 32 + 32 -\n                               1));\n                    \n                    if (thread_active_232602 && inactive_232603) {\n                        x_232594 = x_232595;\n                    }\n                    if (thread_active_232602) {\n                        if (!inactive_232603) {\n                            int64_t defunc_1_op_res_232596 = add64(x_232594,\n                                                                   x_232595);\n                            \n                            x_232594 = defunc_1_op_res_232596;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_232583, skip_threads_232601)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_232602) {\n                    // write result\n                    {\n                        ((volatile __local\n                          int64_t *) color_231969)[sext_i32_i64(local_tid_232581)] =\n                            x_232594;\n                        x_232595 = x_232594;\n                    }\n                }\n                if (sle32(wave_sizze_232583, skip_threads_232601)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_232601 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_232604 = squot32(local_tid_232581, 32) == 0 ||\n         !ltid_in_bounds_232597;\n    \n    // carry-in for every block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_232604) {\n                x_207531 = x_207530;\n                x_207530 = ((__local\n                             int64_t *) color_231969)[sext_i32_i64(squo",
            "t32(local_tid_232581,\n                                                                           32)) -\n                                                      (int64_t) 1];\n            }\n        }\n        // perform operation\n        {\n            bool inactive_232605 = slt64(srem64(sext_i32_i64(local_tid_232581),\n                                                defunc_0_f_res_203631),\n                                         sext_i32_i64(local_tid_232581) -\n                                         sext_i32_i64(squot32(local_tid_232581,\n                                                              32) * 32 - 1));\n            \n            if (!no_carry_in_232604) {\n                if (inactive_232605) {\n                    x_207530 = x_207531;\n                }\n            }\n            if (!no_carry_in_232604) {\n                if (!inactive_232605) {\n                    int64_t defunc_1_op_res_207532 = add64(x_207530, x_207531);\n                    \n                    x_207530 = defunc_1_op_res_207532;\n                }\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_232604) {\n                ((__local\n                  int64_t *) color_231969)[sext_i32_i64(local_tid_232581)] =\n                    x_207530;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_232581, 32) == 0 && ltid_in_bounds_232597) {\n            ((__local int64_t *) color_231969)[sext_i32_i64(local_tid_232581)] =\n                x_207531;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t last_res_207537;\n    \n    last_res_207537 = ((__local int64_t *) color_231969)[i_203718];\n    ((__local int64_t *) color_231968)[sext_i32_i64(local_tid_232581)] =\n        (int64_t) -1;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t write_i_207540 = sext_i32_i64(sext_i64_i32(ltid_pre_232585));\n    int32_t phys_tid_207541 = local_tid_232581;\n    double x_2075",
            "42;\n    \n    x_207542 = ((__global double *) mem_229206)[gtid_207522 *\n                                                (defunc_0_f_res_203631 *\n                                                 n_p_203492) + gtid_207523 *\n                                                defunc_0_f_res_203631 +\n                                                write_i_207540];\n    \n    bool isnan_res_207545;\n    \n    isnan_res_207545 = futrts_isnan64(x_207542);\n    \n    bool defunc_0_p_res_207546 = !isnan_res_207545;\n    int64_t defunc_1_f_res_207547;\n    \n    if (defunc_0_p_res_207546) {\n        int64_t x_207543;\n        \n        x_207543 = ((__local int64_t *) color_231969)[write_i_207540];\n        \n        int64_t defunc_1_f_res_t_res_207548 = sub64(x_207543, (int64_t) 1);\n        \n        defunc_1_f_res_207547 = defunc_1_f_res_t_res_207548;\n    } else {\n        defunc_1_f_res_207547 = (int64_t) -1;\n    }\n    if (sle64((int64_t) 0, defunc_1_f_res_207547) &&\n        slt64(defunc_1_f_res_207547, defunc_0_f_res_203631)) {\n        ((__local int64_t *) color_231968)[defunc_1_f_res_207547] =\n            write_i_207540;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t tmp_232606;\n    \n    tmp_232606 = ((__local\n                   int64_t *) color_231968)[sext_i32_i64(local_tid_232581)];\n    ((__global int64_t *) mem_229240)[gtid_207522 * (defunc_0_f_res_203631 *\n                                                     n_p_203492) + gtid_207523 *\n                                      defunc_0_f_res_203631 +\n                                      sext_i32_i64(local_tid_232581)] =\n        tmp_232606;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    if (local_tid_232581 == 0) {\n        ((__global int64_t *) mem_229244)[gtid_207522 * n_p_203492 +\n                                          gtid_207523] = last_res_207537;\n    }\n    \n  error_2:\n    return;\n}\n__kernel void mainzisegmap_intragroup_207777(__global int *global_failure,\n                                             int failure_is_an_option, __glob",
            "al\n                                             int64_t *global_failure_args,\n                                             uint color_231976_backing_offset_0,\n                                             uint color_231975_backing_offset_1,\n                                             uint color_231974_backing_offset_2,\n                                             uint color_231973_backing_offset_3,\n                                             uint color_231972_backing_offset_4,\n                                             uint color_231971_backing_offset_5,\n                                             uint color_231970_backing_offset_6,\n                                             int64_t n_p_203492,\n                                             int64_t q_s_203493,\n                                             int64_t jump_s_203499,\n                                             int64_t partition_sizze_203577,\n                                             int64_t defunc_0_f_res_203631,\n                                             int64_t pad_css_len_203632,\n                                             int64_t s_n_m_203636,\n                                             int64_t i_203718,\n                                             unsigned char x_203719_bits,\n                                             int64_t min_res_203749,\n                                             unsigned char loop_cond_203754_bits,\n                                             double i64_res_203755,\n                                             int64_t computed_group_sizze_207619,\n                                             __global\n                                             unsigned char *ext_mem_229264,\n                                             __global\n                                             unsigned char *ext_mem_229265,\n                                             __global unsigned char *mem_229298,\n                                             __global unsigned char *mem_229303)\n{\n  ",
            "  bool x_203719 = x_203719_bits;\n    bool loop_cond_203754 = loop_cond_203754_bits;\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *color_231976_backing_6 =\n                           &shared_mem[color_231976_backing_offset_0];\n    volatile unsigned char *color_231975_backing_5 =\n                           &shared_mem[color_231975_backing_offset_1];\n    volatile unsigned char *color_231974_backing_4 =\n                           &shared_mem[color_231974_backing_offset_2];\n    volatile unsigned char *color_231973_backing_3 =\n                           &shared_mem[color_231973_backing_offset_3];\n    volatile unsigned char *color_231972_backing_2 =\n                           &shared_mem[color_231972_backing_offset_4];\n    volatile unsigned char *color_231971_backing_1 =\n                           &shared_mem[color_231971_backing_offset_5];\n    volatile unsigned char *color_231970_backing_0 =\n                           &shared_mem[color_231970_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_232740;\n    int32_t local_tid_232741;\n    int64_t group_sizze_232744;\n    int32_t wave_sizze_232743;\n    int32_t group_tid_232742;\n    \n    global_tid_232740 = get_global_id(0);\n    local_tid_232741 = get_local_id(0);\n    group_sizze_232744 = get_local_size(0);\n    wave_sizze_232743 = LOCKSTEP_WIDTH;\n    group_tid_232742 = get_group_id(0);\n    \n    int32_t phys_tid_207777 = group_tid_232742;\n    int64_t slice_232746 = n_p_203492;\n    int64_t ltid_pre_232745 = sext_i32_i64(local_tid_232741);\n    int64_t remnant_232747 = sext_i32_i64(local_tid_232741) - ltid_pre_232745;\n    int64_t slice_232750 = defunc_0_f_res_203631;\n    int64_t slice_232751 = n_p_203492 * slice_232750;\n    int64_t lt",
            "id_pre_232748 = squot64(sext_i32_i64(local_tid_232741),\n                                      slice_232750);\n    int64_t remnant_232752 = sext_i32_i64(local_tid_232741) - ltid_pre_232748 *\n            slice_232750;\n    int64_t ltid_pre_232749 = remnant_232752;\n    int64_t remnant_232753 = remnant_232752 - ltid_pre_232749;\n    int64_t slice_232756 = s_n_m_203636;\n    int64_t slice_232757 = n_p_203492 * slice_232756;\n    int64_t ltid_pre_232754 = squot64(sext_i32_i64(local_tid_232741),\n                                      slice_232756);\n    int64_t remnant_232758 = sext_i32_i64(local_tid_232741) - ltid_pre_232754 *\n            slice_232756;\n    int64_t ltid_pre_232755 = remnant_232758;\n    int64_t remnant_232759 = remnant_232758 - ltid_pre_232755;\n    int64_t slice_232760 = partition_sizze_203577;\n    int64_t gtid_207776 = sext_i32_i64(group_tid_232742);\n    int64_t remnant_232761 = sext_i32_i64(group_tid_232742) - gtid_207776;\n    __local unsigned char *color_231970;\n    \n    color_231970 = (__local unsigned char *) color_231970_backing_0;\n    \n    __local unsigned char *color_231971;\n    \n    color_231971 = (__local unsigned char *) color_231971_backing_1;\n    \n    __local unsigned char *color_231972;\n    \n    color_231972 = (__local unsigned char *) color_231972_backing_2;\n    \n    __local unsigned char *color_231973;\n    \n    color_231973 = (__local unsigned char *) color_231973_backing_3;\n    \n    __local unsigned char *color_231974;\n    \n    color_231974 = (__local unsigned char *) color_231974_backing_4;\n    \n    __local unsigned char *color_231975;\n    \n    color_231975 = (__local unsigned char *) color_231975_backing_5;\n    \n    __local unsigned char *color_231976;\n    \n    color_231976 = (__local unsigned char *) color_231976_backing_6;\n    \n    int64_t gtid_207783 = sext_i32_i64(sext_i64_i32(ltid_pre_232748));\n    int64_t gtid_207784 = sext_i32_i64(sext_i64_i32(ltid_pre_232749));\n    int32_t phys_tid_207785 = local_tid_232741;\n    \n    if (slt64(gtid_20778",
            "3, n_p_203492) && slt64(gtid_207784,\n                                                defunc_0_f_res_203631)) {\n        int64_t x_207786;\n        \n        x_207786 = ((__global int64_t *) ext_mem_229265)[gtid_207776 *\n                                                         (defunc_0_f_res_203631 *\n                                                          n_p_203492) +\n                                                         gtid_207783 *\n                                                         defunc_0_f_res_203631 +\n                                                         gtid_207784];\n        \n        int64_t defunc_0_f_res_207787 = add64((int64_t) 1, x_207786);\n        \n        ((__local int64_t *) color_231976)[gtid_207783 * defunc_0_f_res_203631 +\n                                           gtid_207784] = defunc_0_f_res_207787;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_207792 = sext_i32_i64(sext_i64_i32(ltid_pre_232745));\n    int32_t phys_tid_207793 = local_tid_232741;\n    \n    if (slt64(gtid_207792, n_p_203492)) {\n        int64_t x_207794;\n        \n        x_207794 = ((__global int64_t *) ext_mem_229264)[gtid_207776 *\n                                                         n_p_203492 +\n                                                         gtid_207792];\n        \n        int64_t min_arg_207795 = sub64(x_207794, (int64_t) 1);\n        int64_t min_arg_207796 = sub64(x_207794, min_res_203749);\n        int64_t min_res_207797 = smin64(q_s_203493, x_207794);\n        double i64_res_207798 = sitofp_i64_f64(x_207794);\n        double x_207799 = i64_res_203755 - i64_res_207798;\n        double max_arg_207800 = x_207799 / 2.0;\n        double max_res_207801 = fmax64(0.0, max_arg_207800);\n        \n        ((__local int64_t *) color_231975)[gtid_207792] = min_arg_207795;\n        ((__local int64_t *) color_231974)[gtid_207792] = min_arg_207796;\n        ((__local int64_t *) color_231973)[gtid_207792] = min_res_207797;\n        ((__local double *) color_231972",
            ")[gtid_207792] = max_res_207801;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_207804 = sext_i32_i64(sext_i64_i32(ltid_pre_232754));\n    int64_t gtid_207805 = sext_i32_i64(sext_i64_i32(ltid_pre_232755));\n    int32_t phys_tid_207806 = local_tid_232741;\n    \n    if (slt64(gtid_207804, n_p_203492) && slt64(gtid_207805, s_n_m_203636)) {\n        int64_t min_arg_207808;\n        \n        min_arg_207808 = ((__local int64_t *) color_231975)[gtid_207804];\n        \n        int64_t min_arg_207809;\n        \n        min_arg_207809 = ((__local int64_t *) color_231974)[gtid_207804];\n        \n        int64_t min_res_207810;\n        \n        min_res_207810 = ((__local int64_t *) color_231973)[gtid_207804];\n        \n        double max_res_207811;\n        \n        max_res_207811 = ((__local double *) color_231972)[gtid_207804];\n        \n        bool cond_207813 = gtid_207805 == (int64_t) 0;\n        int64_t defunc_0_m_fun_res_207814;\n        \n        if (cond_207813) {\n            defunc_0_m_fun_res_207814 = (int64_t) 0;\n        } else {\n            int64_t y_207815 = sub64(s_n_m_203636, (int64_t) 1);\n            bool cond_207816 = gtid_207805 == y_207815;\n            int64_t defunc_0_m_fun_res_f_res_207817;\n            \n            if (cond_207816) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_207818 =\n                        sub64(pad_css_len_203632, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_207817 =\n                    defunc_0_m_fun_res_f_res_t_res_207818;\n            } else {\n                int64_t x_207819 = sub64(gtid_207805, (int64_t) 1);\n                int64_t x_207820 = mul64(jump_s_203499, x_207819);\n                int64_t min_arg_207821 = add64((int64_t) 1, x_207820);\n                int64_t min_res_207822 = smin64(defunc_0_f_res_203631,\n                                                min_arg_207821);\n                \n                defunc_0_m_fun_res_f_res_207817 = min_res_207822;\n            }\n            defunc_",
            "0_m_fun_res_207814 = defunc_0_m_fun_res_f_res_207817;\n        }\n        \n        bool init_idx_207823;\n        int64_t init_idx_207824;\n        int64_t init_idx_207825;\n        bool loop_while_207826;\n        int64_t low_207827;\n        int64_t high_207828;\n        \n        loop_while_207826 = x_203719;\n        low_207827 = (int64_t) 0;\n        high_207828 = i_203718;\n        while (loop_while_207826) {\n            int64_t x_207829 = add64(low_207827, high_207828);\n            int64_t mid_207830 = sdiv64(x_207829, (int64_t) 2);\n            bool x_207831 = sle64((int64_t) 0, mid_207830);\n            bool y_207832 = slt64(mid_207830, defunc_0_f_res_203631);\n            bool bounds_check_207833 = x_207831 && y_207832;\n            bool index_certs_207834;\n            \n            if (!bounds_check_207833) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 2) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) mid_207830;\n                        global_failure_args[1] =\n                            (int64_t) defunc_0_f_res_203631;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_2;\n                }\n            }\n            \n            int64_t mid_id_207835;\n            \n            mid_id_207835 = ((__local int64_t *) color_231976)[gtid_207804 *\n                                                               defunc_0_f_res_203631 +\n                                                               mid_207830];\n            \n            bool cond_207836 = slt64(mid_id_207835, (int64_t) 0);\n            int64_t mid_idx_207837;\n            \n            if (cond_207836) {\n                mid_idx_207837 = (int64_t) 9223372036854775807;\n            } else {\n                mid_idx_207837 = mid_id_207835;\n            }\n            \n            bool cond_207838 = sle64(defunc_0_m_fun_res_207814, mid_idx_207837);\n            int64_t loo",
            "pres_207839;\n            int64_t loopres_207840;\n            \n            if (cond_207838) {\n                int64_t loopres_t_res_207841 = sub64(mid_207830, (int64_t) 1);\n                \n                loopres_207839 = low_207827;\n                loopres_207840 = loopres_t_res_207841;\n            } else {\n                int64_t loopres_f_res_207842 = add64((int64_t) 1, mid_207830);\n                \n                loopres_207839 = loopres_f_res_207842;\n                loopres_207840 = high_207828;\n            }\n            \n            bool loop_cond_207843 = sle64(loopres_207839, loopres_207840);\n            bool loop_while_tmp_232762 = loop_cond_207843;\n            int64_t low_tmp_232763 = loopres_207839;\n            int64_t high_tmp_232764 = loopres_207840;\n            \n            loop_while_207826 = loop_while_tmp_232762;\n            low_207827 = low_tmp_232763;\n            high_207828 = high_tmp_232764;\n        }\n        init_idx_207823 = loop_while_207826;\n        init_idx_207824 = low_207827;\n        init_idx_207825 = high_207828;\n        \n        bool idx_207844;\n        int64_t idx_207845;\n        int64_t idx_207846;\n        int64_t idx_207847;\n        bool loop_while_207848;\n        int64_t l_idx_207849;\n        int64_t r_idx_207850;\n        int64_t span_207851;\n        \n        loop_while_207848 = loop_cond_203754;\n        l_idx_207849 = init_idx_207824;\n        r_idx_207850 = init_idx_207824;\n        span_207851 = (int64_t) 1;\n        while (loop_while_207848) {\n            int64_t max_arg_207852 = sub64(l_idx_207849, (int64_t) 1);\n            int64_t max_res_207853 = smax64((int64_t) 0, max_arg_207852);\n            int64_t min_arg_207854 = add64((int64_t) 1, r_idx_207850);\n            int64_t min_res_207855 = smin64(min_arg_207808, min_arg_207854);\n            bool x_207856 = sle64((int64_t) 0, max_res_207853);\n            bool y_207857 = slt64(max_res_207853, defunc_0_f_res_203631);\n            bool bounds_check_207858 = x_207856 && y_207857;\n    ",
            "        bool index_certs_207859;\n            \n            if (!bounds_check_207858) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 3) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) max_res_207853;\n                        global_failure_args[1] =\n                            (int64_t) defunc_0_f_res_203631;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_2;\n                }\n            }\n            \n            int64_t x_207860;\n            \n            x_207860 = ((__local int64_t *) color_231976)[gtid_207804 *\n                                                          defunc_0_f_res_203631 +\n                                                          max_res_207853];\n            \n            int64_t abs_arg_207861 = sub64(x_207860, defunc_0_m_fun_res_207814);\n            int64_t abs_res_207862 = abs64(abs_arg_207861);\n            bool x_207863 = sle64((int64_t) 0, min_res_207855);\n            bool y_207864 = slt64(min_res_207855, defunc_0_f_res_203631);\n            bool bounds_check_207865 = x_207863 && y_207864;\n            bool index_certs_207866;\n            \n            if (!bounds_check_207865) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 4) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) min_res_207855;\n                        global_failure_args[1] =\n                            (int64_t) defunc_0_f_res_203631;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_2;\n                }\n            }\n            \n            int64_t x_207867;\n            \n            x_207867 = ((__local int64_t *) color_231976)[gtid_207804 *\n                                                          defunc_0_f_res_203631 +\n                                              ",
            "            min_res_207855];\n            \n            int64_t abs_arg_207868 = sub64(x_207867, defunc_0_m_fun_res_207814);\n            int64_t abs_res_207869 = abs64(abs_arg_207868);\n            bool cond_207870 = max_res_207853 == l_idx_207849;\n            int64_t loopres_207871;\n            int64_t loopres_207872;\n            int64_t loopres_207873;\n            \n            if (cond_207870) {\n                loopres_207871 = l_idx_207849;\n                loopres_207872 = r_idx_207850;\n                loopres_207873 = min_res_203749;\n            } else {\n                bool cond_207874 = slt64(abs_res_207862, abs_res_207869);\n                bool cond_f_res_207875 = min_res_207855 == r_idx_207850;\n                bool x_207876 = !cond_207874;\n                bool y_207877 = cond_f_res_207875 && x_207876;\n                bool cond_207878 = cond_207874 || y_207877;\n                int64_t loopres_f_res_207879;\n                \n                if (cond_207878) {\n                    loopres_f_res_207879 = max_res_207853;\n                } else {\n                    loopres_f_res_207879 = l_idx_207849;\n                }\n                \n                int64_t loopres_f_res_207880;\n                \n                if (cond_207878) {\n                    loopres_f_res_207880 = r_idx_207850;\n                } else {\n                    loopres_f_res_207880 = min_res_207855;\n                }\n                \n                int64_t loopres_f_res_207881;\n                \n                if (cond_207878) {\n                    int64_t loopres_f_res_t_res_207882 = add64((int64_t) 1,\n                                                               span_207851);\n                    \n                    loopres_f_res_207881 = loopres_f_res_t_res_207882;\n                } else {\n                    int64_t loopres_f_res_f_res_207883 = add64((int64_t) 1,\n                                                               span_207851);\n                    \n                    loopres_f_re",
            "s_207881 = loopres_f_res_f_res_207883;\n                }\n                loopres_207871 = loopres_f_res_207879;\n                loopres_207872 = loopres_f_res_207880;\n                loopres_207873 = loopres_f_res_207881;\n            }\n            \n            bool loop_cond_207884 = slt64(loopres_207873, min_res_203749);\n            bool loop_while_tmp_232765 = loop_cond_207884;\n            int64_t l_idx_tmp_232766 = loopres_207871;\n            int64_t r_idx_tmp_232767 = loopres_207872;\n            int64_t span_tmp_232768 = loopres_207873;\n            \n            loop_while_207848 = loop_while_tmp_232765;\n            l_idx_207849 = l_idx_tmp_232766;\n            r_idx_207850 = r_idx_tmp_232767;\n            span_207851 = span_tmp_232768;\n        }\n        idx_207844 = loop_while_207848;\n        idx_207845 = l_idx_207849;\n        idx_207846 = r_idx_207850;\n        idx_207847 = span_207851;\n        \n        int64_t min_res_207885 = smin64(min_arg_207809, idx_207845);\n        int64_t max_res_207886 = smax64((int64_t) 0, min_res_207885);\n        int64_t defunc_0_m_fun_res_207887;\n        \n        if (cond_207813) {\n            defunc_0_m_fun_res_207887 = (int64_t) 0;\n        } else {\n            int64_t y_207888 = sub64(s_n_m_203636, (int64_t) 1);\n            bool cond_207889 = gtid_207805 == y_207888;\n            int64_t defunc_0_m_fun_res_f_res_207890;\n            \n            if (cond_207889) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_207891 =\n                        sub64(pad_css_len_203632, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_207890 =\n                    defunc_0_m_fun_res_f_res_t_res_207891;\n            } else {\n                int64_t x_207892 = sub64(gtid_207805, (int64_t) 1);\n                int64_t x_207893 = mul64(jump_s_203499, x_207892);\n                int64_t min_arg_207894 = add64((int64_t) 1, x_207893);\n                int64_t min_res_207895 = smin64(defunc_0_f_res_203631,\n                               ",
            "                 min_arg_207894);\n                \n                defunc_0_m_fun_res_f_res_207890 = min_res_207895;\n            }\n            defunc_0_m_fun_res_207887 = defunc_0_m_fun_res_f_res_207890;\n        }\n        \n        int64_t x_207896 = add64(min_res_207810, max_res_207886);\n        int64_t r_207897 = sub64(x_207896, (int64_t) 1);\n        bool x_207898 = sle64((int64_t) 0, r_207897);\n        bool y_207899 = slt64(r_207897, defunc_0_f_res_203631);\n        bool bounds_check_207900 = x_207898 && y_207899;\n        bool index_certs_207901;\n        \n        if (!bounds_check_207900) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 5) == -1) {\n                    global_failure_args[0] = (int64_t) r_207897;\n                    global_failure_args[1] = (int64_t) defunc_0_f_res_203631;\n                    ;\n                }\n                local_failure = true;\n                goto error_2;\n            }\n        }\n        \n        int64_t x_207902;\n        \n        x_207902 = ((__local int64_t *) color_231976)[gtid_207804 *\n                                                      defunc_0_f_res_203631 +\n                                                      r_207897];\n        \n        int64_t abs_arg_207903 = sub64(x_207902, defunc_0_m_fun_res_207887);\n        int64_t abs_res_207904 = abs64(abs_arg_207903);\n        bool x_207905 = sle64((int64_t) 0, max_res_207886);\n        bool y_207906 = slt64(max_res_207886, defunc_0_f_res_203631);\n        bool bounds_check_207907 = x_207905 && y_207906;\n        bool index_certs_207908;\n        \n        if (!bounds_check_207907) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 6) == -1) {\n                    global_failure_args[0] = (int64_t) max_res_207886;\n                    global_failure_args[1] = (int64_t) defunc_0_f_res_203631;\n                    ;\n                }\n                local_failure = true;\n                goto error_2;\n            }\n        }",
            "\n        \n        int64_t x_207909;\n        \n        x_207909 = ((__local int64_t *) color_231976)[gtid_207804 *\n                                                      defunc_0_f_res_203631 +\n                                                      max_res_207886];\n        \n        int64_t abs_arg_207910 = sub64(x_207909, defunc_0_m_fun_res_207887);\n        int64_t abs_res_207911 = abs64(abs_arg_207910);\n        int64_t max_res_207912 = smax64(abs_res_207904, abs_res_207911);\n        double defunc_0_f_res_207913 = sitofp_i64_f64(max_res_207912);\n        double defunc_1_f_res_207914 = max_res_207811 + defunc_0_f_res_207913;\n        \n        ((__local double *) color_231971)[gtid_207804 * s_n_m_203636 +\n                                          gtid_207805] = defunc_1_f_res_207914;\n        ((__local int64_t *) color_231970)[gtid_207804 * s_n_m_203636 +\n                                           gtid_207805] = max_res_207886;\n    }\n    \n  error_2:\n    barrier(CLK_LOCAL_MEM_FENCE);\n    if (local_failure)\n        return;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_232769 = 0; i_232769 < sdiv_up64(n_p_203492 * s_n_m_203636 -\n                                                    sext_i32_i64(local_tid_232741),\n                                                    computed_group_sizze_207619);\n         i_232769++) {\n        int64_t tmp_232770;\n        \n        tmp_232770 = ((__local int64_t *) color_231970)[squot64(i_232769 *\n                                                                computed_group_sizze_207619 +\n                                                                sext_i32_i64(local_tid_232741),\n                                                                s_n_m_203636) *\n                                                        s_n_m_203636 +\n                                                        (i_232769 *\n                                                         computed_group_sizze_207619 +\n                                                         sext",
            "_i32_i64(local_tid_232741) -\n                                                         squot64(i_232769 *\n                                                                 computed_group_sizze_207619 +\n                                                                 sext_i32_i64(local_tid_232741),\n                                                                 s_n_m_203636) *\n                                                         s_n_m_203636)];\n        ((__global int64_t *) mem_229298)[gtid_207776 * (s_n_m_203636 *\n                                                         n_p_203492) +\n                                          squot64(i_232769 *\n                                                  computed_group_sizze_207619 +\n                                                  sext_i32_i64(local_tid_232741),\n                                                  s_n_m_203636) * s_n_m_203636 +\n                                          (i_232769 *\n                                           computed_group_sizze_207619 +\n                                           sext_i32_i64(local_tid_232741) -\n                                           squot64(i_232769 *\n                                                   computed_group_sizze_207619 +\n                                                   sext_i32_i64(local_tid_232741),\n                                                   s_n_m_203636) *\n                                           s_n_m_203636)] = tmp_232770;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_232771 = 0; i_232771 < sdiv_up64(n_p_203492 * s_n_m_203636 -\n                                                    sext_i32_i64(local_tid_232741),\n                                                    computed_group_sizze_207619);\n         i_232771++) {\n        double tmp_232772;\n        \n        tmp_232772 = ((__local double *) color_231971)[squot64(i_232771 *\n                                                               computed_group_sizze_207619 +\n                      ",
            "                                         sext_i32_i64(local_tid_232741),\n                                                               s_n_m_203636) *\n                                                       s_n_m_203636 +\n                                                       (i_232771 *\n                                                        computed_group_sizze_207619 +\n                                                        sext_i32_i64(local_tid_232741) -\n                                                        squot64(i_232771 *\n                                                                computed_group_sizze_207619 +\n                                                                sext_i32_i64(local_tid_232741),\n                                                                s_n_m_203636) *\n                                                        s_n_m_203636)];\n        ((__global double *) mem_229303)[gtid_207776 * (s_n_m_203636 *\n                                                        n_p_203492) +\n                                         squot64(i_232771 *\n                                                 computed_group_sizze_207619 +\n                                                 sext_i32_i64(local_tid_232741),\n                                                 s_n_m_203636) * s_n_m_203636 +\n                                         (i_232771 *\n                                          computed_group_sizze_207619 +\n                                          sext_i32_i64(local_tid_232741) -\n                                          squot64(i_232771 *\n                                                  computed_group_sizze_207619 +\n                                                  sext_i32_i64(local_tid_232741),\n                                                  s_n_m_203636) *\n                                          s_n_m_203636)] = tmp_232772;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n  error_3:\n    return;\n}\n__kernel void mainzisegmap_intragroup_208681(__g",
            "lobal int *global_failure,\n                                             int failure_is_an_option, __global\n                                             int64_t *global_failure_args,\n                                             uint color_231979_backing_offset_0,\n                                             uint color_231978_backing_offset_1,\n                                             uint color_231977_backing_offset_2,\n                                             int64_t n_p_203492,\n                                             int64_t q_s_203493,\n                                             int64_t jump_s_203499,\n                                             int64_t partition_sizze_203577,\n                                             int64_t defunc_0_f_res_203631,\n                                             int64_t pad_css_len_203632,\n                                             int64_t s_n_m_203636,\n                                             int64_t i_203718,\n                                             unsigned char x_203719_bits,\n                                             int64_t min_res_203749,\n                                             unsigned char loop_cond_203754_bits,\n                                             double i64_res_203755,\n                                             int64_t computed_group_sizze_208667,\n                                             __global\n                                             unsigned char *ext_mem_229264,\n                                             __global\n                                             unsigned char *ext_mem_229265,\n                                             __global unsigned char *mem_229320,\n                                             __global unsigned char *mem_229325)\n{\n    bool x_203719 = x_203719_bits;\n    bool loop_cond_203754 = loop_cond_203754_bits;\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *color_231979_backi",
            "ng_2 =\n                           &shared_mem[color_231979_backing_offset_0];\n    volatile unsigned char *color_231978_backing_1 =\n                           &shared_mem[color_231978_backing_offset_1];\n    volatile unsigned char *color_231977_backing_0 =\n                           &shared_mem[color_231977_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_232773;\n    int32_t local_tid_232774;\n    int64_t group_sizze_232777;\n    int32_t wave_sizze_232776;\n    int32_t group_tid_232775;\n    \n    global_tid_232773 = get_global_id(0);\n    local_tid_232774 = get_local_id(0);\n    group_sizze_232777 = get_local_size(0);\n    wave_sizze_232776 = LOCKSTEP_WIDTH;\n    group_tid_232775 = get_group_id(0);\n    \n    int32_t phys_tid_208681 = group_tid_232775;\n    int64_t slice_232779 = defunc_0_f_res_203631;\n    int64_t ltid_pre_232778 = sext_i32_i64(local_tid_232774);\n    int64_t remnant_232780 = sext_i32_i64(local_tid_232774) - ltid_pre_232778;\n    int64_t slice_232782 = s_n_m_203636;\n    int64_t ltid_pre_232781 = sext_i32_i64(local_tid_232774);\n    int64_t remnant_232783 = sext_i32_i64(local_tid_232774) - ltid_pre_232781;\n    int64_t slice_232784 = n_p_203492;\n    int64_t slice_232785 = partition_sizze_203577 * slice_232784;\n    int64_t gtid_208679 = squot64(sext_i32_i64(group_tid_232775), slice_232784);\n    int64_t remnant_232786 = sext_i32_i64(group_tid_232775) - gtid_208679 *\n            slice_232784;\n    int64_t gtid_208680 = remnant_232786;\n    int64_t remnant_232787 = remnant_232786 - gtid_208680;\n    __local unsigned char *color_231977;\n    \n    color_231977 = (__local unsigned char *) color_231977_backing_0;\n    \n    __local unsigned char *color_231978;\n    \n    color_231978 = (__local unsigned char *) color_231978_backing_1;\n    \n    __local ",
            "unsigned char *color_231979;\n    \n    color_231979 = (__local unsigned char *) color_231979_backing_2;\n    \n    int64_t x_208684;\n    \n    x_208684 = ((__global int64_t *) ext_mem_229264)[gtid_208679 * n_p_203492 +\n                                                     gtid_208680];\n    \n    int64_t gtid_208686 = sext_i32_i64(sext_i64_i32(ltid_pre_232778));\n    int32_t phys_tid_208687 = local_tid_232774;\n    \n    if (slt64(gtid_208686, defunc_0_f_res_203631)) {\n        int64_t x_208688;\n        \n        x_208688 = ((__global int64_t *) ext_mem_229265)[gtid_208679 *\n                                                         (defunc_0_f_res_203631 *\n                                                          n_p_203492) +\n                                                         gtid_208680 *\n                                                         defunc_0_f_res_203631 +\n                                                         gtid_208686];\n        \n        int64_t defunc_0_f_res_208689 = add64((int64_t) 1, x_208688);\n        \n        ((__local int64_t *) color_231979)[gtid_208686] = defunc_0_f_res_208689;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t min_arg_208690 = sub64(x_208684, (int64_t) 1);\n    int64_t min_arg_208691 = sub64(x_208684, min_res_203749);\n    int64_t min_res_208692 = smin64(q_s_203493, x_208684);\n    double i64_res_208693 = sitofp_i64_f64(x_208684);\n    double x_208694 = i64_res_203755 - i64_res_208693;\n    double max_arg_208695 = x_208694 / 2.0;\n    double max_res_208696 = fmax64(0.0, max_arg_208695);\n    int64_t gtid_208699 = sext_i32_i64(sext_i64_i32(ltid_pre_232781));\n    int32_t phys_tid_208700 = local_tid_232774;\n    \n    if (slt64(gtid_208699, s_n_m_203636)) {\n        bool cond_208702 = gtid_208699 == (int64_t) 0;\n        int64_t defunc_0_m_fun_res_208703;\n        \n        if (cond_208702) {\n            defunc_0_m_fun_res_208703 = (int64_t) 0;\n        } else {\n            int64_t y_208704 = sub64(s_n_m_203636, (int64_t) 1);\n            ",
            "bool cond_208705 = gtid_208699 == y_208704;\n            int64_t defunc_0_m_fun_res_f_res_208706;\n            \n            if (cond_208705) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_208707 =\n                        sub64(pad_css_len_203632, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_208706 =\n                    defunc_0_m_fun_res_f_res_t_res_208707;\n            } else {\n                int64_t x_208708 = sub64(gtid_208699, (int64_t) 1);\n                int64_t x_208709 = mul64(jump_s_203499, x_208708);\n                int64_t min_arg_208710 = add64((int64_t) 1, x_208709);\n                int64_t min_res_208711 = smin64(defunc_0_f_res_203631,\n                                                min_arg_208710);\n                \n                defunc_0_m_fun_res_f_res_208706 = min_res_208711;\n            }\n            defunc_0_m_fun_res_208703 = defunc_0_m_fun_res_f_res_208706;\n        }\n        \n        bool init_idx_208712;\n        int64_t init_idx_208713;\n        int64_t init_idx_208714;\n        bool loop_while_208715;\n        int64_t low_208716;\n        int64_t high_208717;\n        \n        loop_while_208715 = x_203719;\n        low_208716 = (int64_t) 0;\n        high_208717 = i_203718;\n        while (loop_while_208715) {\n            int64_t x_208718 = add64(low_208716, high_208717);\n            int64_t mid_208719 = sdiv64(x_208718, (int64_t) 2);\n            bool x_208720 = sle64((int64_t) 0, mid_208719);\n            bool y_208721 = slt64(mid_208719, defunc_0_f_res_203631);\n            bool bounds_check_208722 = x_208720 && y_208721;\n            bool index_certs_208723;\n            \n            if (!bounds_check_208722) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 7) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) mid_208719;\n                        global_failure_args[1] =\n                            (int64_t) defunc_0_f_res_203631;\n      ",
            "                  ;\n                    }\n                    local_failure = true;\n                    goto error_1;\n                }\n            }\n            \n            int64_t mid_id_208724;\n            \n            mid_id_208724 = ((__local int64_t *) color_231979)[mid_208719];\n            \n            bool cond_208725 = slt64(mid_id_208724, (int64_t) 0);\n            int64_t mid_idx_208726;\n            \n            if (cond_208725) {\n                mid_idx_208726 = (int64_t) 9223372036854775807;\n            } else {\n                mid_idx_208726 = mid_id_208724;\n            }\n            \n            bool cond_208727 = sle64(defunc_0_m_fun_res_208703, mid_idx_208726);\n            int64_t loopres_208728;\n            int64_t loopres_208729;\n            \n            if (cond_208727) {\n                int64_t loopres_t_res_208730 = sub64(mid_208719, (int64_t) 1);\n                \n                loopres_208728 = low_208716;\n                loopres_208729 = loopres_t_res_208730;\n            } else {\n                int64_t loopres_f_res_208731 = add64((int64_t) 1, mid_208719);\n                \n                loopres_208728 = loopres_f_res_208731;\n                loopres_208729 = high_208717;\n            }\n            \n            bool loop_cond_208732 = sle64(loopres_208728, loopres_208729);\n            bool loop_while_tmp_232788 = loop_cond_208732;\n            int64_t low_tmp_232789 = loopres_208728;\n            int64_t high_tmp_232790 = loopres_208729;\n            \n            loop_while_208715 = loop_while_tmp_232788;\n            low_208716 = low_tmp_232789;\n            high_208717 = high_tmp_232790;\n        }\n        init_idx_208712 = loop_while_208715;\n        init_idx_208713 = low_208716;\n        init_idx_208714 = high_208717;\n        \n        bool idx_208733;\n        int64_t idx_208734;\n        int64_t idx_208735;\n        int64_t idx_208736;\n        bool loop_while_208737;\n        int64_t l_idx_208738;\n        int64_t r_idx_208739;\n        int64_t span_",
            "208740;\n        \n        loop_while_208737 = loop_cond_203754;\n        l_idx_208738 = init_idx_208713;\n        r_idx_208739 = init_idx_208713;\n        span_208740 = (int64_t) 1;\n        while (loop_while_208737) {\n            int64_t max_arg_208741 = sub64(l_idx_208738, (int64_t) 1);\n            int64_t max_res_208742 = smax64((int64_t) 0, max_arg_208741);\n            int64_t min_arg_208743 = add64((int64_t) 1, r_idx_208739);\n            int64_t min_res_208744 = smin64(min_arg_208690, min_arg_208743);\n            bool x_208745 = sle64((int64_t) 0, max_res_208742);\n            bool y_208746 = slt64(max_res_208742, defunc_0_f_res_203631);\n            bool bounds_check_208747 = x_208745 && y_208746;\n            bool index_certs_208748;\n            \n            if (!bounds_check_208747) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 8) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) max_res_208742;\n                        global_failure_args[1] =\n                            (int64_t) defunc_0_f_res_203631;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_1;\n                }\n            }\n            \n            int64_t x_208749;\n            \n            x_208749 = ((__local int64_t *) color_231979)[max_res_208742];\n            \n            int64_t abs_arg_208750 = sub64(x_208749, defunc_0_m_fun_res_208703);\n            int64_t abs_res_208751 = abs64(abs_arg_208750);\n            bool x_208752 = sle64((int64_t) 0, min_res_208744);\n            bool y_208753 = slt64(min_res_208744, defunc_0_f_res_203631);\n            bool bounds_check_208754 = x_208752 && y_208753;\n            bool index_certs_208755;\n            \n            if (!bounds_check_208754) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 9) ==\n                        -1) {\n                        global_failure_ar",
            "gs[0] = (int64_t) min_res_208744;\n                        global_failure_args[1] =\n                            (int64_t) defunc_0_f_res_203631;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_1;\n                }\n            }\n            \n            int64_t x_208756;\n            \n            x_208756 = ((__local int64_t *) color_231979)[min_res_208744];\n            \n            int64_t abs_arg_208757 = sub64(x_208756, defunc_0_m_fun_res_208703);\n            int64_t abs_res_208758 = abs64(abs_arg_208757);\n            bool cond_208759 = max_res_208742 == l_idx_208738;\n            int64_t loopres_208760;\n            int64_t loopres_208761;\n            int64_t loopres_208762;\n            \n            if (cond_208759) {\n                loopres_208760 = l_idx_208738;\n                loopres_208761 = r_idx_208739;\n                loopres_208762 = min_res_203749;\n            } else {\n                bool cond_208763 = slt64(abs_res_208751, abs_res_208758);\n                bool cond_f_res_208764 = min_res_208744 == r_idx_208739;\n                bool x_208765 = !cond_208763;\n                bool y_208766 = cond_f_res_208764 && x_208765;\n                bool cond_208767 = cond_208763 || y_208766;\n                int64_t loopres_f_res_208768;\n                \n                if (cond_208767) {\n                    loopres_f_res_208768 = max_res_208742;\n                } else {\n                    loopres_f_res_208768 = l_idx_208738;\n                }\n                \n                int64_t loopres_f_res_208769;\n                \n                if (cond_208767) {\n                    loopres_f_res_208769 = r_idx_208739;\n                } else {\n                    loopres_f_res_208769 = min_res_208744;\n                }\n                \n                int64_t loopres_f_res_208770;\n                \n                if (cond_208767) {\n                    int64_t loopres_f_res_t_res_208771 = add64((int64_t) 1",
            ",\n                                                               span_208740);\n                    \n                    loopres_f_res_208770 = loopres_f_res_t_res_208771;\n                } else {\n                    int64_t loopres_f_res_f_res_208772 = add64((int64_t) 1,\n                                                               span_208740);\n                    \n                    loopres_f_res_208770 = loopres_f_res_f_res_208772;\n                }\n                loopres_208760 = loopres_f_res_208768;\n                loopres_208761 = loopres_f_res_208769;\n                loopres_208762 = loopres_f_res_208770;\n            }\n            \n            bool loop_cond_208773 = slt64(loopres_208762, min_res_203749);\n            bool loop_while_tmp_232791 = loop_cond_208773;\n            int64_t l_idx_tmp_232792 = loopres_208760;\n            int64_t r_idx_tmp_232793 = loopres_208761;\n            int64_t span_tmp_232794 = loopres_208762;\n            \n            loop_while_208737 = loop_while_tmp_232791;\n            l_idx_208738 = l_idx_tmp_232792;\n            r_idx_208739 = r_idx_tmp_232793;\n            span_208740 = span_tmp_232794;\n        }\n        idx_208733 = loop_while_208737;\n        idx_208734 = l_idx_208738;\n        idx_208735 = r_idx_208739;\n        idx_208736 = span_208740;\n        \n        int64_t min_res_208774 = smin64(min_arg_208691, idx_208734);\n        int64_t max_res_208775 = smax64((int64_t) 0, min_res_208774);\n        int64_t defunc_0_m_fun_res_208776;\n        \n        if (cond_208702) {\n            defunc_0_m_fun_res_208776 = (int64_t) 0;\n        } else {\n            int64_t y_208777 = sub64(s_n_m_203636, (int64_t) 1);\n            bool cond_208778 = gtid_208699 == y_208777;\n            int64_t defunc_0_m_fun_res_f_res_208779;\n            \n            if (cond_208778) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_208780 =\n                        sub64(pad_css_len_203632, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f",
            "_res_208779 =\n                    defunc_0_m_fun_res_f_res_t_res_208780;\n            } else {\n                int64_t x_208781 = sub64(gtid_208699, (int64_t) 1);\n                int64_t x_208782 = mul64(jump_s_203499, x_208781);\n                int64_t min_arg_208783 = add64((int64_t) 1, x_208782);\n                int64_t min_res_208784 = smin64(defunc_0_f_res_203631,\n                                                min_arg_208783);\n                \n                defunc_0_m_fun_res_f_res_208779 = min_res_208784;\n            }\n            defunc_0_m_fun_res_208776 = defunc_0_m_fun_res_f_res_208779;\n        }\n        \n        int64_t x_208785 = add64(min_res_208692, max_res_208775);\n        int64_t r_208786 = sub64(x_208785, (int64_t) 1);\n        bool x_208787 = sle64((int64_t) 0, r_208786);\n        bool y_208788 = slt64(r_208786, defunc_0_f_res_203631);\n        bool bounds_check_208789 = x_208787 && y_208788;\n        bool index_certs_208790;\n        \n        if (!bounds_check_208789) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 10) == -1) {\n                    global_failure_args[0] = (int64_t) r_208786;\n                    global_failure_args[1] = (int64_t) defunc_0_f_res_203631;\n                    ;\n                }\n                local_failure = true;\n                goto error_1;\n            }\n        }\n        \n        int64_t x_208791;\n        \n        x_208791 = ((__local int64_t *) color_231979)[r_208786];\n        \n        int64_t abs_arg_208792 = sub64(x_208791, defunc_0_m_fun_res_208776);\n        int64_t abs_res_208793 = abs64(abs_arg_208792);\n        bool x_208794 = sle64((int64_t) 0, max_res_208775);\n        bool y_208795 = slt64(max_res_208775, defunc_0_f_res_203631);\n        bool bounds_check_208796 = x_208794 && y_208795;\n        bool index_certs_208797;\n        \n        if (!bounds_check_208796) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 11) == -1) {\n                    gl",
            "obal_failure_args[0] = (int64_t) max_res_208775;\n                    global_failure_args[1] = (int64_t) defunc_0_f_res_203631;\n                    ;\n                }\n                local_failure = true;\n                goto error_1;\n            }\n        }\n        \n        int64_t x_208798;\n        \n        x_208798 = ((__local int64_t *) color_231979)[max_res_208775];\n        \n        int64_t abs_arg_208799 = sub64(x_208798, defunc_0_m_fun_res_208776);\n        int64_t abs_res_208800 = abs64(abs_arg_208799);\n        int64_t max_res_208801 = smax64(abs_res_208793, abs_res_208800);\n        double defunc_0_f_res_208802 = sitofp_i64_f64(max_res_208801);\n        double defunc_1_f_res_208803 = max_res_208696 + defunc_0_f_res_208802;\n        \n        ((__local double *) color_231978)[gtid_208699] = defunc_1_f_res_208803;\n        ((__local int64_t *) color_231977)[gtid_208699] = max_res_208775;\n    }\n    \n  error_1:\n    barrier(CLK_LOCAL_MEM_FENCE);\n    if (local_failure)\n        return;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_232795 = 0; i_232795 < sdiv_up64(s_n_m_203636 -\n                                                    sext_i32_i64(local_tid_232774),\n                                                    computed_group_sizze_208667);\n         i_232795++) {\n        int64_t tmp_232796;\n        \n        tmp_232796 = ((__local int64_t *) color_231977)[i_232795 *\n                                                        computed_group_sizze_208667 +\n                                                        sext_i32_i64(local_tid_232774)];\n        ((__global int64_t *) mem_229320)[gtid_208679 * (s_n_m_203636 *\n                                                         n_p_203492) +\n                                          gtid_208680 * s_n_m_203636 +\n                                          (i_232795 *\n                                           computed_group_sizze_208667 +\n                                           sext_i32_i64(local_tid_232774))] =\n            tmp",
            "_232796;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_232797 = 0; i_232797 < sdiv_up64(s_n_m_203636 -\n                                                    sext_i32_i64(local_tid_232774),\n                                                    computed_group_sizze_208667);\n         i_232797++) {\n        double tmp_232798;\n        \n        tmp_232798 = ((__local double *) color_231978)[i_232797 *\n                                                       computed_group_sizze_208667 +\n                                                       sext_i32_i64(local_tid_232774)];\n        ((__global double *) mem_229325)[gtid_208679 * (s_n_m_203636 *\n                                                        n_p_203492) +\n                                         gtid_208680 * s_n_m_203636 +\n                                         (i_232797 *\n                                          computed_group_sizze_208667 +\n                                          sext_i32_i64(local_tid_232774))] =\n            tmp_232798;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n  error_2:\n    return;\n}\n__kernel void mainzisegmap_intragroup_209082(__global int *global_failure,\n                                             int failure_is_an_option, __global\n                                             int64_t *global_failure_args,\n                                             uint color_231982_backing_offset_0,\n                                             uint color_231981_backing_offset_1,\n                                             uint color_231980_backing_offset_2,\n                                             int64_t n_203490,\n                                             int64_t q_l_203495,\n                                             int64_t jump_l_203501,\n                                             int64_t partition_sizze_203577,\n                                             int64_t l_n_m_203643,\n                                             int64_t i_203670,\n                                     ",
            "        unsigned char x_203671_bits,\n                                             int64_t min_res_203881,\n                                             unsigned char loop_cond_203886_bits,\n                                             double i64_res_203887,\n                                             int64_t computed_group_sizze_208973,\n                                             __global\n                                             unsigned char *ext_mem_229196,\n                                             __global\n                                             unsigned char *ext_mem_229197,\n                                             __global unsigned char *mem_229379,\n                                             __global unsigned char *mem_229383)\n{\n    bool x_203671 = x_203671_bits;\n    bool loop_cond_203886 = loop_cond_203886_bits;\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *color_231982_backing_2 =\n                           &shared_mem[color_231982_backing_offset_0];\n    volatile unsigned char *color_231981_backing_1 =\n                           &shared_mem[color_231981_backing_offset_1];\n    volatile unsigned char *color_231980_backing_0 =\n                           &shared_mem[color_231980_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_232842;\n    int32_t local_tid_232843;\n    int64_t group_sizze_232846;\n    int32_t wave_sizze_232845;\n    int32_t group_tid_232844;\n    \n    global_tid_232842 = get_global_id(0);\n    local_tid_232843 = get_local_id(0);\n    group_sizze_232846 = get_local_size(0);\n    wave_sizze_232845 = LOCKSTEP_WIDTH;\n    group_tid_232844 = get_group_id(0);\n    \n    int32_t phys_tid_209082 = group_tid_232844;\n    int64_t slice_232848 = n_2",
            "03490;\n    int64_t ltid_pre_232847 = sext_i32_i64(local_tid_232843);\n    int64_t remnant_232849 = sext_i32_i64(local_tid_232843) - ltid_pre_232847;\n    int64_t slice_232851 = l_n_m_203643;\n    int64_t ltid_pre_232850 = sext_i32_i64(local_tid_232843);\n    int64_t remnant_232852 = sext_i32_i64(local_tid_232843) - ltid_pre_232850;\n    int64_t slice_232853 = partition_sizze_203577;\n    int64_t gtid_209081 = sext_i32_i64(group_tid_232844);\n    int64_t remnant_232854 = sext_i32_i64(group_tid_232844) - gtid_209081;\n    __local unsigned char *color_231980;\n    \n    color_231980 = (__local unsigned char *) color_231980_backing_0;\n    \n    __local unsigned char *color_231981;\n    \n    color_231981 = (__local unsigned char *) color_231981_backing_1;\n    \n    __local unsigned char *color_231982;\n    \n    color_231982 = (__local unsigned char *) color_231982_backing_2;\n    \n    int64_t x_209085;\n    \n    x_209085 = ((__global int64_t *) ext_mem_229196)[gtid_209081];\n    \n    int64_t gtid_209087 = sext_i32_i64(sext_i64_i32(ltid_pre_232847));\n    int32_t phys_tid_209088 = local_tid_232843;\n    \n    if (slt64(gtid_209087, n_203490)) {\n        int64_t x_209089;\n        \n        x_209089 = ((__global int64_t *) ext_mem_229197)[gtid_209081 *\n                                                         n_203490 +\n                                                         gtid_209087];\n        \n        int64_t defunc_0_f_res_209090 = add64((int64_t) 1, x_209089);\n        \n        ((__local int64_t *) color_231982)[gtid_209087] = defunc_0_f_res_209090;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t min_arg_209091 = sub64(x_209085, (int64_t) 1);\n    int64_t min_arg_209092 = sub64(x_209085, min_res_203881);\n    int64_t min_res_209093 = smin64(q_l_203495, x_209085);\n    double i64_res_209094 = sitofp_i64_f64(x_209085);\n    double x_209095 = i64_res_203887 - i64_res_209094;\n    double max_arg_209096 = x_209095 / 2.0;\n    double max_res_209097 = fmax64(0.0, max_arg_209096);\n    int64_t gt",
            "id_209100 = sext_i32_i64(sext_i64_i32(ltid_pre_232850));\n    int32_t phys_tid_209101 = local_tid_232843;\n    \n    if (slt64(gtid_209100, l_n_m_203643)) {\n        int64_t min_arg_209103 = mul64(jump_l_203501, gtid_209100);\n        int64_t min_res_209104 = smin64(i_203670, min_arg_209103);\n        int64_t defunc_0_g_res_209105 = add64((int64_t) 1, min_res_209104);\n        bool init_idx_209106;\n        int64_t init_idx_209107;\n        int64_t init_idx_209108;\n        bool loop_while_209109;\n        int64_t low_209110;\n        int64_t high_209111;\n        \n        loop_while_209109 = x_203671;\n        low_209110 = (int64_t) 0;\n        high_209111 = i_203670;\n        while (loop_while_209109) {\n            int64_t x_209112 = add64(low_209110, high_209111);\n            int64_t mid_209113 = sdiv64(x_209112, (int64_t) 2);\n            bool x_209114 = sle64((int64_t) 0, mid_209113);\n            bool y_209115 = slt64(mid_209113, n_203490);\n            bool bounds_check_209116 = x_209114 && y_209115;\n            bool index_certs_209117;\n            \n            if (!bounds_check_209116) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 17) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) mid_209113;\n                        global_failure_args[1] = (int64_t) n_203490;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_1;\n                }\n            }\n            \n            int64_t mid_id_209118;\n            \n            mid_id_209118 = ((__local int64_t *) color_231982)[mid_209113];\n            \n            bool cond_209119 = slt64(mid_id_209118, (int64_t) 0);\n            int64_t mid_idx_209120;\n            \n            if (cond_209119) {\n                mid_idx_209120 = (int64_t) 9223372036854775807;\n            } else {\n                mid_idx_209120 = mid_id_209118;\n            }\n            \n            bool cond_209121 ",
            "= sle64(defunc_0_g_res_209105, mid_idx_209120);\n            int64_t loopres_209122;\n            int64_t loopres_209123;\n            \n            if (cond_209121) {\n                int64_t loopres_t_res_209124 = sub64(mid_209113, (int64_t) 1);\n                \n                loopres_209122 = low_209110;\n                loopres_209123 = loopres_t_res_209124;\n            } else {\n                int64_t loopres_f_res_209125 = add64((int64_t) 1, mid_209113);\n                \n                loopres_209122 = loopres_f_res_209125;\n                loopres_209123 = high_209111;\n            }\n            \n            bool loop_cond_209126 = sle64(loopres_209122, loopres_209123);\n            bool loop_while_tmp_232855 = loop_cond_209126;\n            int64_t low_tmp_232856 = loopres_209122;\n            int64_t high_tmp_232857 = loopres_209123;\n            \n            loop_while_209109 = loop_while_tmp_232855;\n            low_209110 = low_tmp_232856;\n            high_209111 = high_tmp_232857;\n        }\n        init_idx_209106 = loop_while_209109;\n        init_idx_209107 = low_209110;\n        init_idx_209108 = high_209111;\n        \n        bool idx_209127;\n        int64_t idx_209128;\n        int64_t idx_209129;\n        int64_t idx_209130;\n        bool loop_while_209131;\n        int64_t l_idx_209132;\n        int64_t r_idx_209133;\n        int64_t span_209134;\n        \n        loop_while_209131 = loop_cond_203886;\n        l_idx_209132 = init_idx_209107;\n        r_idx_209133 = init_idx_209107;\n        span_209134 = (int64_t) 1;\n        while (loop_while_209131) {\n            int64_t max_arg_209135 = sub64(l_idx_209132, (int64_t) 1);\n            int64_t max_res_209136 = smax64((int64_t) 0, max_arg_209135);\n            int64_t min_arg_209137 = add64((int64_t) 1, r_idx_209133);\n            int64_t min_res_209138 = smin64(min_arg_209091, min_arg_209137);\n            bool x_209139 = sle64((int64_t) 0, max_res_209136);\n            bool y_209140 = slt64(max_res_209136, n_203490);\n       ",
            "     bool bounds_check_209141 = x_209139 && y_209140;\n            bool index_certs_209142;\n            \n            if (!bounds_check_209141) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 18) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) max_res_209136;\n                        global_failure_args[1] = (int64_t) n_203490;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_1;\n                }\n            }\n            \n            int64_t x_209143;\n            \n            x_209143 = ((__local int64_t *) color_231982)[max_res_209136];\n            \n            int64_t abs_arg_209144 = sub64(x_209143, defunc_0_g_res_209105);\n            int64_t abs_res_209145 = abs64(abs_arg_209144);\n            bool x_209146 = sle64((int64_t) 0, min_res_209138);\n            bool y_209147 = slt64(min_res_209138, n_203490);\n            bool bounds_check_209148 = x_209146 && y_209147;\n            bool index_certs_209149;\n            \n            if (!bounds_check_209148) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 19) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) min_res_209138;\n                        global_failure_args[1] = (int64_t) n_203490;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_1;\n                }\n            }\n            \n            int64_t x_209150;\n            \n            x_209150 = ((__local int64_t *) color_231982)[min_res_209138];\n            \n            int64_t abs_arg_209151 = sub64(x_209150, defunc_0_g_res_209105);\n            int64_t abs_res_209152 = abs64(abs_arg_209151);\n            bool cond_209153 = max_res_209136 == l_idx_209132;\n            int64_t loopres_209154;\n            int64_t loopres_209155;\n            int64_t loopres_20915",
            "6;\n            \n            if (cond_209153) {\n                loopres_209154 = l_idx_209132;\n                loopres_209155 = r_idx_209133;\n                loopres_209156 = min_res_203881;\n            } else {\n                bool cond_209157 = slt64(abs_res_209145, abs_res_209152);\n                bool cond_f_res_209158 = min_res_209138 == r_idx_209133;\n                bool x_209159 = !cond_209157;\n                bool y_209160 = cond_f_res_209158 && x_209159;\n                bool cond_209161 = cond_209157 || y_209160;\n                int64_t loopres_f_res_209162;\n                \n                if (cond_209161) {\n                    loopres_f_res_209162 = max_res_209136;\n                } else {\n                    loopres_f_res_209162 = l_idx_209132;\n                }\n                \n                int64_t loopres_f_res_209163;\n                \n                if (cond_209161) {\n                    loopres_f_res_209163 = r_idx_209133;\n                } else {\n                    loopres_f_res_209163 = min_res_209138;\n                }\n                \n                int64_t loopres_f_res_209164;\n                \n                if (cond_209161) {\n                    int64_t loopres_f_res_t_res_209165 = add64((int64_t) 1,\n                                                               span_209134);\n                    \n                    loopres_f_res_209164 = loopres_f_res_t_res_209165;\n                } else {\n                    int64_t loopres_f_res_f_res_209166 = add64((int64_t) 1,\n                                                               span_209134);\n                    \n                    loopres_f_res_209164 = loopres_f_res_f_res_209166;\n                }\n                loopres_209154 = loopres_f_res_209162;\n                loopres_209155 = loopres_f_res_209163;\n                loopres_209156 = loopres_f_res_209164;\n            }\n            \n            bool loop_cond_209167 = slt64(loopres_209156, min_res_203881);\n            bool loop_while",
            "_tmp_232858 = loop_cond_209167;\n            int64_t l_idx_tmp_232859 = loopres_209154;\n            int64_t r_idx_tmp_232860 = loopres_209155;\n            int64_t span_tmp_232861 = loopres_209156;\n            \n            loop_while_209131 = loop_while_tmp_232858;\n            l_idx_209132 = l_idx_tmp_232859;\n            r_idx_209133 = r_idx_tmp_232860;\n            span_209134 = span_tmp_232861;\n        }\n        idx_209127 = loop_while_209131;\n        idx_209128 = l_idx_209132;\n        idx_209129 = r_idx_209133;\n        idx_209130 = span_209134;\n        \n        int64_t min_res_209168 = smin64(min_arg_209092, idx_209128);\n        int64_t max_res_209169 = smax64((int64_t) 0, min_res_209168);\n        int64_t x_209170 = add64(min_res_209093, max_res_209169);\n        int64_t r_209171 = sub64(x_209170, (int64_t) 1);\n        bool x_209172 = sle64((int64_t) 0, r_209171);\n        bool y_209173 = slt64(r_209171, n_203490);\n        bool bounds_check_209174 = x_209172 && y_209173;\n        bool index_certs_209175;\n        \n        if (!bounds_check_209174) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 20) == -1) {\n                    global_failure_args[0] = (int64_t) r_209171;\n                    global_failure_args[1] = (int64_t) n_203490;\n                    ;\n                }\n                local_failure = true;\n                goto error_1;\n            }\n        }\n        \n        int64_t x_209176;\n        \n        x_209176 = ((__global int64_t *) ext_mem_229197)[gtid_209081 *\n                                                         n_203490 + r_209171];\n        \n        int64_t abs_arg_209177 = sub64(x_209176, min_res_209104);\n        int64_t abs_res_209178 = abs64(abs_arg_209177);\n        bool x_209179 = sle64((int64_t) 0, max_res_209169);\n        bool y_209180 = slt64(max_res_209169, n_203490);\n        bool bounds_check_209181 = x_209179 && y_209180;\n        bool index_certs_209182;\n        \n        if (!bounds_check_209181) {\n      ",
            "      {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 21) == -1) {\n                    global_failure_args[0] = (int64_t) max_res_209169;\n                    global_failure_args[1] = (int64_t) n_203490;\n                    ;\n                }\n                local_failure = true;\n                goto error_1;\n            }\n        }\n        \n        int64_t x_209183;\n        \n        x_209183 = ((__global int64_t *) ext_mem_229197)[gtid_209081 *\n                                                         n_203490 +\n                                                         max_res_209169];\n        \n        int64_t abs_arg_209184 = sub64(x_209183, min_res_209104);\n        int64_t abs_res_209185 = abs64(abs_arg_209184);\n        int64_t max_res_209186 = smax64(abs_res_209178, abs_res_209185);\n        double defunc_0_f_res_209187 = sitofp_i64_f64(max_res_209186);\n        double defunc_1_f_res_209188 = max_res_209097 + defunc_0_f_res_209187;\n        \n        ((__local double *) color_231981)[gtid_209100] = defunc_1_f_res_209188;\n        ((__local int64_t *) color_231980)[gtid_209100] = max_res_209169;\n    }\n    \n  error_1:\n    barrier(CLK_LOCAL_MEM_FENCE);\n    if (local_failure)\n        return;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_232862 = 0; i_232862 < sdiv_up64(l_n_m_203643 -\n                                                    sext_i32_i64(local_tid_232843),\n                                                    computed_group_sizze_208973);\n         i_232862++) {\n        int64_t tmp_232863;\n        \n        tmp_232863 = ((__local int64_t *) color_231980)[i_232862 *\n                                                        computed_group_sizze_208973 +\n                                                        sext_i32_i64(local_tid_232843)];\n        ((__global int64_t *) mem_229379)[gtid_209081 * l_n_m_203643 +\n                                          (i_232862 *\n                                           computed_group_sizze_208973 +\n         ",
            "                                  sext_i32_i64(local_tid_232843))] =\n            tmp_232863;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_232864 = 0; i_232864 < sdiv_up64(l_n_m_203643 -\n                                                    sext_i32_i64(local_tid_232843),\n                                                    computed_group_sizze_208973);\n         i_232864++) {\n        double tmp_232865;\n        \n        tmp_232865 = ((__local double *) color_231981)[i_232864 *\n                                                       computed_group_sizze_208973 +\n                                                       sext_i32_i64(local_tid_232843)];\n        ((__global double *) mem_229383)[gtid_209081 * l_n_m_203643 +\n                                         (i_232864 *\n                                          computed_group_sizze_208973 +\n                                          sext_i32_i64(local_tid_232843))] =\n            tmp_232865;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n  error_2:\n    return;\n}\n__kernel void mainzisegmap_intragroup_209708(__global int *global_failure,\n                                             int failure_is_an_option, __global\n                                             int64_t *global_failure_args,\n                                             uint color_231985_backing_offset_0,\n                                             uint color_231984_backing_offset_1,\n                                             uint color_231983_backing_offset_2,\n                                             int64_t n_203490,\n                                             int64_t q_t_203494,\n                                             int64_t jump_t_203500,\n                                             int64_t partition_sizze_203577,\n                                             int64_t t_n_m_203650,\n                                             int64_t i_203670,\n                                             unsigned char x_203671_bits,\n                    ",
            "                         int64_t min_res_203993,\n                                             unsigned char loop_cond_203998_bits,\n                                             double i64_res_203999,\n                                             int64_t computed_group_sizze_209599,\n                                             __global\n                                             unsigned char *ext_mem_229196,\n                                             __global\n                                             unsigned char *ext_mem_229197,\n                                             __global unsigned char *mem_229428,\n                                             __global unsigned char *mem_229432)\n{\n    bool x_203671 = x_203671_bits;\n    bool loop_cond_203998 = loop_cond_203998_bits;\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *color_231985_backing_2 =\n                           &shared_mem[color_231985_backing_offset_0];\n    volatile unsigned char *color_231984_backing_1 =\n                           &shared_mem[color_231984_backing_offset_1];\n    volatile unsigned char *color_231983_backing_0 =\n                           &shared_mem[color_231983_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_232902;\n    int32_t local_tid_232903;\n    int64_t group_sizze_232906;\n    int32_t wave_sizze_232905;\n    int32_t group_tid_232904;\n    \n    global_tid_232902 = get_global_id(0);\n    local_tid_232903 = get_local_id(0);\n    group_sizze_232906 = get_local_size(0);\n    wave_sizze_232905 = LOCKSTEP_WIDTH;\n    group_tid_232904 = get_group_id(0);\n    \n    int32_t phys_tid_209708 = group_tid_232904;\n    int64_t slice_232908 = n_203490;\n    int64_t ltid_pre_232907 = sext_i32_i64(local_t",
            "id_232903);\n    int64_t remnant_232909 = sext_i32_i64(local_tid_232903) - ltid_pre_232907;\n    int64_t slice_232911 = t_n_m_203650;\n    int64_t ltid_pre_232910 = sext_i32_i64(local_tid_232903);\n    int64_t remnant_232912 = sext_i32_i64(local_tid_232903) - ltid_pre_232910;\n    int64_t slice_232913 = partition_sizze_203577;\n    int64_t gtid_209707 = sext_i32_i64(group_tid_232904);\n    int64_t remnant_232914 = sext_i32_i64(group_tid_232904) - gtid_209707;\n    __local unsigned char *color_231983;\n    \n    color_231983 = (__local unsigned char *) color_231983_backing_0;\n    \n    __local unsigned char *color_231984;\n    \n    color_231984 = (__local unsigned char *) color_231984_backing_1;\n    \n    __local unsigned char *color_231985;\n    \n    color_231985 = (__local unsigned char *) color_231985_backing_2;\n    \n    int64_t x_209711;\n    \n    x_209711 = ((__global int64_t *) ext_mem_229196)[gtid_209707];\n    \n    int64_t gtid_209713 = sext_i32_i64(sext_i64_i32(ltid_pre_232907));\n    int32_t phys_tid_209714 = local_tid_232903;\n    \n    if (slt64(gtid_209713, n_203490)) {\n        int64_t x_209715;\n        \n        x_209715 = ((__global int64_t *) ext_mem_229197)[gtid_209707 *\n                                                         n_203490 +\n                                                         gtid_209713];\n        \n        int64_t defunc_0_f_res_209716 = add64((int64_t) 1, x_209715);\n        \n        ((__local int64_t *) color_231985)[gtid_209713] = defunc_0_f_res_209716;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t min_arg_209717 = sub64(x_209711, (int64_t) 1);\n    int64_t min_arg_209718 = sub64(x_209711, min_res_203993);\n    int64_t min_res_209719 = smin64(q_t_203494, x_209711);\n    double i64_res_209720 = sitofp_i64_f64(x_209711);\n    double x_209721 = i64_res_203999 - i64_res_209720;\n    double max_arg_209722 = x_209721 / 2.0;\n    double max_res_209723 = fmax64(0.0, max_arg_209722);\n    int64_t gtid_209726 = sext_i32_i64(sext_i64_i32(ltid_pre_232910));\n",
            "    int32_t phys_tid_209727 = local_tid_232903;\n    \n    if (slt64(gtid_209726, t_n_m_203650)) {\n        int64_t min_arg_209729 = mul64(jump_t_203500, gtid_209726);\n        int64_t min_res_209730 = smin64(i_203670, min_arg_209729);\n        int64_t defunc_0_g_res_209731 = add64((int64_t) 1, min_res_209730);\n        bool init_idx_209732;\n        int64_t init_idx_209733;\n        int64_t init_idx_209734;\n        bool loop_while_209735;\n        int64_t low_209736;\n        int64_t high_209737;\n        \n        loop_while_209735 = x_203671;\n        low_209736 = (int64_t) 0;\n        high_209737 = i_203670;\n        while (loop_while_209735) {\n            int64_t x_209738 = add64(low_209736, high_209737);\n            int64_t mid_209739 = sdiv64(x_209738, (int64_t) 2);\n            bool x_209740 = sle64((int64_t) 0, mid_209739);\n            bool y_209741 = slt64(mid_209739, n_203490);\n            bool bounds_check_209742 = x_209740 && y_209741;\n            bool index_certs_209743;\n            \n            if (!bounds_check_209742) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 27) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) mid_209739;\n                        global_failure_args[1] = (int64_t) n_203490;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_1;\n                }\n            }\n            \n            int64_t mid_id_209744;\n            \n            mid_id_209744 = ((__local int64_t *) color_231985)[mid_209739];\n            \n            bool cond_209745 = slt64(mid_id_209744, (int64_t) 0);\n            int64_t mid_idx_209746;\n            \n            if (cond_209745) {\n                mid_idx_209746 = (int64_t) 9223372036854775807;\n            } else {\n                mid_idx_209746 = mid_id_209744;\n            }\n            \n            bool cond_209747 = sle64(defunc_0_g_res_209731, mid_idx_209746);\n         ",
            "   int64_t loopres_209748;\n            int64_t loopres_209749;\n            \n            if (cond_209747) {\n                int64_t loopres_t_res_209750 = sub64(mid_209739, (int64_t) 1);\n                \n                loopres_209748 = low_209736;\n                loopres_209749 = loopres_t_res_209750;\n            } else {\n                int64_t loopres_f_res_209751 = add64((int64_t) 1, mid_209739);\n                \n                loopres_209748 = loopres_f_res_209751;\n                loopres_209749 = high_209737;\n            }\n            \n            bool loop_cond_209752 = sle64(loopres_209748, loopres_209749);\n            bool loop_while_tmp_232915 = loop_cond_209752;\n            int64_t low_tmp_232916 = loopres_209748;\n            int64_t high_tmp_232917 = loopres_209749;\n            \n            loop_while_209735 = loop_while_tmp_232915;\n            low_209736 = low_tmp_232916;\n            high_209737 = high_tmp_232917;\n        }\n        init_idx_209732 = loop_while_209735;\n        init_idx_209733 = low_209736;\n        init_idx_209734 = high_209737;\n        \n        bool idx_209753;\n        int64_t idx_209754;\n        int64_t idx_209755;\n        int64_t idx_209756;\n        bool loop_while_209757;\n        int64_t l_idx_209758;\n        int64_t r_idx_209759;\n        int64_t span_209760;\n        \n        loop_while_209757 = loop_cond_203998;\n        l_idx_209758 = init_idx_209733;\n        r_idx_209759 = init_idx_209733;\n        span_209760 = (int64_t) 1;\n        while (loop_while_209757) {\n            int64_t max_arg_209761 = sub64(l_idx_209758, (int64_t) 1);\n            int64_t max_res_209762 = smax64((int64_t) 0, max_arg_209761);\n            int64_t min_arg_209763 = add64((int64_t) 1, r_idx_209759);\n            int64_t min_res_209764 = smin64(min_arg_209717, min_arg_209763);\n            bool x_209765 = sle64((int64_t) 0, max_res_209762);\n            bool y_209766 = slt64(max_res_209762, n_203490);\n            bool bounds_check_209767 = x_209765 && y_209766;\n   ",
            "         bool index_certs_209768;\n            \n            if (!bounds_check_209767) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 28) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) max_res_209762;\n                        global_failure_args[1] = (int64_t) n_203490;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_1;\n                }\n            }\n            \n            int64_t x_209769;\n            \n            x_209769 = ((__local int64_t *) color_231985)[max_res_209762];\n            \n            int64_t abs_arg_209770 = sub64(x_209769, defunc_0_g_res_209731);\n            int64_t abs_res_209771 = abs64(abs_arg_209770);\n            bool x_209772 = sle64((int64_t) 0, min_res_209764);\n            bool y_209773 = slt64(min_res_209764, n_203490);\n            bool bounds_check_209774 = x_209772 && y_209773;\n            bool index_certs_209775;\n            \n            if (!bounds_check_209774) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 29) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) min_res_209764;\n                        global_failure_args[1] = (int64_t) n_203490;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_1;\n                }\n            }\n            \n            int64_t x_209776;\n            \n            x_209776 = ((__local int64_t *) color_231985)[min_res_209764];\n            \n            int64_t abs_arg_209777 = sub64(x_209776, defunc_0_g_res_209731);\n            int64_t abs_res_209778 = abs64(abs_arg_209777);\n            bool cond_209779 = max_res_209762 == l_idx_209758;\n            int64_t loopres_209780;\n            int64_t loopres_209781;\n            int64_t loopres_209782;\n            \n            if (cond_209779) {\n          ",
            "      loopres_209780 = l_idx_209758;\n                loopres_209781 = r_idx_209759;\n                loopres_209782 = min_res_203993;\n            } else {\n                bool cond_209783 = slt64(abs_res_209771, abs_res_209778);\n                bool cond_f_res_209784 = min_res_209764 == r_idx_209759;\n                bool x_209785 = !cond_209783;\n                bool y_209786 = cond_f_res_209784 && x_209785;\n                bool cond_209787 = cond_209783 || y_209786;\n                int64_t loopres_f_res_209788;\n                \n                if (cond_209787) {\n                    loopres_f_res_209788 = max_res_209762;\n                } else {\n                    loopres_f_res_209788 = l_idx_209758;\n                }\n                \n                int64_t loopres_f_res_209789;\n                \n                if (cond_209787) {\n                    loopres_f_res_209789 = r_idx_209759;\n                } else {\n                    loopres_f_res_209789 = min_res_209764;\n                }\n                \n                int64_t loopres_f_res_209790;\n                \n                if (cond_209787) {\n                    int64_t loopres_f_res_t_res_209791 = add64((int64_t) 1,\n                                                               span_209760);\n                    \n                    loopres_f_res_209790 = loopres_f_res_t_res_209791;\n                } else {\n                    int64_t loopres_f_res_f_res_209792 = add64((int64_t) 1,\n                                                               span_209760);\n                    \n                    loopres_f_res_209790 = loopres_f_res_f_res_209792;\n                }\n                loopres_209780 = loopres_f_res_209788;\n                loopres_209781 = loopres_f_res_209789;\n                loopres_209782 = loopres_f_res_209790;\n            }\n            \n            bool loop_cond_209793 = slt64(loopres_209782, min_res_203993);\n            bool loop_while_tmp_232918 = loop_cond_209793;\n            int64_t l_idx",
            "_tmp_232919 = loopres_209780;\n            int64_t r_idx_tmp_232920 = loopres_209781;\n            int64_t span_tmp_232921 = loopres_209782;\n            \n            loop_while_209757 = loop_while_tmp_232918;\n            l_idx_209758 = l_idx_tmp_232919;\n            r_idx_209759 = r_idx_tmp_232920;\n            span_209760 = span_tmp_232921;\n        }\n        idx_209753 = loop_while_209757;\n        idx_209754 = l_idx_209758;\n        idx_209755 = r_idx_209759;\n        idx_209756 = span_209760;\n        \n        int64_t min_res_209794 = smin64(min_arg_209718, idx_209754);\n        int64_t max_res_209795 = smax64((int64_t) 0, min_res_209794);\n        int64_t x_209796 = add64(min_res_209719, max_res_209795);\n        int64_t r_209797 = sub64(x_209796, (int64_t) 1);\n        bool x_209798 = sle64((int64_t) 0, r_209797);\n        bool y_209799 = slt64(r_209797, n_203490);\n        bool bounds_check_209800 = x_209798 && y_209799;\n        bool index_certs_209801;\n        \n        if (!bounds_check_209800) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 30) == -1) {\n                    global_failure_args[0] = (int64_t) r_209797;\n                    global_failure_args[1] = (int64_t) n_203490;\n                    ;\n                }\n                local_failure = true;\n                goto error_1;\n            }\n        }\n        \n        int64_t x_209802;\n        \n        x_209802 = ((__global int64_t *) ext_mem_229197)[gtid_209707 *\n                                                         n_203490 + r_209797];\n        \n        int64_t abs_arg_209803 = sub64(x_209802, min_res_209730);\n        int64_t abs_res_209804 = abs64(abs_arg_209803);\n        bool x_209805 = sle64((int64_t) 0, max_res_209795);\n        bool y_209806 = slt64(max_res_209795, n_203490);\n        bool bounds_check_209807 = x_209805 && y_209806;\n        bool index_certs_209808;\n        \n        if (!bounds_check_209807) {\n            {\n                if (atomic_cmpxchg_i32_global(glo",
            "bal_failure, -1, 31) == -1) {\n                    global_failure_args[0] = (int64_t) max_res_209795;\n                    global_failure_args[1] = (int64_t) n_203490;\n                    ;\n                }\n                local_failure = true;\n                goto error_1;\n            }\n        }\n        \n        int64_t x_209809;\n        \n        x_209809 = ((__global int64_t *) ext_mem_229197)[gtid_209707 *\n                                                         n_203490 +\n                                                         max_res_209795];\n        \n        int64_t abs_arg_209810 = sub64(x_209809, min_res_209730);\n        int64_t abs_res_209811 = abs64(abs_arg_209810);\n        int64_t max_res_209812 = smax64(abs_res_209804, abs_res_209811);\n        double defunc_0_f_res_209813 = sitofp_i64_f64(max_res_209812);\n        double defunc_1_f_res_209814 = max_res_209723 + defunc_0_f_res_209813;\n        \n        ((__local double *) color_231984)[gtid_209726] = defunc_1_f_res_209814;\n        ((__local int64_t *) color_231983)[gtid_209726] = max_res_209795;\n    }\n    \n  error_1:\n    barrier(CLK_LOCAL_MEM_FENCE);\n    if (local_failure)\n        return;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_232922 = 0; i_232922 < sdiv_up64(t_n_m_203650 -\n                                                    sext_i32_i64(local_tid_232903),\n                                                    computed_group_sizze_209599);\n         i_232922++) {\n        int64_t tmp_232923;\n        \n        tmp_232923 = ((__local int64_t *) color_231983)[i_232922 *\n                                                        computed_group_sizze_209599 +\n                                                        sext_i32_i64(local_tid_232903)];\n        ((__global int64_t *) mem_229428)[gtid_209707 * t_n_m_203650 +\n                                          (i_232922 *\n                                           computed_group_sizze_209599 +\n                                           sext_i32_i64(local_tid_",
            "232903))] =\n            tmp_232923;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_232924 = 0; i_232924 < sdiv_up64(t_n_m_203650 -\n                                                    sext_i32_i64(local_tid_232903),\n                                                    computed_group_sizze_209599);\n         i_232924++) {\n        double tmp_232925;\n        \n        tmp_232925 = ((__local double *) color_231984)[i_232924 *\n                                                       computed_group_sizze_209599 +\n                                                       sext_i32_i64(local_tid_232903)];\n        ((__global double *) mem_229432)[gtid_209707 * t_n_m_203650 +\n                                         (i_232924 *\n                                          computed_group_sizze_209599 +\n                                          sext_i32_i64(local_tid_232903))] =\n            tmp_232925;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n  error_2:\n    return;\n}\n__kernel void mainzisegmap_intragroup_211768(__global int *global_failure,\n                                             uint red_arr_mem_233099_backing_offset_0,\n                                             uint red_arr_mem_233081_backing_offset_1,\n                                             uint color_231991_backing_offset_2,\n                                             uint color_231990_backing_offset_3,\n                                             uint color_231989_backing_offset_4,\n                                             uint color_231988_backing_offset_5,\n                                             int64_t n_p_203492,\n                                             int64_t q_s_203493,\n                                             int64_t jump_s_203499,\n                                             int64_t partition_sizze_203577,\n                                             int64_t defunc_0_f_res_203631,\n                                             int64_t pad_css_len_203632,\n                              ",
            "               int64_t s_n_m_203636,\n                                             int64_t computed_group_sizze_211670,\n                                             __global\n                                             unsigned char *ext_mem_229264,\n                                             __global\n                                             unsigned char *ext_mem_229265,\n                                             __global\n                                             unsigned char *ext_mem_229362,\n                                             __global\n                                             unsigned char *ext_mem_229363,\n                                             __global unsigned char *mem_229526,\n                                             __global unsigned char *mem_229531,\n                                             __global unsigned char *mem_229675)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_233099_backing_5 =\n                           &shared_mem[red_arr_mem_233099_backing_offset_0];\n    volatile unsigned char *red_arr_mem_233081_backing_4 =\n                           &shared_mem[red_arr_mem_233081_backing_offset_1];\n    volatile unsigned char *color_231991_backing_3 =\n                           &shared_mem[color_231991_backing_offset_2];\n    volatile unsigned char *color_231990_backing_2 =\n                           &shared_mem[color_231990_backing_offset_3];\n    volatile unsigned char *color_231989_backing_1 =\n                           &shared_mem[color_231989_backing_offset_4];\n    volatile unsigned char *color_231988_backing_0 =\n                           &shared_mem[color_231988_backing_offset_5];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233063;\n    int32_t local_tid_233064;\n    int64_t group_sizze_233067;\n    int32_t wave_sizze_233066;\n    int32_t group_tid_233065;\n    \n    global_tid_233063 = get_global_id(0);\n ",
            "   local_tid_233064 = get_local_id(0);\n    group_sizze_233067 = get_local_size(0);\n    wave_sizze_233066 = LOCKSTEP_WIDTH;\n    group_tid_233065 = get_group_id(0);\n    \n    int32_t phys_tid_211768 = group_tid_233065;\n    int64_t slice_233069 = s_n_m_203636;\n    int64_t ltid_pre_233068 = sext_i32_i64(local_tid_233064);\n    int64_t remnant_233070 = sext_i32_i64(local_tid_233064) - ltid_pre_233068;\n    int64_t slice_233073 = q_s_203493;\n    int64_t slice_233074 = s_n_m_203636 * slice_233073;\n    int64_t ltid_pre_233071 = squot64(sext_i32_i64(local_tid_233064),\n                                      slice_233073);\n    int64_t remnant_233075 = sext_i32_i64(local_tid_233064) - ltid_pre_233071 *\n            slice_233073;\n    int64_t ltid_pre_233072 = remnant_233075;\n    int64_t remnant_233076 = remnant_233075 - ltid_pre_233072;\n    int64_t slice_233077 = n_p_203492;\n    int64_t slice_233078 = partition_sizze_203577 * slice_233077;\n    int64_t gtid_211766 = squot64(sext_i32_i64(group_tid_233065), slice_233077);\n    int64_t remnant_233079 = sext_i32_i64(group_tid_233065) - gtid_211766 *\n            slice_233077;\n    int64_t gtid_211767 = remnant_233079;\n    int64_t remnant_233080 = remnant_233079 - gtid_211767;\n    __local unsigned char *color_231988;\n    \n    color_231988 = (__local unsigned char *) color_231988_backing_0;\n    \n    __local unsigned char *color_231989;\n    \n    color_231989 = (__local unsigned char *) color_231989_backing_1;\n    \n    __local unsigned char *color_231990;\n    \n    color_231990 = (__local unsigned char *) color_231990_backing_2;\n    \n    __local unsigned char *color_231991;\n    \n    color_231991 = (__local unsigned char *) color_231991_backing_3;\n    \n    int64_t x_211775;\n    \n    x_211775 = ((__global int64_t *) ext_mem_229264)[gtid_211766 * n_p_203492 +\n                                                     gtid_211767];\n    \n    int64_t gtid_211782 = sext_i32_i64(sext_i64_i32(ltid_pre_233068));\n    int32_t phys_tid_211783 = local_tid_233064;\n  ",
            "  \n    if (slt64(gtid_211782, s_n_m_203636)) {\n        bool cond_211785 = gtid_211782 == (int64_t) 0;\n        int64_t defunc_0_m_fun_res_211786;\n        \n        if (cond_211785) {\n            defunc_0_m_fun_res_211786 = (int64_t) 0;\n        } else {\n            int64_t y_211787 = sub64(s_n_m_203636, (int64_t) 1);\n            bool cond_211788 = gtid_211782 == y_211787;\n            int64_t defunc_0_m_fun_res_f_res_211789;\n            \n            if (cond_211788) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_211790 =\n                        sub64(pad_css_len_203632, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_211789 =\n                    defunc_0_m_fun_res_f_res_t_res_211790;\n            } else {\n                int64_t x_211791 = sub64(gtid_211782, (int64_t) 1);\n                int64_t x_211792 = mul64(jump_s_203499, x_211791);\n                int64_t min_arg_211793 = add64((int64_t) 1, x_211792);\n                int64_t min_res_211794 = smin64(defunc_0_f_res_203631,\n                                                min_arg_211793);\n                \n                defunc_0_m_fun_res_f_res_211789 = min_res_211794;\n            }\n            defunc_0_m_fun_res_211786 = defunc_0_m_fun_res_f_res_211789;\n        }\n        ((__local int64_t *) color_231989)[gtid_211782] =\n            defunc_0_m_fun_res_211786;\n        ((__local bool *) color_231991)[gtid_211782] = cond_211785;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_211796 = sext_i32_i64(sext_i64_i32(ltid_pre_233071));\n    int64_t gtid_211797 = sext_i32_i64(sext_i64_i32(ltid_pre_233072));\n    int32_t phys_tid_211798 = local_tid_233064;\n    __local unsigned char *red_arr_mem_233081;\n    \n    red_arr_mem_233081 = (__local unsigned char *) red_arr_mem_233081_backing_4;\n    if (slt64(gtid_211796, s_n_m_203636) && slt64(gtid_211797, q_s_203493)) {\n        int64_t x_211802;\n        \n        x_211802 = ((__global int64_t *) ext_mem_229363)[gtid_211766 *\n                 ",
            "                                        (s_n_m_203636 *\n                                                          n_p_203492) +\n                                                         gtid_211767 *\n                                                         s_n_m_203636 +\n                                                         gtid_211796];\n        \n        double x_211803;\n        \n        x_211803 = ((__global double *) ext_mem_229362)[gtid_211766 *\n                                                        (s_n_m_203636 *\n                                                         n_p_203492) +\n                                                        gtid_211767 *\n                                                        s_n_m_203636 +\n                                                        gtid_211796];\n        \n        int64_t defunc_0_m_fun_res_211804;\n        \n        defunc_0_m_fun_res_211804 = ((__local\n                                      int64_t *) color_231989)[gtid_211796];\n        \n        bool cond_211806 = sle64(x_211775, gtid_211797);\n        int64_t defunc_0_f_res_211807;\n        \n        if (cond_211806) {\n            defunc_0_f_res_211807 = (int64_t) 0;\n        } else {\n            int64_t i_211808 = add64(gtid_211797, x_211802);\n            int64_t defunc_0_add_arg_211809;\n            \n            defunc_0_add_arg_211809 = ((__global\n                                        int64_t *) ext_mem_229265)[gtid_211766 *\n                                                                   (defunc_0_f_res_203631 *\n                                                                    n_p_203492) +\n                                                                   gtid_211767 *\n                                                                   defunc_0_f_res_203631 +\n                                                                   i_211808];\n            \n            int64_t defunc_1_add_res_211810 = add64((int64_t) 1,\n                                                 ",
            "   defunc_0_add_arg_211809);\n            \n            defunc_0_f_res_211807 = defunc_1_add_res_211810;\n        }\n        \n        double defunc_0_f_res_211811;\n        \n        if (cond_211806) {\n            defunc_0_f_res_211811 = 0.0;\n        } else {\n            int64_t i_211812 = add64(gtid_211797, x_211802);\n            double defunc_0_add_arg_211813;\n            \n            defunc_0_add_arg_211813 = ((__global\n                                        double *) mem_229531)[gtid_211766 *\n                                                              (defunc_0_f_res_203631 *\n                                                               n_p_203492) +\n                                                              gtid_211767 *\n                                                              defunc_0_f_res_203631 +\n                                                              i_211812];\n            defunc_0_f_res_211811 = defunc_0_add_arg_211813;\n        }\n        \n        int64_t binop_p_211814 = sub64(defunc_0_f_res_211807,\n                                       defunc_0_m_fun_res_211804);\n        double defunc_0_f_res_211815 = sitofp_i64_f64(binop_p_211814);\n        double abs_res_211816 = fabs(defunc_0_f_res_211815);\n        double tmp1_211817 = abs_res_211816 / x_211803;\n        double x_211818 = tmp1_211817 * tmp1_211817;\n        double y_211819 = tmp1_211817 * x_211818;\n        double tmp2_211820 = 1.0 - y_211819;\n        double x_211821 = tmp2_211820 * tmp2_211820;\n        double tmp3_211822 = tmp2_211820 * x_211821;\n        double w_j_211823 = defunc_0_f_res_211811 * tmp3_211822;\n        \n        ((__local double *) red_arr_mem_233081)[gtid_211796 * q_s_203493 +\n                                                gtid_211797] = w_j_211823;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t dims_flat_233083 = s_n_m_203636 * q_s_203493;\n    double x_211799;\n    double x_211800;\n    double x_233085;\n    double x_233086;\n    bool ltid_in_bounds_233088 = slt64(sex",
            "t_i32_i64(local_tid_233064),\n                                       s_n_m_203636 * q_s_203493);\n    int32_t skip_threads_233089;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_233088) {\n            x_211800 = ((volatile __local\n                         double *) red_arr_mem_233081)[sext_i32_i64(local_tid_233064)];\n            if ((local_tid_233064 - squot32(local_tid_233064, 32) * 32) == 0) {\n                x_211799 = x_211800;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_233089 = 1;\n        while (slt32(skip_threads_233089, 32)) {\n            bool thread_active_233090 = sle32(skip_threads_233089,\n                                              local_tid_233064 -\n                                              squot32(local_tid_233064, 32) *\n                                              32) && ltid_in_bounds_233088;\n            \n            if (thread_active_233090) {\n                // read operands\n                {\n                    x_211799 = ((volatile __local\n                                 double *) red_arr_mem_233081)[sext_i32_i64(local_tid_233064) -\n                                                               sext_i32_i64(skip_threads_233089)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_233091 =\n                     slt64(srem64(sext_i32_i64(local_tid_233064), q_s_203493),\n                           sext_i32_i64(local_tid_233064) -\n                           sext_i32_i64(local_tid_233064 -\n                           skip_threads_233089));\n                \n                if (thread_active_233090 && inactive_233091) {\n                    x_211799 = x_211800;\n                }\n                if (thread_active_233090) {\n                    if (!inactive_233091) {\n                        double defunc_1_op_res_211801 = x_211799 + x_211800;\n                        \n                        x_211799 = defun",
            "c_1_op_res_211801;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_233066, skip_threads_233089)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (thread_active_233090) {\n                // write result\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_233081)[sext_i32_i64(local_tid_233064)] =\n                        x_211799;\n                    x_211800 = x_211799;\n                }\n            }\n            if (sle32(wave_sizze_233066, skip_threads_233089)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_233089 *= 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_233064 - squot32(local_tid_233064, 32) * 32) == 31 &&\n            ltid_in_bounds_233088) {\n            ((volatile __local\n              double *) red_arr_mem_233081)[sext_i32_i64(squot32(local_tid_233064,\n                                                                 32))] =\n                x_211799;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n    {\n        int32_t skip_threads_233092;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_233064, 32) == 0 && ltid_in_bounds_233088) {\n                x_233086 = ((volatile __local\n                             double *) red_arr_mem_233081)[sext_i32_i64(local_tid_233064)];\n                if ((local_tid_233064 - squot32(local_tid_233064, 32) * 32) ==\n                    0) {\n                    x_233085 = x_233086;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_233092 = 1;\n            while (slt32(skip_threads_233092, 32)) {\n                bool thread_active_233093 = sle32(skip_threads_233092,\n ",
            "                                                 local_tid_233064 -\n                                                  squot32(local_tid_233064,\n                                                          32) * 32) &&\n                     (squot32(local_tid_233064, 32) == 0 &&\n                      ltid_in_bounds_233088);\n                \n                if (thread_active_233093) {\n                    // read operands\n                    {\n                        x_233085 = ((volatile __local\n                                     double *) red_arr_mem_233081)[sext_i32_i64(local_tid_233064) -\n                                                                   sext_i32_i64(skip_threads_233092)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_233094 =\n                         slt64(srem64(sext_i32_i64(local_tid_233064 * 32 + 32 -\n                                      1), q_s_203493),\n                               sext_i32_i64(local_tid_233064 * 32 + 32 - 1) -\n                               sext_i32_i64((local_tid_233064 -\n                                             skip_threads_233092) * 32 + 32 -\n                               1));\n                    \n                    if (thread_active_233093 && inactive_233094) {\n                        x_233085 = x_233086;\n                    }\n                    if (thread_active_233093) {\n                        if (!inactive_233094) {\n                            double defunc_1_op_res_233087 = x_233085 + x_233086;\n                            \n                            x_233085 = defunc_1_op_res_233087;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_233066, skip_threads_233092)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_233093) {\n                    // write result\n                    {\n                        ((volatile __local\n ",
            "                         double *) red_arr_mem_233081)[sext_i32_i64(local_tid_233064)] =\n                            x_233085;\n                        x_233086 = x_233085;\n                    }\n                }\n                if (sle32(wave_sizze_233066, skip_threads_233092)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_233092 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_233095 = squot32(local_tid_233064, 32) == 0 ||\n         !ltid_in_bounds_233088;\n    \n    // carry-in for every block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_233095) {\n                x_211800 = x_211799;\n                x_211799 = ((__local\n                             double *) red_arr_mem_233081)[sext_i32_i64(squot32(local_tid_233064,\n                                                                                32)) -\n                                                           (int64_t) 1];\n            }\n        }\n        // perform operation\n        {\n            bool inactive_233096 = slt64(srem64(sext_i32_i64(local_tid_233064),\n                                                q_s_203493),\n                                         sext_i32_i64(local_tid_233064) -\n                                         sext_i32_i64(squot32(local_tid_233064,\n                                                              32) * 32 - 1));\n            \n            if (!no_carry_in_233095) {\n                if (inactive_233096) {\n                    x_211799 = x_211800;\n                }\n            }\n            if (!no_carry_in_233095) {\n                if (!inactive_233096) {\n                    double defunc_1_op_res_211801 = x_211799 + x_211800;\n                    \n                    x_211799 = defunc_1_op_res_211801;\n                }\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_233095) {\n                ((__loca",
            "l\n                  double *) red_arr_mem_233081)[sext_i32_i64(local_tid_233064)] =\n                    x_211799;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_233064, 32) == 0 && ltid_in_bounds_233088) {\n            ((__local\n              double *) red_arr_mem_233081)[sext_i32_i64(local_tid_233064)] =\n                x_211800;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233097 = 0; i_233097 < sdiv_up64(s_n_m_203636 -\n                                                    sext_i32_i64(local_tid_233064),\n                                                    computed_group_sizze_211670);\n         i_233097++) {\n        double tmp_233098;\n        \n        tmp_233098 = ((__local double *) red_arr_mem_233081)[q_s_203493 -\n                                                             (int64_t) 1 +\n                                                             (i_233097 *\n                                                              computed_group_sizze_211670 +\n                                                              sext_i32_i64(local_tid_233064)) *\n                                                             q_s_203493];\n        ((__local double *) color_231988)[i_233097 *\n                                          computed_group_sizze_211670 +\n                                          sext_i32_i64(local_tid_233064)] =\n            tmp_233098;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_211826 = sext_i32_i64(sext_i64_i32(ltid_pre_233068));\n    int32_t phys_tid_211827 = local_tid_233064;\n    \n    if (slt64(gtid_211826, s_n_m_203636)) {\n        bool index_primexp_228719 = gtid_211826 == (int64_t) 0;\n        double defunc_2_reduce_res_211830;\n        \n        defunc_2_reduce_res_211830 = ((__local\n                                       double *) color_231988)[gtid_211826",
            "];\n        \n        double a0_211831 = 1.0 / defunc_2_reduce_res_211830;\n        int64_t defunc_0_m_fun_res_211832;\n        \n        if (index_primexp_228719) {\n            defunc_0_m_fun_res_211832 = (int64_t) 0;\n        } else {\n            int64_t y_211833 = sub64(s_n_m_203636, (int64_t) 1);\n            bool cond_211834 = gtid_211826 == y_211833;\n            int64_t defunc_0_m_fun_res_f_res_211835;\n            \n            if (cond_211834) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_211836 =\n                        sub64(pad_css_len_203632, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_211835 =\n                    defunc_0_m_fun_res_f_res_t_res_211836;\n            } else {\n                int64_t x_211837 = sub64(gtid_211826, (int64_t) 1);\n                int64_t x_211838 = mul64(jump_s_203499, x_211837);\n                int64_t min_arg_211839 = add64((int64_t) 1, x_211838);\n                int64_t min_res_211840 = smin64(defunc_0_f_res_203631,\n                                                min_arg_211839);\n                \n                defunc_0_m_fun_res_f_res_211835 = min_res_211840;\n            }\n            defunc_0_m_fun_res_211832 = defunc_0_m_fun_res_f_res_211835;\n        }\n        ((__local double *) color_231990)[gtid_211826] = a0_211831;\n        ((__local int64_t *) color_231989)[gtid_211826] =\n            defunc_0_m_fun_res_211832;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_211842 = sext_i32_i64(sext_i64_i32(ltid_pre_233071));\n    int64_t gtid_211843 = sext_i32_i64(sext_i64_i32(ltid_pre_233072));\n    int32_t phys_tid_211844 = local_tid_233064;\n    __local unsigned char *red_arr_mem_233099;\n    \n    red_arr_mem_233099 = (__local unsigned char *) red_arr_mem_233099_backing_5;\n    if (slt64(gtid_211842, s_n_m_203636) && slt64(gtid_211843, q_s_203493)) {\n        int64_t x_211848;\n        \n        x_211848 = ((__global int64_t *) ext_mem_229363)[gtid_211766 *\n                                     ",
            "                    (s_n_m_203636 *\n                                                          n_p_203492) +\n                                                         gtid_211767 *\n                                                         s_n_m_203636 +\n                                                         gtid_211842];\n        \n        double x_211849;\n        \n        x_211849 = ((__global double *) ext_mem_229362)[gtid_211766 *\n                                                        (s_n_m_203636 *\n                                                         n_p_203492) +\n                                                        gtid_211767 *\n                                                        s_n_m_203636 +\n                                                        gtid_211842];\n        \n        double a0_211850;\n        \n        a0_211850 = ((__local double *) color_231990)[gtid_211842];\n        \n        int64_t defunc_0_m_fun_res_211851;\n        \n        defunc_0_m_fun_res_211851 = ((__local\n                                      int64_t *) color_231989)[gtid_211842];\n        \n        bool cond_211853 = sle64(x_211775, gtid_211843);\n        int64_t defunc_0_f_res_211854;\n        \n        if (cond_211853) {\n            defunc_0_f_res_211854 = (int64_t) 0;\n        } else {\n            int64_t i_211855 = add64(gtid_211843, x_211848);\n            int64_t defunc_0_add_arg_211856;\n            \n            defunc_0_add_arg_211856 = ((__global\n                                        int64_t *) ext_mem_229265)[gtid_211766 *\n                                                                   (defunc_0_f_res_203631 *\n                                                                    n_p_203492) +\n                                                                   gtid_211767 *\n                                                                   defunc_0_f_res_203631 +\n                                                                   i_211855];\n            \n            int64_t de",
            "func_1_add_res_211857 = add64((int64_t) 1,\n                                                    defunc_0_add_arg_211856);\n            \n            defunc_0_f_res_211854 = defunc_1_add_res_211857;\n        }\n        \n        double defunc_0_f_res_211858;\n        \n        if (cond_211853) {\n            defunc_0_f_res_211858 = 0.0;\n        } else {\n            int64_t i_211859 = add64(gtid_211843, x_211848);\n            double defunc_0_add_arg_211860;\n            \n            defunc_0_add_arg_211860 = ((__global\n                                        double *) mem_229531)[gtid_211766 *\n                                                              (defunc_0_f_res_203631 *\n                                                               n_p_203492) +\n                                                              gtid_211767 *\n                                                              defunc_0_f_res_203631 +\n                                                              i_211859];\n            defunc_0_f_res_211858 = defunc_0_add_arg_211860;\n        }\n        \n        int64_t binop_p_211861 = sub64(defunc_0_f_res_211854,\n                                       defunc_0_m_fun_res_211851);\n        double defunc_0_f_res_211862 = sitofp_i64_f64(binop_p_211861);\n        double abs_res_211863 = fabs(defunc_0_f_res_211862);\n        double tmp1_211864 = abs_res_211863 / x_211849;\n        double x_211865 = tmp1_211864 * tmp1_211864;\n        double y_211866 = tmp1_211864 * x_211865;\n        double tmp2_211867 = 1.0 - y_211866;\n        double x_211868 = tmp2_211867 * tmp2_211867;\n        double tmp3_211869 = tmp2_211867 * x_211868;\n        double tmp4_211870 = defunc_0_f_res_211858 * tmp3_211869;\n        double defunc_0_f_res_211871;\n        \n        if (cond_211853) {\n            defunc_0_f_res_211871 = 0.0;\n        } else {\n            int64_t i_211872 = add64(gtid_211843, x_211848);\n            double defunc_0_add_arg_211873;\n            \n            defunc_0_add_arg_211873 = ((__glo",
            "bal\n                                        double *) mem_229526)[gtid_211766 *\n                                                              (defunc_0_f_res_203631 *\n                                                               n_p_203492) +\n                                                              gtid_211767 *\n                                                              defunc_0_f_res_203631 +\n                                                              i_211872];\n            defunc_0_f_res_211871 = defunc_0_add_arg_211873;\n        }\n        \n        double x_211874 = a0_211850 * tmp4_211870;\n        double defunc_9_fit_fun_res_211875 = defunc_0_f_res_211871 * x_211874;\n        \n        ((__local double *) red_arr_mem_233099)[gtid_211842 * q_s_203493 +\n                                                gtid_211843] =\n            defunc_9_fit_fun_res_211875;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t dims_flat_233101 = s_n_m_203636 * q_s_203493;\n    double x_211845;\n    double x_211846;\n    double x_233103;\n    double x_233104;\n    bool ltid_in_bounds_233106 = slt64(sext_i32_i64(local_tid_233064),\n                                       s_n_m_203636 * q_s_203493);\n    int32_t skip_threads_233107;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_233106) {\n            x_211846 = ((volatile __local\n                         double *) red_arr_mem_233099)[sext_i32_i64(local_tid_233064)];\n            if ((local_tid_233064 - squot32(local_tid_233064, 32) * 32) == 0) {\n                x_211845 = x_211846;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_233107 = 1;\n        while (slt32(skip_threads_233107, 32)) {\n            bool thread_active_233108 = sle32(skip_threads_233107,\n                                              local_tid_233064 -\n                                              squot32(local_tid_233064, 32) *\n                                              32) && l",
            "tid_in_bounds_233106;\n            \n            if (thread_active_233108) {\n                // read operands\n                {\n                    x_211845 = ((volatile __local\n                                 double *) red_arr_mem_233099)[sext_i32_i64(local_tid_233064) -\n                                                               sext_i32_i64(skip_threads_233107)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_233109 =\n                     slt64(srem64(sext_i32_i64(local_tid_233064), q_s_203493),\n                           sext_i32_i64(local_tid_233064) -\n                           sext_i32_i64(local_tid_233064 -\n                           skip_threads_233107));\n                \n                if (thread_active_233108 && inactive_233109) {\n                    x_211845 = x_211846;\n                }\n                if (thread_active_233108) {\n                    if (!inactive_233109) {\n                        double defunc_1_op_res_211847 = x_211845 + x_211846;\n                        \n                        x_211845 = defunc_1_op_res_211847;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_233066, skip_threads_233107)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (thread_active_233108) {\n                // write result\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_233099)[sext_i32_i64(local_tid_233064)] =\n                        x_211845;\n                    x_211846 = x_211845;\n                }\n            }\n            if (sle32(wave_sizze_233066, skip_threads_233107)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_233107 *= 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_233064 - squot32(local_tid_233064, 32) * 32) == 31 &&\n            lt",
            "id_in_bounds_233106) {\n            ((volatile __local\n              double *) red_arr_mem_233099)[sext_i32_i64(squot32(local_tid_233064,\n                                                                 32))] =\n                x_211845;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n    {\n        int32_t skip_threads_233110;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_233064, 32) == 0 && ltid_in_bounds_233106) {\n                x_233104 = ((volatile __local\n                             double *) red_arr_mem_233099)[sext_i32_i64(local_tid_233064)];\n                if ((local_tid_233064 - squot32(local_tid_233064, 32) * 32) ==\n                    0) {\n                    x_233103 = x_233104;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_233110 = 1;\n            while (slt32(skip_threads_233110, 32)) {\n                bool thread_active_233111 = sle32(skip_threads_233110,\n                                                  local_tid_233064 -\n                                                  squot32(local_tid_233064,\n                                                          32) * 32) &&\n                     (squot32(local_tid_233064, 32) == 0 &&\n                      ltid_in_bounds_233106);\n                \n                if (thread_active_233111) {\n                    // read operands\n                    {\n                        x_233103 = ((volatile __local\n                                     double *) red_arr_mem_233099)[sext_i32_i64(local_tid_233064) -\n                                                                   sext_i32_i64(skip_threads_233110)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_233112 =\n                         slt64(srem64(sext_i32_i64(local_t",
            "id_233064 * 32 + 32 -\n                                      1), q_s_203493),\n                               sext_i32_i64(local_tid_233064 * 32 + 32 - 1) -\n                               sext_i32_i64((local_tid_233064 -\n                                             skip_threads_233110) * 32 + 32 -\n                               1));\n                    \n                    if (thread_active_233111 && inactive_233112) {\n                        x_233103 = x_233104;\n                    }\n                    if (thread_active_233111) {\n                        if (!inactive_233112) {\n                            double defunc_1_op_res_233105 = x_233103 + x_233104;\n                            \n                            x_233103 = defunc_1_op_res_233105;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_233066, skip_threads_233110)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_233111) {\n                    // write result\n                    {\n                        ((volatile __local\n                          double *) red_arr_mem_233099)[sext_i32_i64(local_tid_233064)] =\n                            x_233103;\n                        x_233104 = x_233103;\n                    }\n                }\n                if (sle32(wave_sizze_233066, skip_threads_233110)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_233110 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_233113 = squot32(local_tid_233064, 32) == 0 ||\n         !ltid_in_bounds_233106;\n    \n    // carry-in for every block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_233113) {\n                x_211846 = x_211845;\n                x_211845 = ((__local\n                             double *) red_arr_mem_233099)[sext_i32_i64(squot32(local_tid_233064,\n                           ",
            "                                                     32)) -\n                                                           (int64_t) 1];\n            }\n        }\n        // perform operation\n        {\n            bool inactive_233114 = slt64(srem64(sext_i32_i64(local_tid_233064),\n                                                q_s_203493),\n                                         sext_i32_i64(local_tid_233064) -\n                                         sext_i32_i64(squot32(local_tid_233064,\n                                                              32) * 32 - 1));\n            \n            if (!no_carry_in_233113) {\n                if (inactive_233114) {\n                    x_211845 = x_211846;\n                }\n            }\n            if (!no_carry_in_233113) {\n                if (!inactive_233114) {\n                    double defunc_1_op_res_211847 = x_211845 + x_211846;\n                    \n                    x_211845 = defunc_1_op_res_211847;\n                }\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_233113) {\n                ((__local\n                  double *) red_arr_mem_233099)[sext_i32_i64(local_tid_233064)] =\n                    x_211845;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_233064, 32) == 0 && ltid_in_bounds_233106) {\n            ((__local\n              double *) red_arr_mem_233099)[sext_i32_i64(local_tid_233064)] =\n                x_211846;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233115 = 0; i_233115 < sdiv_up64(s_n_m_203636 -\n                                                    sext_i32_i64(local_tid_233064),\n                                                    computed_group_sizze_211670);\n         i_233115++) {\n        double tmp_233116;\n        \n        tmp_233116 = ((__local double *) red_arr_mem_233099)[q_s_203493 -\n             ",
            "                                                (int64_t) 1 +\n                                                             (i_233115 *\n                                                              computed_group_sizze_211670 +\n                                                              sext_i32_i64(local_tid_233064)) *\n                                                             q_s_203493];\n        ((__local double *) color_231988)[i_233115 *\n                                          computed_group_sizze_211670 +\n                                          sext_i32_i64(local_tid_233064)] =\n            tmp_233116;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233117 = 0; i_233117 < sdiv_up64(s_n_m_203636 -\n                                                    sext_i32_i64(local_tid_233064),\n                                                    computed_group_sizze_211670);\n         i_233117++) {\n        double tmp_233118;\n        \n        tmp_233118 = ((__local double *) color_231988)[i_233117 *\n                                                       computed_group_sizze_211670 +\n                                                       sext_i32_i64(local_tid_233064)];\n        ((__global double *) mem_229675)[gtid_211766 * (s_n_m_203636 *\n                                                        n_p_203492) +\n                                         gtid_211767 * s_n_m_203636 +\n                                         (i_233117 *\n                                          computed_group_sizze_211670 +\n                                          sext_i32_i64(local_tid_233064))] =\n            tmp_233118;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n  error_6:\n    return;\n}\n__kernel void mainzisegmap_intragroup_213836(__global int *global_failure,\n                                             uint red_arr_mem_233421_backing_offset_0,\n                                             uint red_arr_mem_233419_backing_offset_1,\n                 ",
            "                            uint red_arr_mem_233389_backing_offset_2,\n                                             uint red_arr_mem_233387_backing_offset_3,\n                                             uint red_arr_mem_233385_backing_offset_4,\n                                             uint color_232003_backing_offset_5,\n                                             uint color_232002_backing_offset_6,\n                                             uint color_232001_backing_offset_7,\n                                             uint color_232000_backing_offset_8,\n                                             uint color_231999_backing_offset_9,\n                                             uint color_231998_backing_offset_10,\n                                             uint color_231997_backing_offset_11,\n                                             uint color_231996_backing_offset_12,\n                                             int64_t n_p_203492,\n                                             int64_t q_s_203493,\n                                             int64_t jump_s_203499,\n                                             int64_t partition_sizze_203577,\n                                             int64_t defunc_0_f_res_203631,\n                                             int64_t pad_css_len_203632,\n                                             int64_t s_n_m_203636,\n                                             int64_t computed_group_sizze_213705,\n                                             __global\n                                             unsigned char *ext_mem_229264,\n                                             __global\n                                             unsigned char *ext_mem_229265,\n                                             __global\n                                             unsigned char *ext_mem_229362,\n                                             __global\n                                             unsigned char *ext_mem_229363,\n            ",
            "                                 __global unsigned char *mem_229526,\n                                             __global unsigned char *mem_229531,\n                                             __global unsigned char *mem_229951,\n                                             __global unsigned char *mem_229956)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_233421_backing_12 =\n                           &shared_mem[red_arr_mem_233421_backing_offset_0];\n    volatile unsigned char *red_arr_mem_233419_backing_11 =\n                           &shared_mem[red_arr_mem_233419_backing_offset_1];\n    volatile unsigned char *red_arr_mem_233389_backing_10 =\n                           &shared_mem[red_arr_mem_233389_backing_offset_2];\n    volatile unsigned char *red_arr_mem_233387_backing_9 =\n                           &shared_mem[red_arr_mem_233387_backing_offset_3];\n    volatile unsigned char *red_arr_mem_233385_backing_8 =\n                           &shared_mem[red_arr_mem_233385_backing_offset_4];\n    volatile unsigned char *color_232003_backing_7 =\n                           &shared_mem[color_232003_backing_offset_5];\n    volatile unsigned char *color_232002_backing_6 =\n                           &shared_mem[color_232002_backing_offset_6];\n    volatile unsigned char *color_232001_backing_5 =\n                           &shared_mem[color_232001_backing_offset_7];\n    volatile unsigned char *color_232000_backing_4 =\n                           &shared_mem[color_232000_backing_offset_8];\n    volatile unsigned char *color_231999_backing_3 =\n                           &shared_mem[color_231999_backing_offset_9];\n    volatile unsigned char *color_231998_backing_2 =\n                           &shared_mem[color_231998_backing_offset_10];\n    volatile unsigned char *color_231997_backing_1 =\n                           &shared_mem[color_231997_backing_offset_11];\n    volatile unsigned char *color_231996_ba",
            "cking_0 =\n                           &shared_mem[color_231996_backing_offset_12];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233367;\n    int32_t local_tid_233368;\n    int64_t group_sizze_233371;\n    int32_t wave_sizze_233370;\n    int32_t group_tid_233369;\n    \n    global_tid_233367 = get_global_id(0);\n    local_tid_233368 = get_local_id(0);\n    group_sizze_233371 = get_local_size(0);\n    wave_sizze_233370 = LOCKSTEP_WIDTH;\n    group_tid_233369 = get_group_id(0);\n    \n    int32_t phys_tid_213836 = group_tid_233369;\n    int64_t slice_233373 = s_n_m_203636;\n    int64_t ltid_pre_233372 = sext_i32_i64(local_tid_233368);\n    int64_t remnant_233374 = sext_i32_i64(local_tid_233368) - ltid_pre_233372;\n    int64_t slice_233377 = q_s_203493;\n    int64_t slice_233378 = s_n_m_203636 * slice_233377;\n    int64_t ltid_pre_233375 = squot64(sext_i32_i64(local_tid_233368),\n                                      slice_233377);\n    int64_t remnant_233379 = sext_i32_i64(local_tid_233368) - ltid_pre_233375 *\n            slice_233377;\n    int64_t ltid_pre_233376 = remnant_233379;\n    int64_t remnant_233380 = remnant_233379 - ltid_pre_233376;\n    int64_t slice_233381 = n_p_203492;\n    int64_t slice_233382 = partition_sizze_203577 * slice_233381;\n    int64_t gtid_213834 = squot64(sext_i32_i64(group_tid_233369), slice_233381);\n    int64_t remnant_233383 = sext_i32_i64(group_tid_233369) - gtid_213834 *\n            slice_233381;\n    int64_t gtid_213835 = remnant_233383;\n    int64_t remnant_233384 = remnant_233383 - gtid_213835;\n    __local unsigned char *color_231996;\n    \n    color_231996 = (__local unsigned char *) color_231996_backing_0;\n    \n    __local unsigned char *color_231997;\n    \n    color_231997 = (__local unsigned char *) color_231997_backing_1;\n    \n    __local unsigned char *color_231998;\n    \n    color_231998 = (__local unsigned char *) color_231998_backing_2;\n    \n    __local unsigned char *color_231999;\n    \n    color_231999 = (__local unsign",
            "ed char *) color_231999_backing_3;\n    \n    __local unsigned char *color_232000;\n    \n    color_232000 = (__local unsigned char *) color_232000_backing_4;\n    \n    __local unsigned char *color_232001;\n    \n    color_232001 = (__local unsigned char *) color_232001_backing_5;\n    \n    __local unsigned char *color_232002;\n    \n    color_232002 = (__local unsigned char *) color_232002_backing_6;\n    \n    __local unsigned char *color_232003;\n    \n    color_232003 = (__local unsigned char *) color_232003_backing_7;\n    \n    int64_t x_213843;\n    \n    x_213843 = ((__global int64_t *) ext_mem_229264)[gtid_213834 * n_p_203492 +\n                                                     gtid_213835];\n    \n    int64_t gtid_213850 = sext_i32_i64(sext_i64_i32(ltid_pre_233372));\n    int32_t phys_tid_213851 = local_tid_233368;\n    \n    if (slt64(gtid_213850, s_n_m_203636)) {\n        bool cond_213853 = gtid_213850 == (int64_t) 0;\n        int64_t defunc_0_m_fun_res_213854;\n        \n        if (cond_213853) {\n            defunc_0_m_fun_res_213854 = (int64_t) 0;\n        } else {\n            int64_t y_213855 = sub64(s_n_m_203636, (int64_t) 1);\n            bool cond_213856 = gtid_213850 == y_213855;\n            int64_t defunc_0_m_fun_res_f_res_213857;\n            \n            if (cond_213856) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_213858 =\n                        sub64(pad_css_len_203632, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_213857 =\n                    defunc_0_m_fun_res_f_res_t_res_213858;\n            } else {\n                int64_t x_213859 = sub64(gtid_213850, (int64_t) 1);\n                int64_t x_213860 = mul64(jump_s_203499, x_213859);\n                int64_t min_arg_213861 = add64((int64_t) 1, x_213860);\n                int64_t min_res_213862 = smin64(defunc_0_f_res_203631,\n                                                min_arg_213861);\n                \n                defunc_0_m_fun_res_f_res_213857 = min_res_213862;\n           ",
            " }\n            defunc_0_m_fun_res_213854 = defunc_0_m_fun_res_f_res_213857;\n        }\n        ((__local int64_t *) color_231998)[gtid_213850] =\n            defunc_0_m_fun_res_213854;\n        ((__local bool *) color_232003)[gtid_213850] = cond_213853;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_213866 = sext_i32_i64(sext_i64_i32(ltid_pre_233375));\n    int64_t gtid_213867 = sext_i32_i64(sext_i64_i32(ltid_pre_233376));\n    int32_t phys_tid_213868 = local_tid_233368;\n    __local unsigned char *red_arr_mem_233385;\n    \n    red_arr_mem_233385 = (__local unsigned char *) red_arr_mem_233385_backing_8;\n    \n    __local unsigned char *red_arr_mem_233387;\n    \n    red_arr_mem_233387 = (__local unsigned char *) red_arr_mem_233387_backing_9;\n    \n    __local unsigned char *red_arr_mem_233389;\n    \n    red_arr_mem_233389 = (__local\n                          unsigned char *) red_arr_mem_233389_backing_10;\n    if (slt64(gtid_213866, s_n_m_203636) && slt64(gtid_213867, q_s_203493)) {\n        int64_t x_213878;\n        \n        x_213878 = ((__global int64_t *) ext_mem_229363)[gtid_213834 *\n                                                         (s_n_m_203636 *\n                                                          n_p_203492) +\n                                                         gtid_213835 *\n                                                         s_n_m_203636 +\n                                                         gtid_213866];\n        \n        double x_213879;\n        \n        x_213879 = ((__global double *) ext_mem_229362)[gtid_213834 *\n                                                        (s_n_m_203636 *\n                                                         n_p_203492) +\n                                                        gtid_213835 *\n                                                        s_n_m_203636 +\n                                                        gtid_213866];\n        \n        int64_t defunc_0_m_fun_res_213880;\n        \n       ",
            " defunc_0_m_fun_res_213880 = ((__local\n                                      int64_t *) color_231998)[gtid_213866];\n        \n        bool cond_213882 = sle64(x_213843, gtid_213867);\n        int64_t defunc_0_f_res_213883;\n        \n        if (cond_213882) {\n            defunc_0_f_res_213883 = (int64_t) 0;\n        } else {\n            int64_t i_213884 = add64(gtid_213867, x_213878);\n            int64_t defunc_0_add_arg_213885;\n            \n            defunc_0_add_arg_213885 = ((__global\n                                        int64_t *) ext_mem_229265)[gtid_213834 *\n                                                                   (defunc_0_f_res_203631 *\n                                                                    n_p_203492) +\n                                                                   gtid_213835 *\n                                                                   defunc_0_f_res_203631 +\n                                                                   i_213884];\n            \n            int64_t defunc_1_add_res_213886 = add64((int64_t) 1,\n                                                    defunc_0_add_arg_213885);\n            \n            defunc_0_f_res_213883 = defunc_1_add_res_213886;\n        }\n        \n        double defunc_0_f_res_213887;\n        \n        if (cond_213882) {\n            defunc_0_f_res_213887 = 0.0;\n        } else {\n            int64_t i_213888 = add64(gtid_213867, x_213878);\n            double defunc_0_add_arg_213889;\n            \n            defunc_0_add_arg_213889 = ((__global\n                                        double *) mem_229531)[gtid_213834 *\n                                                              (defunc_0_f_res_203631 *\n                                                               n_p_203492) +\n                                                              gtid_213835 *\n                                                              defunc_0_f_res_203631 +\n                                                      ",
            "        i_213888];\n            defunc_0_f_res_213887 = defunc_0_add_arg_213889;\n        }\n        \n        int64_t binop_p_213890 = sub64(defunc_0_f_res_213883,\n                                       defunc_0_m_fun_res_213880);\n        double defunc_0_f_res_213891 = sitofp_i64_f64(binop_p_213890);\n        double abs_res_213892 = fabs(defunc_0_f_res_213891);\n        double tmp1_213893 = abs_res_213892 / x_213879;\n        double x_213894 = tmp1_213893 * tmp1_213893;\n        double y_213895 = tmp1_213893 * x_213894;\n        double tmp2_213896 = 1.0 - y_213895;\n        double x_213897 = tmp2_213896 * tmp2_213896;\n        double tmp3_213898 = tmp2_213896 * x_213897;\n        double w_j_213899 = defunc_0_f_res_213887 * tmp3_213898;\n        double xw_j_213900 = defunc_0_f_res_213891 * w_j_213899;\n        double x2w_j_213901 = defunc_0_f_res_213891 * xw_j_213900;\n        \n        ((__local double *) red_arr_mem_233385)[gtid_213866 * q_s_203493 +\n                                                gtid_213867] = w_j_213899;\n        ((__local double *) red_arr_mem_233387)[gtid_213866 * q_s_203493 +\n                                                gtid_213867] = xw_j_213900;\n        ((__local double *) red_arr_mem_233389)[gtid_213866 * q_s_203493 +\n                                                gtid_213867] = x2w_j_213901;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t dims_flat_233391 = s_n_m_203636 * q_s_203493;\n    double x_213869;\n    double x_213870;\n    double x_213871;\n    double x_213872;\n    double x_213873;\n    double x_213874;\n    double x_233395;\n    double x_233396;\n    double x_233397;\n    double x_233398;\n    double x_233399;\n    double x_233400;\n    bool ltid_in_bounds_233404 = slt64(sext_i32_i64(local_tid_233368),\n                                       s_n_m_203636 * q_s_203493);\n    int32_t skip_threads_233405;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_233404) {\n            x_213872 = ((volatile __local\n                   ",
            "      double *) red_arr_mem_233385)[sext_i32_i64(local_tid_233368)];\n            x_213873 = ((volatile __local\n                         double *) red_arr_mem_233387)[sext_i32_i64(local_tid_233368)];\n            x_213874 = ((volatile __local\n                         double *) red_arr_mem_233389)[sext_i32_i64(local_tid_233368)];\n            if ((local_tid_233368 - squot32(local_tid_233368, 32) * 32) == 0) {\n                x_213869 = x_213872;\n                x_213870 = x_213873;\n                x_213871 = x_213874;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_233405 = 1;\n        while (slt32(skip_threads_233405, 32)) {\n            bool thread_active_233406 = sle32(skip_threads_233405,\n                                              local_tid_233368 -\n                                              squot32(local_tid_233368, 32) *\n                                              32) && ltid_in_bounds_233404;\n            \n            if (thread_active_233406) {\n                // read operands\n                {\n                    x_213869 = ((volatile __local\n                                 double *) red_arr_mem_233385)[sext_i32_i64(local_tid_233368) -\n                                                               sext_i32_i64(skip_threads_233405)];\n                    x_213870 = ((volatile __local\n                                 double *) red_arr_mem_233387)[sext_i32_i64(local_tid_233368) -\n                                                               sext_i32_i64(skip_threads_233405)];\n                    x_213871 = ((volatile __local\n                                 double *) red_arr_mem_233389)[sext_i32_i64(local_tid_233368) -\n                                                               sext_i32_i64(skip_threads_233405)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_233407 =\n                     slt64(srem64(sext_i32_i64(local_tid_233368), q",
            "_s_203493),\n                           sext_i32_i64(local_tid_233368) -\n                           sext_i32_i64(local_tid_233368 -\n                           skip_threads_233405));\n                \n                if (thread_active_233406 && inactive_233407) {\n                    x_213869 = x_213872;\n                    x_213870 = x_213873;\n                    x_213871 = x_213874;\n                }\n                if (thread_active_233406) {\n                    if (!inactive_233407) {\n                        double defunc_1_op_res_213875 = x_213869 + x_213872;\n                        double defunc_1_op_res_213876 = x_213870 + x_213873;\n                        double defunc_1_op_res_213877 = x_213871 + x_213874;\n                        \n                        x_213869 = defunc_1_op_res_213875;\n                        x_213870 = defunc_1_op_res_213876;\n                        x_213871 = defunc_1_op_res_213877;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_233370, skip_threads_233405)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (thread_active_233406) {\n                // write result\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_233385)[sext_i32_i64(local_tid_233368)] =\n                        x_213869;\n                    x_213872 = x_213869;\n                    ((volatile __local\n                      double *) red_arr_mem_233387)[sext_i32_i64(local_tid_233368)] =\n                        x_213870;\n                    x_213873 = x_213870;\n                    ((volatile __local\n                      double *) red_arr_mem_233389)[sext_i32_i64(local_tid_233368)] =\n                        x_213871;\n                    x_213874 = x_213871;\n                }\n            }\n            if (sle32(wave_sizze_233370, skip_threads_233405)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_233405 *= 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_233368 - squot32(local_tid_233368, 32) * 32) == 31 &&\n            ltid_in_bounds_233404) {\n            ((volatile __local\n              double *) red_arr_mem_233385)[sext_i32_i64(squot32(local_tid_233368,\n                                                                 32))] =\n                x_213869;\n            ((volatile __local\n              double *) red_arr_mem_233387)[sext_i32_i64(squot32(local_tid_233368,\n                                                                 32))] =\n                x_213870;\n            ((volatile __local\n              double *) red_arr_mem_233389)[sext_i32_i64(squot32(local_tid_233368,\n                                                                 32))] =\n                x_213871;\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_233408;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_233368, 32) == 0 && ltid_in_bounds_233404) {\n                x_233398 = ((volatile __local\n                             double *) red_arr_mem_233385)[sext_i32_i64(local_tid_233368)];\n                x_233399 = ((volatile __local\n                             double *) red_arr_mem_233387)[sext_i32_i64(local_tid_233368)];\n                x_233400 = ((volatile __local\n                             double *) red_arr_mem_233389)[sext_i32_i64(local_tid_233368)];\n                if ((local_tid_233368 - squot32(local_tid_233368, 32) * 32) ==\n                    0) {\n                    x_233395 = x_233398;\n                    x_233396 = x_233399;\n                    x_233397 = x_233400;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_233408 = 1;\n            while (slt32(skip_threads",
            "_233408, 32)) {\n                bool thread_active_233409 = sle32(skip_threads_233408,\n                                                  local_tid_233368 -\n                                                  squot32(local_tid_233368,\n                                                          32) * 32) &&\n                     (squot32(local_tid_233368, 32) == 0 &&\n                      ltid_in_bounds_233404);\n                \n                if (thread_active_233409) {\n                    // read operands\n                    {\n                        x_233395 = ((volatile __local\n                                     double *) red_arr_mem_233385)[sext_i32_i64(local_tid_233368) -\n                                                                   sext_i32_i64(skip_threads_233408)];\n                        x_233396 = ((volatile __local\n                                     double *) red_arr_mem_233387)[sext_i32_i64(local_tid_233368) -\n                                                                   sext_i32_i64(skip_threads_233408)];\n                        x_233397 = ((volatile __local\n                                     double *) red_arr_mem_233389)[sext_i32_i64(local_tid_233368) -\n                                                                   sext_i32_i64(skip_threads_233408)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_233410 =\n                         slt64(srem64(sext_i32_i64(local_tid_233368 * 32 + 32 -\n                                      1), q_s_203493),\n                               sext_i32_i64(local_tid_233368 * 32 + 32 - 1) -\n                               sext_i32_i64((local_tid_233368 -\n                                             skip_threads_233408) * 32 + 32 -\n                               1));\n                    \n                    if (thread_active_233409 && inactive_233410) {\n                        x_233395 = x_233398;\n                        x_233396 = x_2",
            "33399;\n                        x_233397 = x_233400;\n                    }\n                    if (thread_active_233409) {\n                        if (!inactive_233410) {\n                            double defunc_1_op_res_233401 = x_233395 + x_233398;\n                            double defunc_1_op_res_233402 = x_233396 + x_233399;\n                            double defunc_1_op_res_233403 = x_233397 + x_233400;\n                            \n                            x_233395 = defunc_1_op_res_233401;\n                            x_233396 = defunc_1_op_res_233402;\n                            x_233397 = defunc_1_op_res_233403;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_233370, skip_threads_233408)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_233409) {\n                    // write result\n                    {\n                        ((volatile __local\n                          double *) red_arr_mem_233385)[sext_i32_i64(local_tid_233368)] =\n                            x_233395;\n                        x_233398 = x_233395;\n                        ((volatile __local\n                          double *) red_arr_mem_233387)[sext_i32_i64(local_tid_233368)] =\n                            x_233396;\n                        x_233399 = x_233396;\n                        ((volatile __local\n                          double *) red_arr_mem_233389)[sext_i32_i64(local_tid_233368)] =\n                            x_233397;\n                        x_233400 = x_233397;\n                    }\n                }\n                if (sle32(wave_sizze_233370, skip_threads_233408)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_233408 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_233411 = squot32(local_tid_233368, 32) == 0 ||\n         !ltid_in_bounds_233404;\n    \n    // carry-in for ev",
            "ery block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_233411) {\n                x_213872 = x_213869;\n                x_213873 = x_213870;\n                x_213874 = x_213871;\n                x_213869 = ((__local\n                             double *) red_arr_mem_233385)[sext_i32_i64(squot32(local_tid_233368,\n                                                                                32)) -\n                                                           (int64_t) 1];\n                x_213870 = ((__local\n                             double *) red_arr_mem_233387)[sext_i32_i64(squot32(local_tid_233368,\n                                                                                32)) -\n                                                           (int64_t) 1];\n                x_213871 = ((__local\n                             double *) red_arr_mem_233389)[sext_i32_i64(squot32(local_tid_233368,\n                                                                                32)) -\n                                                           (int64_t) 1];\n            }\n        }\n        // perform operation\n        {\n            bool inactive_233412 = slt64(srem64(sext_i32_i64(local_tid_233368),\n                                                q_s_203493),\n                                         sext_i32_i64(local_tid_233368) -\n                                         sext_i32_i64(squot32(local_tid_233368,\n                                                              32) * 32 - 1));\n            \n            if (!no_carry_in_233411) {\n                if (inactive_233412) {\n                    x_213869 = x_213872;\n                    x_213870 = x_213873;\n                    x_213871 = x_213874;\n                }\n            }\n            if (!no_carry_in_233411) {\n                if (!inactive_233412) {\n                    double defunc_1_op_res_213875 = x_213869 + x_213872;\n                    double defunc_1_op_res_213876 = x_213870 + ",
            "x_213873;\n                    double defunc_1_op_res_213877 = x_213871 + x_213874;\n                    \n                    x_213869 = defunc_1_op_res_213875;\n                    x_213870 = defunc_1_op_res_213876;\n                    x_213871 = defunc_1_op_res_213877;\n                }\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_233411) {\n                ((__local\n                  double *) red_arr_mem_233385)[sext_i32_i64(local_tid_233368)] =\n                    x_213869;\n                ((__local\n                  double *) red_arr_mem_233387)[sext_i32_i64(local_tid_233368)] =\n                    x_213870;\n                ((__local\n                  double *) red_arr_mem_233389)[sext_i32_i64(local_tid_233368)] =\n                    x_213871;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_233368, 32) == 0 && ltid_in_bounds_233404) {\n            ((__local\n              double *) red_arr_mem_233385)[sext_i32_i64(local_tid_233368)] =\n                x_213872;\n            ((__local\n              double *) red_arr_mem_233387)[sext_i32_i64(local_tid_233368)] =\n                x_213873;\n            ((__local\n              double *) red_arr_mem_233389)[sext_i32_i64(local_tid_233368)] =\n                x_213874;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233413 = 0; i_233413 < sdiv_up64(s_n_m_203636 -\n                                                    sext_i32_i64(local_tid_233368),\n                                                    computed_group_sizze_213705);\n         i_233413++) {\n        double tmp_233414;\n        \n        tmp_233414 = ((__local double *) red_arr_mem_233385)[q_s_203493 -\n                                                             (int64_t) 1 +\n                                                             (i_233413 *\n                             ",
            "                                 computed_group_sizze_213705 +\n                                                              sext_i32_i64(local_tid_233368)) *\n                                                             q_s_203493];\n        ((__local double *) color_232002)[i_233413 *\n                                          computed_group_sizze_213705 +\n                                          sext_i32_i64(local_tid_233368)] =\n            tmp_233414;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233415 = 0; i_233415 < sdiv_up64(s_n_m_203636 -\n                                                    sext_i32_i64(local_tid_233368),\n                                                    computed_group_sizze_213705);\n         i_233415++) {\n        double tmp_233416;\n        \n        tmp_233416 = ((__local double *) red_arr_mem_233387)[q_s_203493 -\n                                                             (int64_t) 1 +\n                                                             (i_233415 *\n                                                              computed_group_sizze_213705 +\n                                                              sext_i32_i64(local_tid_233368)) *\n                                                             q_s_203493];\n        ((__local double *) color_231997)[i_233415 *\n                                          computed_group_sizze_213705 +\n                                          sext_i32_i64(local_tid_233368)] =\n            tmp_233416;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233417 = 0; i_233417 < sdiv_up64(s_n_m_203636 -\n                                                    sext_i32_i64(local_tid_233368),\n                                                    computed_group_sizze_213705);\n         i_233417++) {\n        double tmp_233418;\n        \n        tmp_233418 = ((__local double *) red_arr_mem_233389)[q_s_203493 -\n                                                             (int64_t) 1 +\n                    ",
            "                                         (i_233417 *\n                                                              computed_group_sizze_213705 +\n                                                              sext_i32_i64(local_tid_233368)) *\n                                                             q_s_203493];\n        ((__local double *) color_231996)[i_233417 *\n                                          computed_group_sizze_213705 +\n                                          sext_i32_i64(local_tid_233368)] =\n            tmp_233418;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_213906 = sext_i32_i64(sext_i64_i32(ltid_pre_233372));\n    int32_t phys_tid_213907 = local_tid_233368;\n    \n    if (slt64(gtid_213906, s_n_m_203636)) {\n        bool index_primexp_228725 = gtid_213906 == (int64_t) 0;\n        double defunc_2_reduce_res_213910;\n        \n        defunc_2_reduce_res_213910 = ((__local\n                                       double *) color_232002)[gtid_213906];\n        \n        double defunc_2_reduce_res_213911;\n        \n        defunc_2_reduce_res_213911 = ((__local\n                                       double *) color_231997)[gtid_213906];\n        \n        double defunc_2_reduce_res_213912;\n        \n        defunc_2_reduce_res_213912 = ((__local\n                                       double *) color_231996)[gtid_213906];\n        \n        double x_213913 = defunc_2_reduce_res_213910 *\n               defunc_2_reduce_res_213912;\n        double y_213914 = defunc_2_reduce_res_213911 *\n               defunc_2_reduce_res_213911;\n        double y_213915 = x_213913 - y_213914;\n        double det1_213916 = 1.0 / y_213915;\n        double a11_213917 = defunc_2_reduce_res_213912 * det1_213916;\n        double x_213918 = 0.0 - defunc_2_reduce_res_213911;\n        double b11_213919 = det1_213916 * x_213918;\n        double c11_213920 = defunc_2_reduce_res_213910 * det1_213916;\n        int64_t defunc_0_m_fun_res_213921;\n        \n  ",
            "      if (index_primexp_228725) {\n            defunc_0_m_fun_res_213921 = (int64_t) 0;\n        } else {\n            int64_t y_213922 = sub64(s_n_m_203636, (int64_t) 1);\n            bool cond_213923 = gtid_213906 == y_213922;\n            int64_t defunc_0_m_fun_res_f_res_213924;\n            \n            if (cond_213923) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_213925 =\n                        sub64(pad_css_len_203632, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_213924 =\n                    defunc_0_m_fun_res_f_res_t_res_213925;\n            } else {\n                int64_t x_213926 = sub64(gtid_213906, (int64_t) 1);\n                int64_t x_213927 = mul64(jump_s_203499, x_213926);\n                int64_t min_arg_213928 = add64((int64_t) 1, x_213927);\n                int64_t min_res_213929 = smin64(defunc_0_f_res_203631,\n                                                min_arg_213928);\n                \n                defunc_0_m_fun_res_f_res_213924 = min_res_213929;\n            }\n            defunc_0_m_fun_res_213921 = defunc_0_m_fun_res_f_res_213924;\n        }\n        ((__local double *) color_232001)[gtid_213906] = a11_213917;\n        ((__local double *) color_232000)[gtid_213906] = b11_213919;\n        ((__local double *) color_231999)[gtid_213906] = c11_213920;\n        ((__local int64_t *) color_231998)[gtid_213906] =\n            defunc_0_m_fun_res_213921;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_213932 = sext_i32_i64(sext_i64_i32(ltid_pre_233375));\n    int64_t gtid_213933 = sext_i32_i64(sext_i64_i32(ltid_pre_233376));\n    int32_t phys_tid_213934 = local_tid_233368;\n    __local unsigned char *red_arr_mem_233419;\n    \n    red_arr_mem_233419 = (__local\n                          unsigned char *) red_arr_mem_233419_backing_11;\n    \n    __local unsigned char *red_arr_mem_233421;\n    \n    red_arr_mem_233421 = (__local\n                          unsigned char *) red_arr_mem_233421_backing_12;\n    if (slt64(gti",
            "d_213932, s_n_m_203636) && slt64(gtid_213933, q_s_203493)) {\n        int64_t x_213941;\n        \n        x_213941 = ((__global int64_t *) ext_mem_229363)[gtid_213834 *\n                                                         (s_n_m_203636 *\n                                                          n_p_203492) +\n                                                         gtid_213835 *\n                                                         s_n_m_203636 +\n                                                         gtid_213932];\n        \n        double x_213942;\n        \n        x_213942 = ((__global double *) ext_mem_229362)[gtid_213834 *\n                                                        (s_n_m_203636 *\n                                                         n_p_203492) +\n                                                        gtid_213835 *\n                                                        s_n_m_203636 +\n                                                        gtid_213932];\n        \n        double a11_213943;\n        \n        a11_213943 = ((__local double *) color_232001)[gtid_213932];\n        \n        double b11_213944;\n        \n        b11_213944 = ((__local double *) color_232000)[gtid_213932];\n        \n        double c11_213945;\n        \n        c11_213945 = ((__local double *) color_231999)[gtid_213932];\n        \n        int64_t defunc_0_m_fun_res_213946;\n        \n        defunc_0_m_fun_res_213946 = ((__local\n                                      int64_t *) color_231998)[gtid_213932];\n        \n        bool cond_213948 = sle64(x_213843, gtid_213933);\n        int64_t defunc_0_f_res_213949;\n        \n        if (cond_213948) {\n            defunc_0_f_res_213949 = (int64_t) 0;\n        } else {\n            int64_t i_213950 = add64(gtid_213933, x_213941);\n            int64_t defunc_0_add_arg_213951;\n            \n            defunc_0_add_arg_213951 = ((__global\n                                        int64_t *) ext_mem_229265)[gtid_213834 *\n                         ",
            "                                          (defunc_0_f_res_203631 *\n                                                                    n_p_203492) +\n                                                                   gtid_213835 *\n                                                                   defunc_0_f_res_203631 +\n                                                                   i_213950];\n            \n            int64_t defunc_1_add_res_213952 = add64((int64_t) 1,\n                                                    defunc_0_add_arg_213951);\n            \n            defunc_0_f_res_213949 = defunc_1_add_res_213952;\n        }\n        \n        double defunc_0_f_res_213953;\n        \n        if (cond_213948) {\n            defunc_0_f_res_213953 = 0.0;\n        } else {\n            int64_t i_213954 = add64(gtid_213933, x_213941);\n            double defunc_0_add_arg_213955;\n            \n            defunc_0_add_arg_213955 = ((__global\n                                        double *) mem_229531)[gtid_213834 *\n                                                              (defunc_0_f_res_203631 *\n                                                               n_p_203492) +\n                                                              gtid_213835 *\n                                                              defunc_0_f_res_203631 +\n                                                              i_213954];\n            defunc_0_f_res_213953 = defunc_0_add_arg_213955;\n        }\n        \n        int64_t binop_p_213956 = sub64(defunc_0_f_res_213949,\n                                       defunc_0_m_fun_res_213946);\n        double defunc_0_f_res_213957 = sitofp_i64_f64(binop_p_213956);\n        double abs_res_213958 = fabs(defunc_0_f_res_213957);\n        double tmp1_213959 = abs_res_213958 / x_213942;\n        double x_213960 = tmp1_213959 * tmp1_213959;\n        double y_213961 = tmp1_213959 * x_213960;\n        double tmp2_213962 = 1.0 - y_213961;\n        double x_213963 = tmp2_21",
            "3962 * tmp2_213962;\n        double tmp3_213964 = tmp2_213962 * x_213963;\n        double tmp4_213965 = defunc_0_f_res_213953 * tmp3_213964;\n        double defunc_1_f_res_213966 = defunc_0_f_res_213957 * tmp4_213965;\n        double defunc_0_f_res_213967;\n        \n        if (cond_213948) {\n            defunc_0_f_res_213967 = 0.0;\n        } else {\n            int64_t i_213968 = add64(gtid_213933, x_213941);\n            double defunc_0_add_arg_213969;\n            \n            defunc_0_add_arg_213969 = ((__global\n                                        double *) mem_229526)[gtid_213834 *\n                                                              (defunc_0_f_res_203631 *\n                                                               n_p_203492) +\n                                                              gtid_213835 *\n                                                              defunc_0_f_res_203631 +\n                                                              i_213968];\n            defunc_0_f_res_213967 = defunc_0_add_arg_213969;\n        }\n        \n        double x_213970 = a11_213943 * tmp4_213965;\n        double y_213971 = b11_213944 * defunc_1_f_res_213966;\n        double x_213972 = x_213970 + y_213971;\n        double defunc_9_fit_fun_res_213973 = defunc_0_f_res_213967 * x_213972;\n        double x_213974 = b11_213944 * tmp4_213965;\n        double y_213975 = c11_213945 * defunc_1_f_res_213966;\n        double x_213976 = x_213974 + y_213975;\n        double defunc_9_slope_fun_res_213977 = defunc_0_f_res_213967 * x_213976;\n        \n        ((__local double *) red_arr_mem_233419)[gtid_213932 * q_s_203493 +\n                                                gtid_213933] =\n            defunc_9_fit_fun_res_213973;\n        ((__local double *) red_arr_mem_233421)[gtid_213932 * q_s_203493 +\n                                                gtid_213933] =\n            defunc_9_slope_fun_res_213977;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t dims_flat_233423 = s_n_",
            "m_203636 * q_s_203493;\n    double x_213935;\n    double x_213936;\n    double x_213937;\n    double x_213938;\n    double x_233426;\n    double x_233427;\n    double x_233428;\n    double x_233429;\n    bool ltid_in_bounds_233432 = slt64(sext_i32_i64(local_tid_233368),\n                                       s_n_m_203636 * q_s_203493);\n    int32_t skip_threads_233433;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_233432) {\n            x_213937 = ((volatile __local\n                         double *) red_arr_mem_233419)[sext_i32_i64(local_tid_233368)];\n            x_213938 = ((volatile __local\n                         double *) red_arr_mem_233421)[sext_i32_i64(local_tid_233368)];\n            if ((local_tid_233368 - squot32(local_tid_233368, 32) * 32) == 0) {\n                x_213935 = x_213937;\n                x_213936 = x_213938;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_233433 = 1;\n        while (slt32(skip_threads_233433, 32)) {\n            bool thread_active_233434 = sle32(skip_threads_233433,\n                                              local_tid_233368 -\n                                              squot32(local_tid_233368, 32) *\n                                              32) && ltid_in_bounds_233432;\n            \n            if (thread_active_233434) {\n                // read operands\n                {\n                    x_213935 = ((volatile __local\n                                 double *) red_arr_mem_233419)[sext_i32_i64(local_tid_233368) -\n                                                               sext_i32_i64(skip_threads_233433)];\n                    x_213936 = ((volatile __local\n                                 double *) red_arr_mem_233421)[sext_i32_i64(local_tid_233368) -\n                                                               sext_i32_i64(skip_threads_233433)];\n                }\n            }\n            // perform operation\n            {\n           ",
            "     bool inactive_233435 =\n                     slt64(srem64(sext_i32_i64(local_tid_233368), q_s_203493),\n                           sext_i32_i64(local_tid_233368) -\n                           sext_i32_i64(local_tid_233368 -\n                           skip_threads_233433));\n                \n                if (thread_active_233434 && inactive_233435) {\n                    x_213935 = x_213937;\n                    x_213936 = x_213938;\n                }\n                if (thread_active_233434) {\n                    if (!inactive_233435) {\n                        double defunc_1_op_res_213939 = x_213935 + x_213937;\n                        double defunc_1_op_res_213940 = x_213936 + x_213938;\n                        \n                        x_213935 = defunc_1_op_res_213939;\n                        x_213936 = defunc_1_op_res_213940;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_233370, skip_threads_233433)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (thread_active_233434) {\n                // write result\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_233419)[sext_i32_i64(local_tid_233368)] =\n                        x_213935;\n                    x_213937 = x_213935;\n                    ((volatile __local\n                      double *) red_arr_mem_233421)[sext_i32_i64(local_tid_233368)] =\n                        x_213936;\n                    x_213938 = x_213936;\n                }\n            }\n            if (sle32(wave_sizze_233370, skip_threads_233433)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_233433 *= 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_233368 - squot32(local_tid_233368, 32) * 32) == 31 &&\n            ltid_in_bounds_233432) {\n            ((volatile __local\n              double *) red_ar",
            "r_mem_233419)[sext_i32_i64(squot32(local_tid_233368,\n                                                                 32))] =\n                x_213935;\n            ((volatile __local\n              double *) red_arr_mem_233421)[sext_i32_i64(squot32(local_tid_233368,\n                                                                 32))] =\n                x_213936;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n    {\n        int32_t skip_threads_233436;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_233368, 32) == 0 && ltid_in_bounds_233432) {\n                x_233428 = ((volatile __local\n                             double *) red_arr_mem_233419)[sext_i32_i64(local_tid_233368)];\n                x_233429 = ((volatile __local\n                             double *) red_arr_mem_233421)[sext_i32_i64(local_tid_233368)];\n                if ((local_tid_233368 - squot32(local_tid_233368, 32) * 32) ==\n                    0) {\n                    x_233426 = x_233428;\n                    x_233427 = x_233429;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_233436 = 1;\n            while (slt32(skip_threads_233436, 32)) {\n                bool thread_active_233437 = sle32(skip_threads_233436,\n                                                  local_tid_233368 -\n                                                  squot32(local_tid_233368,\n                                                          32) * 32) &&\n                     (squot32(local_tid_233368, 32) == 0 &&\n                      ltid_in_bounds_233432);\n                \n                if (thread_active_233437) {\n                    // read operands\n                    {\n                        x_233426 = ((volatile __local\n                                     double *) red_arr_mem_233419)[sext_i32_i64(local_tid_2",
            "33368) -\n                                                                   sext_i32_i64(skip_threads_233436)];\n                        x_233427 = ((volatile __local\n                                     double *) red_arr_mem_233421)[sext_i32_i64(local_tid_233368) -\n                                                                   sext_i32_i64(skip_threads_233436)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_233438 =\n                         slt64(srem64(sext_i32_i64(local_tid_233368 * 32 + 32 -\n                                      1), q_s_203493),\n                               sext_i32_i64(local_tid_233368 * 32 + 32 - 1) -\n                               sext_i32_i64((local_tid_233368 -\n                                             skip_threads_233436) * 32 + 32 -\n                               1));\n                    \n                    if (thread_active_233437 && inactive_233438) {\n                        x_233426 = x_233428;\n                        x_233427 = x_233429;\n                    }\n                    if (thread_active_233437) {\n                        if (!inactive_233438) {\n                            double defunc_1_op_res_233430 = x_233426 + x_233428;\n                            double defunc_1_op_res_233431 = x_233427 + x_233429;\n                            \n                            x_233426 = defunc_1_op_res_233430;\n                            x_233427 = defunc_1_op_res_233431;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_233370, skip_threads_233436)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_233437) {\n                    // write result\n                    {\n                        ((volatile __local\n                          double *) red_arr_mem_233419)[sext_i32_i64(local_tid_233368)] =\n                            x_233426;\n             ",
            "           x_233428 = x_233426;\n                        ((volatile __local\n                          double *) red_arr_mem_233421)[sext_i32_i64(local_tid_233368)] =\n                            x_233427;\n                        x_233429 = x_233427;\n                    }\n                }\n                if (sle32(wave_sizze_233370, skip_threads_233436)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_233436 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_233439 = squot32(local_tid_233368, 32) == 0 ||\n         !ltid_in_bounds_233432;\n    \n    // carry-in for every block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_233439) {\n                x_213937 = x_213935;\n                x_213938 = x_213936;\n                x_213935 = ((__local\n                             double *) red_arr_mem_233419)[sext_i32_i64(squot32(local_tid_233368,\n                                                                                32)) -\n                                                           (int64_t) 1];\n                x_213936 = ((__local\n                             double *) red_arr_mem_233421)[sext_i32_i64(squot32(local_tid_233368,\n                                                                                32)) -\n                                                           (int64_t) 1];\n            }\n        }\n        // perform operation\n        {\n            bool inactive_233440 = slt64(srem64(sext_i32_i64(local_tid_233368),\n                                                q_s_203493),\n                                         sext_i32_i64(local_tid_233368) -\n                                         sext_i32_i64(squot32(local_tid_233368,\n                                                              32) * 32 - 1));\n            \n            if (!no_carry_in_233439) {\n                if (inactive_233440) {\n                    x_213935 = x_21393",
            "7;\n                    x_213936 = x_213938;\n                }\n            }\n            if (!no_carry_in_233439) {\n                if (!inactive_233440) {\n                    double defunc_1_op_res_213939 = x_213935 + x_213937;\n                    double defunc_1_op_res_213940 = x_213936 + x_213938;\n                    \n                    x_213935 = defunc_1_op_res_213939;\n                    x_213936 = defunc_1_op_res_213940;\n                }\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_233439) {\n                ((__local\n                  double *) red_arr_mem_233419)[sext_i32_i64(local_tid_233368)] =\n                    x_213935;\n                ((__local\n                  double *) red_arr_mem_233421)[sext_i32_i64(local_tid_233368)] =\n                    x_213936;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_233368, 32) == 0 && ltid_in_bounds_233432) {\n            ((__local\n              double *) red_arr_mem_233419)[sext_i32_i64(local_tid_233368)] =\n                x_213937;\n            ((__local\n              double *) red_arr_mem_233421)[sext_i32_i64(local_tid_233368)] =\n                x_213938;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233441 = 0; i_233441 < sdiv_up64(s_n_m_203636 -\n                                                    sext_i32_i64(local_tid_233368),\n                                                    computed_group_sizze_213705);\n         i_233441++) {\n        double tmp_233442;\n        \n        tmp_233442 = ((__local double *) red_arr_mem_233419)[q_s_203493 -\n                                                             (int64_t) 1 +\n                                                             (i_233441 *\n                                                              computed_group_sizze_213705 +\n                                      ",
            "                        sext_i32_i64(local_tid_233368)) *\n                                                             q_s_203493];\n        ((__local double *) color_231997)[i_233441 *\n                                          computed_group_sizze_213705 +\n                                          sext_i32_i64(local_tid_233368)] =\n            tmp_233442;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233443 = 0; i_233443 < sdiv_up64(s_n_m_203636 -\n                                                    sext_i32_i64(local_tid_233368),\n                                                    computed_group_sizze_213705);\n         i_233443++) {\n        double tmp_233444;\n        \n        tmp_233444 = ((__local double *) red_arr_mem_233421)[q_s_203493 -\n                                                             (int64_t) 1 +\n                                                             (i_233443 *\n                                                              computed_group_sizze_213705 +\n                                                              sext_i32_i64(local_tid_233368)) *\n                                                             q_s_203493];\n        ((__local double *) color_231996)[i_233443 *\n                                          computed_group_sizze_213705 +\n                                          sext_i32_i64(local_tid_233368)] =\n            tmp_233444;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233445 = 0; i_233445 < sdiv_up64(s_n_m_203636 -\n                                                    sext_i32_i64(local_tid_233368),\n                                                    computed_group_sizze_213705);\n         i_233445++) {\n        double tmp_233446;\n        \n        tmp_233446 = ((__local double *) color_231997)[i_233445 *\n                                                       computed_group_sizze_213705 +\n                                                       sext_i32_i64(local_tid_233368)",
            "];\n        ((__global double *) mem_229951)[gtid_213834 * (s_n_m_203636 *\n                                                        n_p_203492) +\n                                         gtid_213835 * s_n_m_203636 +\n                                         (i_233445 *\n                                          computed_group_sizze_213705 +\n                                          sext_i32_i64(local_tid_233368))] =\n            tmp_233446;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233447 = 0; i_233447 < sdiv_up64(s_n_m_203636 -\n                                                    sext_i32_i64(local_tid_233368),\n                                                    computed_group_sizze_213705);\n         i_233447++) {\n        double tmp_233448;\n        \n        tmp_233448 = ((__local double *) color_231996)[i_233447 *\n                                                       computed_group_sizze_213705 +\n                                                       sext_i32_i64(local_tid_233368)];\n        ((__global double *) mem_229956)[gtid_213834 * (s_n_m_203636 *\n                                                        n_p_203492) +\n                                         gtid_213835 * s_n_m_203636 +\n                                         (i_233447 *\n                                          computed_group_sizze_213705 +\n                                          sext_i32_i64(local_tid_233368))] =\n            tmp_233448;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n  error_6:\n    return;\n}\n__kernel void mainzisegmap_intragroup_216411(__global int *global_failure,\n                                             uint red_arr_mem_233816_backing_offset_0,\n                                             uint red_arr_mem_233814_backing_offset_1,\n                                             uint red_arr_mem_233772_backing_offset_2,\n                                             uint red_arr_mem_233770_backing_offset_3,\n                                             uint red_arr_m",
            "em_233768_backing_offset_4,\n                                             uint red_arr_mem_233766_backing_offset_5,\n                                             uint red_arr_mem_233764_backing_offset_6,\n                                             uint color_232019_backing_offset_7,\n                                             uint color_232018_backing_offset_8,\n                                             uint color_232017_backing_offset_9,\n                                             uint color_232016_backing_offset_10,\n                                             uint color_232015_backing_offset_11,\n                                             uint color_232014_backing_offset_12,\n                                             uint color_232013_backing_offset_13,\n                                             uint color_232012_backing_offset_14,\n                                             uint color_232011_backing_offset_15,\n                                             uint color_232010_backing_offset_16,\n                                             uint color_232009_backing_offset_17,\n                                             uint color_232008_backing_offset_18,\n                                             int64_t n_p_203492,\n                                             int64_t q_s_203493,\n                                             int64_t jump_s_203499,\n                                             int64_t partition_sizze_203577,\n                                             int64_t defunc_0_f_res_203631,\n                                             int64_t pad_css_len_203632,\n                                             int64_t s_n_m_203636,\n                                             int64_t computed_group_sizze_216248,\n                                             __global\n                                             unsigned char *ext_mem_229264,\n                                             __global\n                                             unsigned char *",
            "ext_mem_229265,\n                                             __global\n                                             unsigned char *ext_mem_229362,\n                                             __global\n                                             unsigned char *ext_mem_229363,\n                                             __global unsigned char *mem_229526,\n                                             __global unsigned char *mem_229531,\n                                             __global unsigned char *mem_230290,\n                                             __global unsigned char *mem_230295)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_233816_backing_18 =\n                           &shared_mem[red_arr_mem_233816_backing_offset_0];\n    volatile unsigned char *red_arr_mem_233814_backing_17 =\n                           &shared_mem[red_arr_mem_233814_backing_offset_1];\n    volatile unsigned char *red_arr_mem_233772_backing_16 =\n                           &shared_mem[red_arr_mem_233772_backing_offset_2];\n    volatile unsigned char *red_arr_mem_233770_backing_15 =\n                           &shared_mem[red_arr_mem_233770_backing_offset_3];\n    volatile unsigned char *red_arr_mem_233768_backing_14 =\n                           &shared_mem[red_arr_mem_233768_backing_offset_4];\n    volatile unsigned char *red_arr_mem_233766_backing_13 =\n                           &shared_mem[red_arr_mem_233766_backing_offset_5];\n    volatile unsigned char *red_arr_mem_233764_backing_12 =\n                           &shared_mem[red_arr_mem_233764_backing_offset_6];\n    volatile unsigned char *color_232019_backing_11 =\n                           &shared_mem[color_232019_backing_offset_7];\n    volatile unsigned char *color_232018_backing_10 =\n                           &shared_mem[color_232018_backing_offset_8];\n    volatile unsigned char *color_232017_backing_9 =\n                           &shared_mem[color_2",
            "32017_backing_offset_9];\n    volatile unsigned char *color_232016_backing_8 =\n                           &shared_mem[color_232016_backing_offset_10];\n    volatile unsigned char *color_232015_backing_7 =\n                           &shared_mem[color_232015_backing_offset_11];\n    volatile unsigned char *color_232014_backing_6 =\n                           &shared_mem[color_232014_backing_offset_12];\n    volatile unsigned char *color_232013_backing_5 =\n                           &shared_mem[color_232013_backing_offset_13];\n    volatile unsigned char *color_232012_backing_4 =\n                           &shared_mem[color_232012_backing_offset_14];\n    volatile unsigned char *color_232011_backing_3 =\n                           &shared_mem[color_232011_backing_offset_15];\n    volatile unsigned char *color_232010_backing_2 =\n                           &shared_mem[color_232010_backing_offset_16];\n    volatile unsigned char *color_232009_backing_1 =\n                           &shared_mem[color_232009_backing_offset_17];\n    volatile unsigned char *color_232008_backing_0 =\n                           &shared_mem[color_232008_backing_offset_18];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233746;\n    int32_t local_tid_233747;\n    int64_t group_sizze_233750;\n    int32_t wave_sizze_233749;\n    int32_t group_tid_233748;\n    \n    global_tid_233746 = get_global_id(0);\n    local_tid_233747 = get_local_id(0);\n    group_sizze_233750 = get_local_size(0);\n    wave_sizze_233749 = LOCKSTEP_WIDTH;\n    group_tid_233748 = get_group_id(0);\n    \n    int32_t phys_tid_216411 = group_tid_233748;\n    int64_t slice_233752 = s_n_m_203636;\n    int64_t ltid_pre_233751 = sext_i32_i64(local_tid_233747);\n    int64_t remnant_233753 = sext_i32_i64(local_tid_233747) - ltid_pre_233751;\n    int64_t slice_233756 = q_s_203493;\n    int64_t slice_233757 = s_n_m_203636 * slice_233756;\n    int64_t ltid_pre_233754 = squot64(sext_i32_i64(local_tid_233747),\n                             ",
            "         slice_233756);\n    int64_t remnant_233758 = sext_i32_i64(local_tid_233747) - ltid_pre_233754 *\n            slice_233756;\n    int64_t ltid_pre_233755 = remnant_233758;\n    int64_t remnant_233759 = remnant_233758 - ltid_pre_233755;\n    int64_t slice_233760 = n_p_203492;\n    int64_t slice_233761 = partition_sizze_203577 * slice_233760;\n    int64_t gtid_216409 = squot64(sext_i32_i64(group_tid_233748), slice_233760);\n    int64_t remnant_233762 = sext_i32_i64(group_tid_233748) - gtid_216409 *\n            slice_233760;\n    int64_t gtid_216410 = remnant_233762;\n    int64_t remnant_233763 = remnant_233762 - gtid_216410;\n    __local unsigned char *color_232008;\n    \n    color_232008 = (__local unsigned char *) color_232008_backing_0;\n    \n    __local unsigned char *color_232009;\n    \n    color_232009 = (__local unsigned char *) color_232009_backing_1;\n    \n    __local unsigned char *color_232010;\n    \n    color_232010 = (__local unsigned char *) color_232010_backing_2;\n    \n    __local unsigned char *color_232011;\n    \n    color_232011 = (__local unsigned char *) color_232011_backing_3;\n    \n    __local unsigned char *color_232012;\n    \n    color_232012 = (__local unsigned char *) color_232012_backing_4;\n    \n    __local unsigned char *color_232013;\n    \n    color_232013 = (__local unsigned char *) color_232013_backing_5;\n    \n    __local unsigned char *color_232014;\n    \n    color_232014 = (__local unsigned char *) color_232014_backing_6;\n    \n    __local unsigned char *color_232015;\n    \n    color_232015 = (__local unsigned char *) color_232015_backing_7;\n    \n    __local unsigned char *color_232016;\n    \n    color_232016 = (__local unsigned char *) color_232016_backing_8;\n    \n    __local unsigned char *color_232017;\n    \n    color_232017 = (__local unsigned char *) color_232017_backing_9;\n    \n    __local unsigned char *color_232018;\n    \n    color_232018 = (__local unsigned char *) color_232018_backing_10;\n    \n    __local unsigned char *color_232019;\n    \n    c",
            "olor_232019 = (__local unsigned char *) color_232019_backing_11;\n    \n    int64_t x_216418;\n    \n    x_216418 = ((__global int64_t *) ext_mem_229264)[gtid_216409 * n_p_203492 +\n                                                     gtid_216410];\n    \n    int64_t gtid_216425 = sext_i32_i64(sext_i64_i32(ltid_pre_233751));\n    int32_t phys_tid_216426 = local_tid_233747;\n    \n    if (slt64(gtid_216425, s_n_m_203636)) {\n        bool cond_216428 = gtid_216425 == (int64_t) 0;\n        int64_t defunc_0_m_fun_res_216429;\n        \n        if (cond_216428) {\n            defunc_0_m_fun_res_216429 = (int64_t) 0;\n        } else {\n            int64_t y_216430 = sub64(s_n_m_203636, (int64_t) 1);\n            bool cond_216431 = gtid_216425 == y_216430;\n            int64_t defunc_0_m_fun_res_f_res_216432;\n            \n            if (cond_216431) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_216433 =\n                        sub64(pad_css_len_203632, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_216432 =\n                    defunc_0_m_fun_res_f_res_t_res_216433;\n            } else {\n                int64_t x_216434 = sub64(gtid_216425, (int64_t) 1);\n                int64_t x_216435 = mul64(jump_s_203499, x_216434);\n                int64_t min_arg_216436 = add64((int64_t) 1, x_216435);\n                int64_t min_res_216437 = smin64(defunc_0_f_res_203631,\n                                                min_arg_216436);\n                \n                defunc_0_m_fun_res_f_res_216432 = min_res_216437;\n            }\n            defunc_0_m_fun_res_216429 = defunc_0_m_fun_res_f_res_216432;\n        }\n        ((__local int64_t *) color_232010)[gtid_216425] =\n            defunc_0_m_fun_res_216429;\n        ((__local bool *) color_232019)[gtid_216425] = cond_216428;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_216443 = sext_i32_i64(sext_i64_i32(ltid_pre_233754));\n    int64_t gtid_216444 = sext_i32_i64(sext_i64_i32(ltid_pre_233755));\n    int32_t ",
            "phys_tid_216445 = local_tid_233747;\n    __local unsigned char *red_arr_mem_233764;\n    \n    red_arr_mem_233764 = (__local\n                          unsigned char *) red_arr_mem_233764_backing_12;\n    \n    __local unsigned char *red_arr_mem_233766;\n    \n    red_arr_mem_233766 = (__local\n                          unsigned char *) red_arr_mem_233766_backing_13;\n    \n    __local unsigned char *red_arr_mem_233768;\n    \n    red_arr_mem_233768 = (__local\n                          unsigned char *) red_arr_mem_233768_backing_14;\n    \n    __local unsigned char *red_arr_mem_233770;\n    \n    red_arr_mem_233770 = (__local\n                          unsigned char *) red_arr_mem_233770_backing_15;\n    \n    __local unsigned char *red_arr_mem_233772;\n    \n    red_arr_mem_233772 = (__local\n                          unsigned char *) red_arr_mem_233772_backing_16;\n    if (slt64(gtid_216443, s_n_m_203636) && slt64(gtid_216444, q_s_203493)) {\n        int64_t x_216461;\n        \n        x_216461 = ((__global int64_t *) ext_mem_229363)[gtid_216409 *\n                                                         (s_n_m_203636 *\n                                                          n_p_203492) +\n                                                         gtid_216410 *\n                                                         s_n_m_203636 +\n                                                         gtid_216443];\n        \n        double x_216462;\n        \n        x_216462 = ((__global double *) ext_mem_229362)[gtid_216409 *\n                                                        (s_n_m_203636 *\n                                                         n_p_203492) +\n                                                        gtid_216410 *\n                                                        s_n_m_203636 +\n                                                        gtid_216443];\n        \n        int64_t defunc_0_m_fun_res_216463;\n        \n        defunc_0_m_fun_res_216463 = ((__local\n                           ",
            "           int64_t *) color_232010)[gtid_216443];\n        \n        bool cond_216465 = sle64(x_216418, gtid_216444);\n        int64_t defunc_0_f_res_216466;\n        \n        if (cond_216465) {\n            defunc_0_f_res_216466 = (int64_t) 0;\n        } else {\n            int64_t i_216467 = add64(gtid_216444, x_216461);\n            int64_t defunc_0_add_arg_216468;\n            \n            defunc_0_add_arg_216468 = ((__global\n                                        int64_t *) ext_mem_229265)[gtid_216409 *\n                                                                   (defunc_0_f_res_203631 *\n                                                                    n_p_203492) +\n                                                                   gtid_216410 *\n                                                                   defunc_0_f_res_203631 +\n                                                                   i_216467];\n            \n            int64_t defunc_1_add_res_216469 = add64((int64_t) 1,\n                                                    defunc_0_add_arg_216468);\n            \n            defunc_0_f_res_216466 = defunc_1_add_res_216469;\n        }\n        \n        double defunc_0_f_res_216470;\n        \n        if (cond_216465) {\n            defunc_0_f_res_216470 = 0.0;\n        } else {\n            int64_t i_216471 = add64(gtid_216444, x_216461);\n            double defunc_0_add_arg_216472;\n            \n            defunc_0_add_arg_216472 = ((__global\n                                        double *) mem_229531)[gtid_216409 *\n                                                              (defunc_0_f_res_203631 *\n                                                               n_p_203492) +\n                                                              gtid_216410 *\n                                                              defunc_0_f_res_203631 +\n                                                              i_216471];\n            defunc_0_f_res_216470 = defunc_0_ad",
            "d_arg_216472;\n        }\n        \n        int64_t binop_p_216473 = sub64(defunc_0_f_res_216466,\n                                       defunc_0_m_fun_res_216463);\n        double defunc_0_f_res_216474 = sitofp_i64_f64(binop_p_216473);\n        double abs_res_216475 = fabs(defunc_0_f_res_216474);\n        double tmp1_216476 = abs_res_216475 / x_216462;\n        double x_216477 = tmp1_216476 * tmp1_216476;\n        double y_216478 = tmp1_216476 * x_216477;\n        double tmp2_216479 = 1.0 - y_216478;\n        double x_216480 = tmp2_216479 * tmp2_216479;\n        double tmp3_216481 = tmp2_216479 * x_216480;\n        double w_j_216482 = defunc_0_f_res_216470 * tmp3_216481;\n        double xw_j_216483 = defunc_0_f_res_216474 * w_j_216482;\n        double x2w_j_216484 = defunc_0_f_res_216474 * xw_j_216483;\n        double x3w_j_216485 = defunc_0_f_res_216474 * x2w_j_216484;\n        double x4w_j_216486 = defunc_0_f_res_216474 * x3w_j_216485;\n        \n        ((__local double *) red_arr_mem_233764)[gtid_216443 * q_s_203493 +\n                                                gtid_216444] = w_j_216482;\n        ((__local double *) red_arr_mem_233766)[gtid_216443 * q_s_203493 +\n                                                gtid_216444] = xw_j_216483;\n        ((__local double *) red_arr_mem_233768)[gtid_216443 * q_s_203493 +\n                                                gtid_216444] = x2w_j_216484;\n        ((__local double *) red_arr_mem_233770)[gtid_216443 * q_s_203493 +\n                                                gtid_216444] = x3w_j_216485;\n        ((__local double *) red_arr_mem_233772)[gtid_216443 * q_s_203493 +\n                                                gtid_216444] = x4w_j_216486;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t dims_flat_233774 = s_n_m_203636 * q_s_203493;\n    double x_216446;\n    double x_216447;\n    double x_216448;\n    double x_216449;\n    double x_216450;\n    double x_216451;\n    double x_216452;\n    double x_216453;\n    double x_216454;\n    d",
            "ouble x_216455;\n    double x_233780;\n    double x_233781;\n    double x_233782;\n    double x_233783;\n    double x_233784;\n    double x_233785;\n    double x_233786;\n    double x_233787;\n    double x_233788;\n    double x_233789;\n    bool ltid_in_bounds_233795 = slt64(sext_i32_i64(local_tid_233747),\n                                       s_n_m_203636 * q_s_203493);\n    int32_t skip_threads_233796;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_233795) {\n            x_216451 = ((volatile __local\n                         double *) red_arr_mem_233764)[sext_i32_i64(local_tid_233747)];\n            x_216452 = ((volatile __local\n                         double *) red_arr_mem_233766)[sext_i32_i64(local_tid_233747)];\n            x_216453 = ((volatile __local\n                         double *) red_arr_mem_233768)[sext_i32_i64(local_tid_233747)];\n            x_216454 = ((volatile __local\n                         double *) red_arr_mem_233770)[sext_i32_i64(local_tid_233747)];\n            x_216455 = ((volatile __local\n                         double *) red_arr_mem_233772)[sext_i32_i64(local_tid_233747)];\n            if ((local_tid_233747 - squot32(local_tid_233747, 32) * 32) == 0) {\n                x_216446 = x_216451;\n                x_216447 = x_216452;\n                x_216448 = x_216453;\n                x_216449 = x_216454;\n                x_216450 = x_216455;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_233796 = 1;\n        while (slt32(skip_threads_233796, 32)) {\n            bool thread_active_233797 = sle32(skip_threads_233796,\n                                              local_tid_233747 -\n                                              squot32(local_tid_233747, 32) *\n                                              32) && ltid_in_bounds_233795;\n            \n            if (thread_active_233797) {\n                // read operands\n                {\n                    x_216446 = ((volatile __",
            "local\n                                 double *) red_arr_mem_233764)[sext_i32_i64(local_tid_233747) -\n                                                               sext_i32_i64(skip_threads_233796)];\n                    x_216447 = ((volatile __local\n                                 double *) red_arr_mem_233766)[sext_i32_i64(local_tid_233747) -\n                                                               sext_i32_i64(skip_threads_233796)];\n                    x_216448 = ((volatile __local\n                                 double *) red_arr_mem_233768)[sext_i32_i64(local_tid_233747) -\n                                                               sext_i32_i64(skip_threads_233796)];\n                    x_216449 = ((volatile __local\n                                 double *) red_arr_mem_233770)[sext_i32_i64(local_tid_233747) -\n                                                               sext_i32_i64(skip_threads_233796)];\n                    x_216450 = ((volatile __local\n                                 double *) red_arr_mem_233772)[sext_i32_i64(local_tid_233747) -\n                                                               sext_i32_i64(skip_threads_233796)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_233798 =\n                     slt64(srem64(sext_i32_i64(local_tid_233747), q_s_203493),\n                           sext_i32_i64(local_tid_233747) -\n                           sext_i32_i64(local_tid_233747 -\n                           skip_threads_233796));\n                \n                if (thread_active_233797 && inactive_233798) {\n                    x_216446 = x_216451;\n                    x_216447 = x_216452;\n                    x_216448 = x_216453;\n                    x_216449 = x_216454;\n                    x_216450 = x_216455;\n                }\n                if (thread_active_233797) {\n                    if (!inactive_233798) {\n                        double defunc_1_op_res_216456 = x_2164",
            "46 + x_216451;\n                        double defunc_1_op_res_216457 = x_216447 + x_216452;\n                        double defunc_1_op_res_216458 = x_216448 + x_216453;\n                        double defunc_1_op_res_216459 = x_216449 + x_216454;\n                        double defunc_1_op_res_216460 = x_216450 + x_216455;\n                        \n                        x_216446 = defunc_1_op_res_216456;\n                        x_216447 = defunc_1_op_res_216457;\n                        x_216448 = defunc_1_op_res_216458;\n                        x_216449 = defunc_1_op_res_216459;\n                        x_216450 = defunc_1_op_res_216460;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_233749, skip_threads_233796)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (thread_active_233797) {\n                // write result\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_233764)[sext_i32_i64(local_tid_233747)] =\n                        x_216446;\n                    x_216451 = x_216446;\n                    ((volatile __local\n                      double *) red_arr_mem_233766)[sext_i32_i64(local_tid_233747)] =\n                        x_216447;\n                    x_216452 = x_216447;\n                    ((volatile __local\n                      double *) red_arr_mem_233768)[sext_i32_i64(local_tid_233747)] =\n                        x_216448;\n                    x_216453 = x_216448;\n                    ((volatile __local\n                      double *) red_arr_mem_233770)[sext_i32_i64(local_tid_233747)] =\n                        x_216449;\n                    x_216454 = x_216449;\n                    ((volatile __local\n                      double *) red_arr_mem_233772)[sext_i32_i64(local_tid_233747)] =\n                        x_216450;\n                    x_216455 = x_216450;\n                }\n            }\n            if (sle32(wave_sizze_233749, skip_threads_23",
            "3796)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_233796 *= 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_233747 - squot32(local_tid_233747, 32) * 32) == 31 &&\n            ltid_in_bounds_233795) {\n            ((volatile __local\n              double *) red_arr_mem_233764)[sext_i32_i64(squot32(local_tid_233747,\n                                                                 32))] =\n                x_216446;\n            ((volatile __local\n              double *) red_arr_mem_233766)[sext_i32_i64(squot32(local_tid_233747,\n                                                                 32))] =\n                x_216447;\n            ((volatile __local\n              double *) red_arr_mem_233768)[sext_i32_i64(squot32(local_tid_233747,\n                                                                 32))] =\n                x_216448;\n            ((volatile __local\n              double *) red_arr_mem_233770)[sext_i32_i64(squot32(local_tid_233747,\n                                                                 32))] =\n                x_216449;\n            ((volatile __local\n              double *) red_arr_mem_233772)[sext_i32_i64(squot32(local_tid_233747,\n                                                                 32))] =\n                x_216450;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n    {\n        int32_t skip_threads_233799;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_233747, 32) == 0 && ltid_in_bounds_233795) {\n                x_233785 = ((volatile __local\n                             double *) red_arr_mem_233764)[sext_i32_i64(local_tid_233747)];\n                x_233786 = ((volatile __local\n                             double *) red_arr_mem_233766)[sext_i32_i64(local_tid_233747)];\n ",
            "               x_233787 = ((volatile __local\n                             double *) red_arr_mem_233768)[sext_i32_i64(local_tid_233747)];\n                x_233788 = ((volatile __local\n                             double *) red_arr_mem_233770)[sext_i32_i64(local_tid_233747)];\n                x_233789 = ((volatile __local\n                             double *) red_arr_mem_233772)[sext_i32_i64(local_tid_233747)];\n                if ((local_tid_233747 - squot32(local_tid_233747, 32) * 32) ==\n                    0) {\n                    x_233780 = x_233785;\n                    x_233781 = x_233786;\n                    x_233782 = x_233787;\n                    x_233783 = x_233788;\n                    x_233784 = x_233789;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_233799 = 1;\n            while (slt32(skip_threads_233799, 32)) {\n                bool thread_active_233800 = sle32(skip_threads_233799,\n                                                  local_tid_233747 -\n                                                  squot32(local_tid_233747,\n                                                          32) * 32) &&\n                     (squot32(local_tid_233747, 32) == 0 &&\n                      ltid_in_bounds_233795);\n                \n                if (thread_active_233800) {\n                    // read operands\n                    {\n                        x_233780 = ((volatile __local\n                                     double *) red_arr_mem_233764)[sext_i32_i64(local_tid_233747) -\n                                                                   sext_i32_i64(skip_threads_233799)];\n                        x_233781 = ((volatile __local\n                                     double *) red_arr_mem_233766)[sext_i32_i64(local_tid_233747) -\n                                                                   sext_i32_i64(skip_threads_233799)];\n                        x_233782 = ((volatile __local",
            "\n                                     double *) red_arr_mem_233768)[sext_i32_i64(local_tid_233747) -\n                                                                   sext_i32_i64(skip_threads_233799)];\n                        x_233783 = ((volatile __local\n                                     double *) red_arr_mem_233770)[sext_i32_i64(local_tid_233747) -\n                                                                   sext_i32_i64(skip_threads_233799)];\n                        x_233784 = ((volatile __local\n                                     double *) red_arr_mem_233772)[sext_i32_i64(local_tid_233747) -\n                                                                   sext_i32_i64(skip_threads_233799)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_233801 =\n                         slt64(srem64(sext_i32_i64(local_tid_233747 * 32 + 32 -\n                                      1), q_s_203493),\n                               sext_i32_i64(local_tid_233747 * 32 + 32 - 1) -\n                               sext_i32_i64((local_tid_233747 -\n                                             skip_threads_233799) * 32 + 32 -\n                               1));\n                    \n                    if (thread_active_233800 && inactive_233801) {\n                        x_233780 = x_233785;\n                        x_233781 = x_233786;\n                        x_233782 = x_233787;\n                        x_233783 = x_233788;\n                        x_233784 = x_233789;\n                    }\n                    if (thread_active_233800) {\n                        if (!inactive_233801) {\n                            double defunc_1_op_res_233790 = x_233780 + x_233785;\n                            double defunc_1_op_res_233791 = x_233781 + x_233786;\n                            double defunc_1_op_res_233792 = x_233782 + x_233787;\n                            double defunc_1_op_res_233793 = x_233783 + x_233788",
            ";\n                            double defunc_1_op_res_233794 = x_233784 + x_233789;\n                            \n                            x_233780 = defunc_1_op_res_233790;\n                            x_233781 = defunc_1_op_res_233791;\n                            x_233782 = defunc_1_op_res_233792;\n                            x_233783 = defunc_1_op_res_233793;\n                            x_233784 = defunc_1_op_res_233794;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_233749, skip_threads_233799)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_233800) {\n                    // write result\n                    {\n                        ((volatile __local\n                          double *) red_arr_mem_233764)[sext_i32_i64(local_tid_233747)] =\n                            x_233780;\n                        x_233785 = x_233780;\n                        ((volatile __local\n                          double *) red_arr_mem_233766)[sext_i32_i64(local_tid_233747)] =\n                            x_233781;\n                        x_233786 = x_233781;\n                        ((volatile __local\n                          double *) red_arr_mem_233768)[sext_i32_i64(local_tid_233747)] =\n                            x_233782;\n                        x_233787 = x_233782;\n                        ((volatile __local\n                          double *) red_arr_mem_233770)[sext_i32_i64(local_tid_233747)] =\n                            x_233783;\n                        x_233788 = x_233783;\n                        ((volatile __local\n                          double *) red_arr_mem_233772)[sext_i32_i64(local_tid_233747)] =\n                            x_233784;\n                        x_233789 = x_233784;\n                    }\n                }\n                if (sle32(wave_sizze_233749, skip_threads_233799)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n           ",
            "     skip_threads_233799 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_233802 = squot32(local_tid_233747, 32) == 0 ||\n         !ltid_in_bounds_233795;\n    \n    // carry-in for every block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_233802) {\n                x_216451 = x_216446;\n                x_216452 = x_216447;\n                x_216453 = x_216448;\n                x_216454 = x_216449;\n                x_216455 = x_216450;\n                x_216446 = ((__local\n                             double *) red_arr_mem_233764)[sext_i32_i64(squot32(local_tid_233747,\n                                                                                32)) -\n                                                           (int64_t) 1];\n                x_216447 = ((__local\n                             double *) red_arr_mem_233766)[sext_i32_i64(squot32(local_tid_233747,\n                                                                                32)) -\n                                                           (int64_t) 1];\n                x_216448 = ((__local\n                             double *) red_arr_mem_233768)[sext_i32_i64(squot32(local_tid_233747,\n                                                                                32)) -\n                                                           (int64_t) 1];\n                x_216449 = ((__local\n                             double *) red_arr_mem_233770)[sext_i32_i64(squot32(local_tid_233747,\n                                                                                32)) -\n                                                           (int64_t) 1];\n                x_216450 = ((__local\n                             double *) red_arr_mem_233772)[sext_i32_i64(squot32(local_tid_233747,\n                                                                                32)) -\n                                                           (int64_t) 1];\n     ",
            "       }\n        }\n        // perform operation\n        {\n            bool inactive_233803 = slt64(srem64(sext_i32_i64(local_tid_233747),\n                                                q_s_203493),\n                                         sext_i32_i64(local_tid_233747) -\n                                         sext_i32_i64(squot32(local_tid_233747,\n                                                              32) * 32 - 1));\n            \n            if (!no_carry_in_233802) {\n                if (inactive_233803) {\n                    x_216446 = x_216451;\n                    x_216447 = x_216452;\n                    x_216448 = x_216453;\n                    x_216449 = x_216454;\n                    x_216450 = x_216455;\n                }\n            }\n            if (!no_carry_in_233802) {\n                if (!inactive_233803) {\n                    double defunc_1_op_res_216456 = x_216446 + x_216451;\n                    double defunc_1_op_res_216457 = x_216447 + x_216452;\n                    double defunc_1_op_res_216458 = x_216448 + x_216453;\n                    double defunc_1_op_res_216459 = x_216449 + x_216454;\n                    double defunc_1_op_res_216460 = x_216450 + x_216455;\n                    \n                    x_216446 = defunc_1_op_res_216456;\n                    x_216447 = defunc_1_op_res_216457;\n                    x_216448 = defunc_1_op_res_216458;\n                    x_216449 = defunc_1_op_res_216459;\n                    x_216450 = defunc_1_op_res_216460;\n                }\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_233802) {\n                ((__local\n                  double *) red_arr_mem_233764)[sext_i32_i64(local_tid_233747)] =\n                    x_216446;\n                ((__local\n                  double *) red_arr_mem_233766)[sext_i32_i64(local_tid_233747)] =\n                    x_216447;\n                ((__local\n                  double *) red_arr_mem_233768)[sext_i32_i64(local_tid_233747)",
            "] =\n                    x_216448;\n                ((__local\n                  double *) red_arr_mem_233770)[sext_i32_i64(local_tid_233747)] =\n                    x_216449;\n                ((__local\n                  double *) red_arr_mem_233772)[sext_i32_i64(local_tid_233747)] =\n                    x_216450;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_233747, 32) == 0 && ltid_in_bounds_233795) {\n            ((__local\n              double *) red_arr_mem_233764)[sext_i32_i64(local_tid_233747)] =\n                x_216451;\n            ((__local\n              double *) red_arr_mem_233766)[sext_i32_i64(local_tid_233747)] =\n                x_216452;\n            ((__local\n              double *) red_arr_mem_233768)[sext_i32_i64(local_tid_233747)] =\n                x_216453;\n            ((__local\n              double *) red_arr_mem_233770)[sext_i32_i64(local_tid_233747)] =\n                x_216454;\n            ((__local\n              double *) red_arr_mem_233772)[sext_i32_i64(local_tid_233747)] =\n                x_216455;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233804 = 0; i_233804 < sdiv_up64(s_n_m_203636 -\n                                                    sext_i32_i64(local_tid_233747),\n                                                    computed_group_sizze_216248);\n         i_233804++) {\n        double tmp_233805;\n        \n        tmp_233805 = ((__local double *) red_arr_mem_233764)[q_s_203493 -\n                                                             (int64_t) 1 +\n                                                             (i_233804 *\n                                                              computed_group_sizze_216248 +\n                                                              sext_i32_i64(local_tid_233747)) *\n                                                             q_s_203493];\n        (",
            "(__local double *) color_232018)[i_233804 *\n                                          computed_group_sizze_216248 +\n                                          sext_i32_i64(local_tid_233747)] =\n            tmp_233805;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233806 = 0; i_233806 < sdiv_up64(s_n_m_203636 -\n                                                    sext_i32_i64(local_tid_233747),\n                                                    computed_group_sizze_216248);\n         i_233806++) {\n        double tmp_233807;\n        \n        tmp_233807 = ((__local double *) red_arr_mem_233766)[q_s_203493 -\n                                                             (int64_t) 1 +\n                                                             (i_233806 *\n                                                              computed_group_sizze_216248 +\n                                                              sext_i32_i64(local_tid_233747)) *\n                                                             q_s_203493];\n        ((__local double *) color_232017)[i_233806 *\n                                          computed_group_sizze_216248 +\n                                          sext_i32_i64(local_tid_233747)] =\n            tmp_233807;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233808 = 0; i_233808 < sdiv_up64(s_n_m_203636 -\n                                                    sext_i32_i64(local_tid_233747),\n                                                    computed_group_sizze_216248);\n         i_233808++) {\n        double tmp_233809;\n        \n        tmp_233809 = ((__local double *) red_arr_mem_233768)[q_s_203493 -\n                                                             (int64_t) 1 +\n                                                             (i_233808 *\n                                                              computed_group_sizze_216248 +\n                                                              sext_i32_i64(local_tid_233747)) *\n ",
            "                                                            q_s_203493];\n        ((__local double *) color_232016)[i_233808 *\n                                          computed_group_sizze_216248 +\n                                          sext_i32_i64(local_tid_233747)] =\n            tmp_233809;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233810 = 0; i_233810 < sdiv_up64(s_n_m_203636 -\n                                                    sext_i32_i64(local_tid_233747),\n                                                    computed_group_sizze_216248);\n         i_233810++) {\n        double tmp_233811;\n        \n        tmp_233811 = ((__local double *) red_arr_mem_233770)[q_s_203493 -\n                                                             (int64_t) 1 +\n                                                             (i_233810 *\n                                                              computed_group_sizze_216248 +\n                                                              sext_i32_i64(local_tid_233747)) *\n                                                             q_s_203493];\n        ((__local double *) color_232009)[i_233810 *\n                                          computed_group_sizze_216248 +\n                                          sext_i32_i64(local_tid_233747)] =\n            tmp_233811;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233812 = 0; i_233812 < sdiv_up64(s_n_m_203636 -\n                                                    sext_i32_i64(local_tid_233747),\n                                                    computed_group_sizze_216248);\n         i_233812++) {\n        double tmp_233813;\n        \n        tmp_233813 = ((__local double *) red_arr_mem_233772)[q_s_203493 -\n                                                             (int64_t) 1 +\n                                                             (i_233812 *\n                                                              computed_group_sizze_216248 +\n               ",
            "                                               sext_i32_i64(local_tid_233747)) *\n                                                             q_s_203493];\n        ((__local double *) color_232008)[i_233812 *\n                                          computed_group_sizze_216248 +\n                                          sext_i32_i64(local_tid_233747)] =\n            tmp_233813;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_216493 = sext_i32_i64(sext_i64_i32(ltid_pre_233751));\n    int32_t phys_tid_216494 = local_tid_233747;\n    \n    if (slt64(gtid_216493, s_n_m_203636)) {\n        bool index_primexp_228731 = gtid_216493 == (int64_t) 0;\n        double defunc_2_reduce_res_216497;\n        \n        defunc_2_reduce_res_216497 = ((__local\n                                       double *) color_232018)[gtid_216493];\n        \n        double defunc_2_reduce_res_216498;\n        \n        defunc_2_reduce_res_216498 = ((__local\n                                       double *) color_232017)[gtid_216493];\n        \n        double defunc_2_reduce_res_216499;\n        \n        defunc_2_reduce_res_216499 = ((__local\n                                       double *) color_232016)[gtid_216493];\n        \n        double defunc_2_reduce_res_216500;\n        \n        defunc_2_reduce_res_216500 = ((__local\n                                       double *) color_232009)[gtid_216493];\n        \n        double defunc_2_reduce_res_216501;\n        \n        defunc_2_reduce_res_216501 = ((__local\n                                       double *) color_232008)[gtid_216493];\n        \n        double x_216502 = defunc_2_reduce_res_216499 *\n               defunc_2_reduce_res_216501;\n        double y_216503 = defunc_2_reduce_res_216500 *\n               defunc_2_reduce_res_216500;\n        double a12_216504 = x_216502 - y_216503;\n        double x_216505 = defunc_2_reduce_res_216499 *\n               defunc_2_reduce_res_216500;\n        double y_216506 = defunc_2_reduce",
            "_res_216498 *\n               defunc_2_reduce_res_216501;\n        double b12_216507 = x_216505 - y_216506;\n        double x_216508 = defunc_2_reduce_res_216498 *\n               defunc_2_reduce_res_216500;\n        double y_216509 = defunc_2_reduce_res_216499 *\n               defunc_2_reduce_res_216499;\n        double c12_216510 = x_216508 - y_216509;\n        double x_216511 = defunc_2_reduce_res_216497 *\n               defunc_2_reduce_res_216501;\n        double b2_216512 = x_216511 - y_216509;\n        double x_216513 = defunc_2_reduce_res_216498 *\n               defunc_2_reduce_res_216499;\n        double y_216514 = defunc_2_reduce_res_216497 *\n               defunc_2_reduce_res_216500;\n        double c2_216515 = x_216513 - y_216514;\n        double x_216516 = defunc_2_reduce_res_216497 * a12_216504;\n        double y_216517 = defunc_2_reduce_res_216498 * b12_216507;\n        double x_216518 = x_216516 + y_216517;\n        double y_216519 = defunc_2_reduce_res_216499 * c12_216510;\n        double y_216520 = x_216518 + y_216519;\n        double det_216521 = 1.0 / y_216520;\n        double a12_216522 = a12_216504 * det_216521;\n        double b12_216523 = b12_216507 * det_216521;\n        double c12_216524 = c12_216510 * det_216521;\n        double b2_216525 = b2_216512 * det_216521;\n        double c2_216526 = c2_216515 * det_216521;\n        int64_t defunc_0_m_fun_res_216527;\n        \n        if (index_primexp_228731) {\n            defunc_0_m_fun_res_216527 = (int64_t) 0;\n        } else {\n            int64_t y_216528 = sub64(s_n_m_203636, (int64_t) 1);\n            bool cond_216529 = gtid_216493 == y_216528;\n            int64_t defunc_0_m_fun_res_f_res_216530;\n            \n            if (cond_216529) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_216531 =\n                        sub64(pad_css_len_203632, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_216530 =\n                    defunc_0_m_fun_res_f_res_t_res_216531;\n            } else {\n        ",
            "        int64_t x_216532 = sub64(gtid_216493, (int64_t) 1);\n                int64_t x_216533 = mul64(jump_s_203499, x_216532);\n                int64_t min_arg_216534 = add64((int64_t) 1, x_216533);\n                int64_t min_res_216535 = smin64(defunc_0_f_res_203631,\n                                                min_arg_216534);\n                \n                defunc_0_m_fun_res_f_res_216530 = min_res_216535;\n            }\n            defunc_0_m_fun_res_216527 = defunc_0_m_fun_res_f_res_216530;\n        }\n        ((__local double *) color_232015)[gtid_216493] = a12_216522;\n        ((__local double *) color_232014)[gtid_216493] = b12_216523;\n        ((__local double *) color_232013)[gtid_216493] = c12_216524;\n        ((__local double *) color_232012)[gtid_216493] = b2_216525;\n        ((__local double *) color_232011)[gtid_216493] = c2_216526;\n        ((__local int64_t *) color_232010)[gtid_216493] =\n            defunc_0_m_fun_res_216527;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_216538 = sext_i32_i64(sext_i64_i32(ltid_pre_233754));\n    int64_t gtid_216539 = sext_i32_i64(sext_i64_i32(ltid_pre_233755));\n    int32_t phys_tid_216540 = local_tid_233747;\n    __local unsigned char *red_arr_mem_233814;\n    \n    red_arr_mem_233814 = (__local\n                          unsigned char *) red_arr_mem_233814_backing_17;\n    \n    __local unsigned char *red_arr_mem_233816;\n    \n    red_arr_mem_233816 = (__local\n                          unsigned char *) red_arr_mem_233816_backing_18;\n    if (slt64(gtid_216538, s_n_m_203636) && slt64(gtid_216539, q_s_203493)) {\n        int64_t x_216547;\n        \n        x_216547 = ((__global int64_t *) ext_mem_229363)[gtid_216409 *\n                                                         (s_n_m_203636 *\n                                                          n_p_203492) +\n                                                         gtid_216410 *\n                                                         s_n_m_203636 +\n              ",
            "                                           gtid_216538];\n        \n        double x_216548;\n        \n        x_216548 = ((__global double *) ext_mem_229362)[gtid_216409 *\n                                                        (s_n_m_203636 *\n                                                         n_p_203492) +\n                                                        gtid_216410 *\n                                                        s_n_m_203636 +\n                                                        gtid_216538];\n        \n        double a12_216549;\n        \n        a12_216549 = ((__local double *) color_232015)[gtid_216538];\n        \n        double b12_216550;\n        \n        b12_216550 = ((__local double *) color_232014)[gtid_216538];\n        \n        double c12_216551;\n        \n        c12_216551 = ((__local double *) color_232013)[gtid_216538];\n        \n        double b2_216552;\n        \n        b2_216552 = ((__local double *) color_232012)[gtid_216538];\n        \n        double c2_216553;\n        \n        c2_216553 = ((__local double *) color_232011)[gtid_216538];\n        \n        int64_t defunc_0_m_fun_res_216554;\n        \n        defunc_0_m_fun_res_216554 = ((__local\n                                      int64_t *) color_232010)[gtid_216538];\n        \n        bool cond_216556 = sle64(x_216418, gtid_216539);\n        int64_t defunc_0_f_res_216557;\n        \n        if (cond_216556) {\n            defunc_0_f_res_216557 = (int64_t) 0;\n        } else {\n            int64_t i_216558 = add64(gtid_216539, x_216547);\n            int64_t defunc_0_add_arg_216559;\n            \n            defunc_0_add_arg_216559 = ((__global\n                                        int64_t *) ext_mem_229265)[gtid_216409 *\n                                                                   (defunc_0_f_res_203631 *\n                                                                    n_p_203492) +\n                                                                   gtid_216410 *\n               ",
            "                                                    defunc_0_f_res_203631 +\n                                                                   i_216558];\n            \n            int64_t defunc_1_add_res_216560 = add64((int64_t) 1,\n                                                    defunc_0_add_arg_216559);\n            \n            defunc_0_f_res_216557 = defunc_1_add_res_216560;\n        }\n        \n        double defunc_0_f_res_216561;\n        \n        if (cond_216556) {\n            defunc_0_f_res_216561 = 0.0;\n        } else {\n            int64_t i_216562 = add64(gtid_216539, x_216547);\n            double defunc_0_add_arg_216563;\n            \n            defunc_0_add_arg_216563 = ((__global\n                                        double *) mem_229531)[gtid_216409 *\n                                                              (defunc_0_f_res_203631 *\n                                                               n_p_203492) +\n                                                              gtid_216410 *\n                                                              defunc_0_f_res_203631 +\n                                                              i_216562];\n            defunc_0_f_res_216561 = defunc_0_add_arg_216563;\n        }\n        \n        int64_t binop_p_216564 = sub64(defunc_0_f_res_216557,\n                                       defunc_0_m_fun_res_216554);\n        double defunc_0_f_res_216565 = sitofp_i64_f64(binop_p_216564);\n        double abs_res_216566 = fabs(defunc_0_f_res_216565);\n        double tmp1_216567 = abs_res_216566 / x_216548;\n        double x_216568 = tmp1_216567 * tmp1_216567;\n        double y_216569 = tmp1_216567 * x_216568;\n        double tmp2_216570 = 1.0 - y_216569;\n        double x_216571 = tmp2_216570 * tmp2_216570;\n        double tmp3_216572 = tmp2_216570 * x_216571;\n        double tmp4_216573 = defunc_0_f_res_216561 * tmp3_216572;\n        double defunc_1_f_res_216574 = defunc_0_f_res_216565 * tmp4_216573;\n        double defunc_1_f_res_",
            "216575 = defunc_0_f_res_216565 *\n               defunc_1_f_res_216574;\n        double defunc_0_f_res_216576;\n        \n        if (cond_216556) {\n            defunc_0_f_res_216576 = 0.0;\n        } else {\n            int64_t i_216577 = add64(gtid_216539, x_216547);\n            double defunc_0_add_arg_216578;\n            \n            defunc_0_add_arg_216578 = ((__global\n                                        double *) mem_229526)[gtid_216409 *\n                                                              (defunc_0_f_res_203631 *\n                                                               n_p_203492) +\n                                                              gtid_216410 *\n                                                              defunc_0_f_res_203631 +\n                                                              i_216577];\n            defunc_0_f_res_216576 = defunc_0_add_arg_216578;\n        }\n        \n        double x_216579 = a12_216549 * tmp4_216573;\n        double y_216580 = b12_216550 * defunc_1_f_res_216574;\n        double x_216581 = x_216579 + y_216580;\n        double y_216582 = c12_216551 * defunc_1_f_res_216575;\n        double x_216583 = x_216581 + y_216582;\n        double defunc_9_fit_fun_res_216584 = defunc_0_f_res_216576 * x_216583;\n        double x_216585 = b12_216550 * tmp4_216573;\n        double y_216586 = b2_216552 * defunc_1_f_res_216574;\n        double x_216587 = x_216585 + y_216586;\n        double y_216588 = c2_216553 * defunc_1_f_res_216575;\n        double x_216589 = x_216587 + y_216588;\n        double defunc_9_slope_fun_res_216590 = defunc_0_f_res_216576 * x_216589;\n        \n        ((__local double *) red_arr_mem_233814)[gtid_216538 * q_s_203493 +\n                                                gtid_216539] =\n            defunc_9_fit_fun_res_216584;\n        ((__local double *) red_arr_mem_233816)[gtid_216538 * q_s_203493 +\n                                                gtid_216539] =\n            defunc_9_slope_fun_res_216590;\n    }\n  ",
            "  barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t dims_flat_233818 = s_n_m_203636 * q_s_203493;\n    double x_216541;\n    double x_216542;\n    double x_216543;\n    double x_216544;\n    double x_233821;\n    double x_233822;\n    double x_233823;\n    double x_233824;\n    bool ltid_in_bounds_233827 = slt64(sext_i32_i64(local_tid_233747),\n                                       s_n_m_203636 * q_s_203493);\n    int32_t skip_threads_233828;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_233827) {\n            x_216543 = ((volatile __local\n                         double *) red_arr_mem_233814)[sext_i32_i64(local_tid_233747)];\n            x_216544 = ((volatile __local\n                         double *) red_arr_mem_233816)[sext_i32_i64(local_tid_233747)];\n            if ((local_tid_233747 - squot32(local_tid_233747, 32) * 32) == 0) {\n                x_216541 = x_216543;\n                x_216542 = x_216544;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_233828 = 1;\n        while (slt32(skip_threads_233828, 32)) {\n            bool thread_active_233829 = sle32(skip_threads_233828,\n                                              local_tid_233747 -\n                                              squot32(local_tid_233747, 32) *\n                                              32) && ltid_in_bounds_233827;\n            \n            if (thread_active_233829) {\n                // read operands\n                {\n                    x_216541 = ((volatile __local\n                                 double *) red_arr_mem_233814)[sext_i32_i64(local_tid_233747) -\n                                                               sext_i32_i64(skip_threads_233828)];\n                    x_216542 = ((volatile __local\n                                 double *) red_arr_mem_233816)[sext_i32_i64(local_tid_233747) -\n                                                               sext_i32_i64(skip_threads_233828)];\n                }\n",
            "            }\n            // perform operation\n            {\n                bool inactive_233830 =\n                     slt64(srem64(sext_i32_i64(local_tid_233747), q_s_203493),\n                           sext_i32_i64(local_tid_233747) -\n                           sext_i32_i64(local_tid_233747 -\n                           skip_threads_233828));\n                \n                if (thread_active_233829 && inactive_233830) {\n                    x_216541 = x_216543;\n                    x_216542 = x_216544;\n                }\n                if (thread_active_233829) {\n                    if (!inactive_233830) {\n                        double defunc_1_op_res_216545 = x_216541 + x_216543;\n                        double defunc_1_op_res_216546 = x_216542 + x_216544;\n                        \n                        x_216541 = defunc_1_op_res_216545;\n                        x_216542 = defunc_1_op_res_216546;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_233749, skip_threads_233828)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (thread_active_233829) {\n                // write result\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_233814)[sext_i32_i64(local_tid_233747)] =\n                        x_216541;\n                    x_216543 = x_216541;\n                    ((volatile __local\n                      double *) red_arr_mem_233816)[sext_i32_i64(local_tid_233747)] =\n                        x_216542;\n                    x_216544 = x_216542;\n                }\n            }\n            if (sle32(wave_sizze_233749, skip_threads_233828)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_233828 *= 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_233747 - squot32(local_tid_233747, 32) * 32) == 31 &&\n            ltid_in_bounds",
            "_233827) {\n            ((volatile __local\n              double *) red_arr_mem_233814)[sext_i32_i64(squot32(local_tid_233747,\n                                                                 32))] =\n                x_216541;\n            ((volatile __local\n              double *) red_arr_mem_233816)[sext_i32_i64(squot32(local_tid_233747,\n                                                                 32))] =\n                x_216542;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n    {\n        int32_t skip_threads_233831;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_233747, 32) == 0 && ltid_in_bounds_233827) {\n                x_233823 = ((volatile __local\n                             double *) red_arr_mem_233814)[sext_i32_i64(local_tid_233747)];\n                x_233824 = ((volatile __local\n                             double *) red_arr_mem_233816)[sext_i32_i64(local_tid_233747)];\n                if ((local_tid_233747 - squot32(local_tid_233747, 32) * 32) ==\n                    0) {\n                    x_233821 = x_233823;\n                    x_233822 = x_233824;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_233831 = 1;\n            while (slt32(skip_threads_233831, 32)) {\n                bool thread_active_233832 = sle32(skip_threads_233831,\n                                                  local_tid_233747 -\n                                                  squot32(local_tid_233747,\n                                                          32) * 32) &&\n                     (squot32(local_tid_233747, 32) == 0 &&\n                      ltid_in_bounds_233827);\n                \n                if (thread_active_233832) {\n                    // read operands\n                    {\n                        x_233821 = ((volatile __local\n                   ",
            "                  double *) red_arr_mem_233814)[sext_i32_i64(local_tid_233747) -\n                                                                   sext_i32_i64(skip_threads_233831)];\n                        x_233822 = ((volatile __local\n                                     double *) red_arr_mem_233816)[sext_i32_i64(local_tid_233747) -\n                                                                   sext_i32_i64(skip_threads_233831)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_233833 =\n                         slt64(srem64(sext_i32_i64(local_tid_233747 * 32 + 32 -\n                                      1), q_s_203493),\n                               sext_i32_i64(local_tid_233747 * 32 + 32 - 1) -\n                               sext_i32_i64((local_tid_233747 -\n                                             skip_threads_233831) * 32 + 32 -\n                               1));\n                    \n                    if (thread_active_233832 && inactive_233833) {\n                        x_233821 = x_233823;\n                        x_233822 = x_233824;\n                    }\n                    if (thread_active_233832) {\n                        if (!inactive_233833) {\n                            double defunc_1_op_res_233825 = x_233821 + x_233823;\n                            double defunc_1_op_res_233826 = x_233822 + x_233824;\n                            \n                            x_233821 = defunc_1_op_res_233825;\n                            x_233822 = defunc_1_op_res_233826;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_233749, skip_threads_233831)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_233832) {\n                    // write result\n                    {\n                        ((volatile __local\n                          double *) red_arr_mem_233814)[sext_i32_i64(",
            "local_tid_233747)] =\n                            x_233821;\n                        x_233823 = x_233821;\n                        ((volatile __local\n                          double *) red_arr_mem_233816)[sext_i32_i64(local_tid_233747)] =\n                            x_233822;\n                        x_233824 = x_233822;\n                    }\n                }\n                if (sle32(wave_sizze_233749, skip_threads_233831)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_233831 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_233834 = squot32(local_tid_233747, 32) == 0 ||\n         !ltid_in_bounds_233827;\n    \n    // carry-in for every block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_233834) {\n                x_216543 = x_216541;\n                x_216544 = x_216542;\n                x_216541 = ((__local\n                             double *) red_arr_mem_233814)[sext_i32_i64(squot32(local_tid_233747,\n                                                                                32)) -\n                                                           (int64_t) 1];\n                x_216542 = ((__local\n                             double *) red_arr_mem_233816)[sext_i32_i64(squot32(local_tid_233747,\n                                                                                32)) -\n                                                           (int64_t) 1];\n            }\n        }\n        // perform operation\n        {\n            bool inactive_233835 = slt64(srem64(sext_i32_i64(local_tid_233747),\n                                                q_s_203493),\n                                         sext_i32_i64(local_tid_233747) -\n                                         sext_i32_i64(squot32(local_tid_233747,\n                                                              32) * 32 - 1));\n            \n            if (!no_carry_in_233834) {\n     ",
            "           if (inactive_233835) {\n                    x_216541 = x_216543;\n                    x_216542 = x_216544;\n                }\n            }\n            if (!no_carry_in_233834) {\n                if (!inactive_233835) {\n                    double defunc_1_op_res_216545 = x_216541 + x_216543;\n                    double defunc_1_op_res_216546 = x_216542 + x_216544;\n                    \n                    x_216541 = defunc_1_op_res_216545;\n                    x_216542 = defunc_1_op_res_216546;\n                }\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_233834) {\n                ((__local\n                  double *) red_arr_mem_233814)[sext_i32_i64(local_tid_233747)] =\n                    x_216541;\n                ((__local\n                  double *) red_arr_mem_233816)[sext_i32_i64(local_tid_233747)] =\n                    x_216542;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_233747, 32) == 0 && ltid_in_bounds_233827) {\n            ((__local\n              double *) red_arr_mem_233814)[sext_i32_i64(local_tid_233747)] =\n                x_216543;\n            ((__local\n              double *) red_arr_mem_233816)[sext_i32_i64(local_tid_233747)] =\n                x_216544;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233836 = 0; i_233836 < sdiv_up64(s_n_m_203636 -\n                                                    sext_i32_i64(local_tid_233747),\n                                                    computed_group_sizze_216248);\n         i_233836++) {\n        double tmp_233837;\n        \n        tmp_233837 = ((__local double *) red_arr_mem_233814)[q_s_203493 -\n                                                             (int64_t) 1 +\n                                                             (i_233836 *\n                                                          ",
            "    computed_group_sizze_216248 +\n                                                              sext_i32_i64(local_tid_233747)) *\n                                                             q_s_203493];\n        ((__local double *) color_232009)[i_233836 *\n                                          computed_group_sizze_216248 +\n                                          sext_i32_i64(local_tid_233747)] =\n            tmp_233837;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233838 = 0; i_233838 < sdiv_up64(s_n_m_203636 -\n                                                    sext_i32_i64(local_tid_233747),\n                                                    computed_group_sizze_216248);\n         i_233838++) {\n        double tmp_233839;\n        \n        tmp_233839 = ((__local double *) red_arr_mem_233816)[q_s_203493 -\n                                                             (int64_t) 1 +\n                                                             (i_233838 *\n                                                              computed_group_sizze_216248 +\n                                                              sext_i32_i64(local_tid_233747)) *\n                                                             q_s_203493];\n        ((__local double *) color_232008)[i_233838 *\n                                          computed_group_sizze_216248 +\n                                          sext_i32_i64(local_tid_233747)] =\n            tmp_233839;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233840 = 0; i_233840 < sdiv_up64(s_n_m_203636 -\n                                                    sext_i32_i64(local_tid_233747),\n                                                    computed_group_sizze_216248);\n         i_233840++) {\n        double tmp_233841;\n        \n        tmp_233841 = ((__local double *) color_232009)[i_233840 *\n                                                       computed_group_sizze_216248 +\n             ",
            "                                          sext_i32_i64(local_tid_233747)];\n        ((__global double *) mem_230290)[gtid_216409 * (s_n_m_203636 *\n                                                        n_p_203492) +\n                                         gtid_216410 * s_n_m_203636 +\n                                         (i_233840 *\n                                          computed_group_sizze_216248 +\n                                          sext_i32_i64(local_tid_233747))] =\n            tmp_233841;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233842 = 0; i_233842 < sdiv_up64(s_n_m_203636 -\n                                                    sext_i32_i64(local_tid_233747),\n                                                    computed_group_sizze_216248);\n         i_233842++) {\n        double tmp_233843;\n        \n        tmp_233843 = ((__local double *) color_232008)[i_233842 *\n                                                       computed_group_sizze_216248 +\n                                                       sext_i32_i64(local_tid_233747)];\n        ((__global double *) mem_230295)[gtid_216409 * (s_n_m_203636 *\n                                                        n_p_203492) +\n                                         gtid_216410 * s_n_m_203636 +\n                                         (i_233842 *\n                                          computed_group_sizze_216248 +\n                                          sext_i32_i64(local_tid_233747))] =\n            tmp_233843;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n  error_6:\n    return;\n}\n__kernel void mainzisegmap_intragroup_217183(__global int *global_failure,\n                                             uint red_arr_mem_234131_backing_offset_0,\n                                             uint red_arr_mem_234127_backing_offset_1,\n                                             uint color_232020_backing_offset_2,\n                                             int64_t n_p_203492,\n               ",
            "                              int64_t q_s_203493,\n                                             int64_t jump_s_203499,\n                                             int64_t partition_sizze_203577,\n                                             int64_t defunc_0_f_res_203631,\n                                             int64_t pad_css_len_203632,\n                                             int64_t s_n_m_203636, __global\n                                             unsigned char *ext_mem_229264,\n                                             __global\n                                             unsigned char *ext_mem_229265,\n                                             __global\n                                             unsigned char *ext_mem_229362,\n                                             __global\n                                             unsigned char *ext_mem_229363,\n                                             __global unsigned char *mem_229526,\n                                             __global unsigned char *mem_229531,\n                                             __global unsigned char *mem_230436)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_234131_backing_2 =\n                           &shared_mem[red_arr_mem_234131_backing_offset_0];\n    volatile unsigned char *red_arr_mem_234127_backing_1 =\n                           &shared_mem[red_arr_mem_234127_backing_offset_1];\n    volatile unsigned char *color_232020_backing_0 =\n                           &shared_mem[color_232020_backing_offset_2];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234113;\n    int32_t local_tid_234114;\n    int64_t group_sizze_234117;\n    int32_t wave_sizze_234116;\n    int32_t group_tid_234115;\n    \n    global_tid_234113 = get_global_id(0);\n    local_tid_234114 = get_local_id(0);\n    group_sizze_234117 = get_local_size(0);\n    wave_sizze_234116 = LOCKSTEP_WIDTH;\n  ",
            "  group_tid_234115 = get_group_id(0);\n    \n    int32_t phys_tid_217183 = group_tid_234115;\n    int64_t slice_234119 = q_s_203493;\n    int64_t ltid_pre_234118 = sext_i32_i64(local_tid_234114);\n    int64_t remnant_234120 = sext_i32_i64(local_tid_234114) - ltid_pre_234118;\n    int64_t slice_234121 = s_n_m_203636;\n    int64_t slice_234122 = n_p_203492 * slice_234121;\n    int64_t slice_234123 = partition_sizze_203577 * slice_234122;\n    int64_t gtid_217180 = squot64(sext_i32_i64(group_tid_234115), slice_234122);\n    int64_t remnant_234124 = sext_i32_i64(group_tid_234115) - gtid_217180 *\n            slice_234122;\n    int64_t gtid_217181 = squot64(remnant_234124, slice_234121);\n    int64_t remnant_234125 = remnant_234124 - gtid_217181 * slice_234121;\n    int64_t gtid_217182 = remnant_234125;\n    int64_t remnant_234126 = remnant_234125 - gtid_217182;\n    __local unsigned char *color_232020;\n    \n    color_232020 = (__local unsigned char *) color_232020_backing_0;\n    \n    int64_t x_217190;\n    \n    x_217190 = ((__global int64_t *) ext_mem_229264)[gtid_217180 * n_p_203492 +\n                                                     gtid_217181];\n    \n    int64_t x_217192;\n    \n    x_217192 = ((__global int64_t *) ext_mem_229363)[gtid_217180 *\n                                                     (s_n_m_203636 *\n                                                      n_p_203492) +\n                                                     gtid_217181 *\n                                                     s_n_m_203636 +\n                                                     gtid_217182];\n    \n    double x_217193;\n    \n    x_217193 = ((__global double *) ext_mem_229362)[gtid_217180 *\n                                                    (s_n_m_203636 *\n                                                     n_p_203492) + gtid_217181 *\n                                                    s_n_m_203636 + gtid_217182];\n    \n    bool cond_217194 = gtid_217182 == (int64_t) 0;\n    int64_t defunc_0_m_fun_res",
            "_217195;\n    \n    if (cond_217194) {\n        defunc_0_m_fun_res_217195 = (int64_t) 0;\n    } else {\n        int64_t y_217196 = sub64(s_n_m_203636, (int64_t) 1);\n        bool cond_217197 = gtid_217182 == y_217196;\n        int64_t defunc_0_m_fun_res_f_res_217198;\n        \n        if (cond_217197) {\n            int64_t defunc_0_m_fun_res_f_res_t_res_217199 =\n                    sub64(pad_css_len_203632, (int64_t) 1);\n            \n            defunc_0_m_fun_res_f_res_217198 =\n                defunc_0_m_fun_res_f_res_t_res_217199;\n        } else {\n            int64_t x_217200 = sub64(gtid_217182, (int64_t) 1);\n            int64_t x_217201 = mul64(jump_s_203499, x_217200);\n            int64_t min_arg_217202 = add64((int64_t) 1, x_217201);\n            int64_t min_res_217203 = smin64(defunc_0_f_res_203631,\n                                            min_arg_217202);\n            \n            defunc_0_m_fun_res_f_res_217198 = min_res_217203;\n        }\n        defunc_0_m_fun_res_217195 = defunc_0_m_fun_res_f_res_217198;\n    }\n    \n    double defunc_2_reduce_res_217204;\n    int64_t gtid_217206 = sext_i32_i64(sext_i64_i32(ltid_pre_234118));\n    int32_t phys_tid_217207 = local_tid_234114;\n    __local unsigned char *red_arr_mem_234127;\n    \n    red_arr_mem_234127 = (__local unsigned char *) red_arr_mem_234127_backing_1;\n    \n    bool cond_217212 = sle64(x_217190, gtid_217206);\n    int64_t defunc_0_f_res_217213;\n    \n    if (cond_217212) {\n        defunc_0_f_res_217213 = (int64_t) 0;\n    } else {\n        int64_t i_217214 = add64(x_217192, gtid_217206);\n        int64_t defunc_0_add_arg_217215;\n        \n        defunc_0_add_arg_217215 = ((__global\n                                    int64_t *) ext_mem_229265)[gtid_217180 *\n                                                               (defunc_0_f_res_203631 *\n                                                                n_p_203492) +\n                                                               gtid_217181 *\n                       ",
            "                                        defunc_0_f_res_203631 +\n                                                               i_217214];\n        \n        int64_t defunc_1_add_res_217216 = add64((int64_t) 1,\n                                                defunc_0_add_arg_217215);\n        \n        defunc_0_f_res_217213 = defunc_1_add_res_217216;\n    }\n    \n    double defunc_0_f_res_217217;\n    \n    if (cond_217212) {\n        defunc_0_f_res_217217 = 0.0;\n    } else {\n        int64_t i_217218 = add64(x_217192, gtid_217206);\n        double defunc_0_add_arg_217219;\n        \n        defunc_0_add_arg_217219 = ((__global double *) mem_229531)[gtid_217180 *\n                                                                   (defunc_0_f_res_203631 *\n                                                                    n_p_203492) +\n                                                                   gtid_217181 *\n                                                                   defunc_0_f_res_203631 +\n                                                                   i_217218];\n        defunc_0_f_res_217217 = defunc_0_add_arg_217219;\n    }\n    \n    int64_t binop_p_217220 = sub64(defunc_0_f_res_217213,\n                                   defunc_0_m_fun_res_217195);\n    double defunc_0_f_res_217221 = sitofp_i64_f64(binop_p_217220);\n    double abs_res_217222 = fabs(defunc_0_f_res_217221);\n    double tmp1_217223 = abs_res_217222 / x_217193;\n    double x_217224 = tmp1_217223 * tmp1_217223;\n    double y_217225 = tmp1_217223 * x_217224;\n    double tmp2_217226 = 1.0 - y_217225;\n    double x_217227 = tmp2_217226 * tmp2_217226;\n    double tmp3_217228 = tmp2_217226 * x_217227;\n    double tmp4_217229 = defunc_0_f_res_217217 * tmp3_217228;\n    \n    ((__local double *) red_arr_mem_234127)[gtid_217206] = tmp4_217229;\n    ((__local double *) color_232020)[gtid_217206] = tmp4_217229;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_234129;\n    int32_t skip_waves_234130 = 1;\n    double x_",
            "217208;\n    double x_217209;\n    \n    offset_234129 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_234114, sext_i64_i32(q_s_203493))) {\n            x_217208 = ((__local\n                         double *) red_arr_mem_234127)[sext_i32_i64(local_tid_234114 +\n                                                       offset_234129)];\n        }\n    }\n    offset_234129 = 1;\n    while (slt32(offset_234129, wave_sizze_234116)) {\n        if (slt32(local_tid_234114 + offset_234129, sext_i64_i32(q_s_203493)) &&\n            ((local_tid_234114 - squot32(local_tid_234114, wave_sizze_234116) *\n              wave_sizze_234116) & (2 * offset_234129 - 1)) == 0) {\n            // read array element\n            {\n                x_217209 = ((volatile __local\n                             double *) red_arr_mem_234127)[sext_i32_i64(local_tid_234114 +\n                                                           offset_234129)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_217210 = x_217208 + x_217209;\n                \n                x_217208 = defunc_1_op_res_217210;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_234127)[sext_i32_i64(local_tid_234114)] =\n                    x_217208;\n            }\n        }\n        offset_234129 *= 2;\n    }\n    while (slt32(skip_waves_234130, squot32(sext_i64_i32(q_s_203493) +\n                                            wave_sizze_234116 - 1,\n                                            wave_sizze_234116))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_234129 = skip_waves_234130 * wave_sizze_234116;\n        if (slt32(local_tid_234114 + offset_234129, sext_i64_i32(q_s_203493)) &&\n            ((local_tid_234114 - squot32(local_tid_234114, wave_sizze_234116) *\n              wave_sizze_234116) == 0 && (squot32(local_tid_234114,\n                            ",
            "                      wave_sizze_234116) & (2 *\n                                                                        skip_waves_234130 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_217209 = ((__local\n                             double *) red_arr_mem_234127)[sext_i32_i64(local_tid_234114 +\n                                                           offset_234129)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_217210 = x_217208 + x_217209;\n                \n                x_217208 = defunc_1_op_res_217210;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_234127)[sext_i32_i64(local_tid_234114)] =\n                    x_217208;\n            }\n        }\n        skip_waves_234130 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_217204 = ((__local\n                                   double *) red_arr_mem_234127)[(int64_t) 0];\n    \n    double a0_217230 = 1.0 / defunc_2_reduce_res_217204;\n    double defunc_2_reduce_res_217231;\n    int64_t gtid_217232 = sext_i32_i64(sext_i64_i32(ltid_pre_234118));\n    int32_t phys_tid_217233 = local_tid_234114;\n    __local unsigned char *red_arr_mem_234131;\n    \n    red_arr_mem_234131 = (__local unsigned char *) red_arr_mem_234131_backing_2;\n    \n    double x_217238;\n    \n    x_217238 = ((__local double *) color_232020)[gtid_217232];\n    \n    bool cond_217239 = sle64(x_217190, gtid_217232);\n    double defunc_0_f_res_217240;\n    \n    if (cond_217239) {\n        defunc_0_f_res_217240 = 0.0;\n    } else {\n        int64_t i_217241 = add64(x_217192, gtid_217232);\n        double defunc_0_add_arg_217242;\n        \n        defunc_0_add_arg_217242 = ((__global double *) mem_229526)[gtid_217180 *\n                                                                   (defunc_",
            "0_f_res_203631 *\n                                                                    n_p_203492) +\n                                                                   gtid_217181 *\n                                                                   defunc_0_f_res_203631 +\n                                                                   i_217241];\n        defunc_0_f_res_217240 = defunc_0_add_arg_217242;\n    }\n    \n    double x_217243 = a0_217230 * x_217238;\n    double defunc_9_fit_fun_res_217244 = defunc_0_f_res_217240 * x_217243;\n    \n    ((__local double *) red_arr_mem_234131)[gtid_217232] =\n        defunc_9_fit_fun_res_217244;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_234133;\n    int32_t skip_waves_234134 = 1;\n    double x_217234;\n    double x_217235;\n    \n    offset_234133 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_234114, sext_i64_i32(q_s_203493))) {\n            x_217234 = ((__local\n                         double *) red_arr_mem_234131)[sext_i32_i64(local_tid_234114 +\n                                                       offset_234133)];\n        }\n    }\n    offset_234133 = 1;\n    while (slt32(offset_234133, wave_sizze_234116)) {\n        if (slt32(local_tid_234114 + offset_234133, sext_i64_i32(q_s_203493)) &&\n            ((local_tid_234114 - squot32(local_tid_234114, wave_sizze_234116) *\n              wave_sizze_234116) & (2 * offset_234133 - 1)) == 0) {\n            // read array element\n            {\n                x_217235 = ((volatile __local\n                             double *) red_arr_mem_234131)[sext_i32_i64(local_tid_234114 +\n                                                           offset_234133)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_217236 = x_217234 + x_217235;\n                \n                x_217234 = defunc_1_op_res_217236;\n            }\n            // write result of operation\n            {\n                (",
            "(volatile __local\n                  double *) red_arr_mem_234131)[sext_i32_i64(local_tid_234114)] =\n                    x_217234;\n            }\n        }\n        offset_234133 *= 2;\n    }\n    while (slt32(skip_waves_234134, squot32(sext_i64_i32(q_s_203493) +\n                                            wave_sizze_234116 - 1,\n                                            wave_sizze_234116))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_234133 = skip_waves_234134 * wave_sizze_234116;\n        if (slt32(local_tid_234114 + offset_234133, sext_i64_i32(q_s_203493)) &&\n            ((local_tid_234114 - squot32(local_tid_234114, wave_sizze_234116) *\n              wave_sizze_234116) == 0 && (squot32(local_tid_234114,\n                                                  wave_sizze_234116) & (2 *\n                                                                        skip_waves_234134 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_217235 = ((__local\n                             double *) red_arr_mem_234131)[sext_i32_i64(local_tid_234114 +\n                                                           offset_234133)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_217236 = x_217234 + x_217235;\n                \n                x_217234 = defunc_1_op_res_217236;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_234131)[sext_i32_i64(local_tid_234114)] =\n                    x_217234;\n            }\n        }\n        skip_waves_234134 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_217231 = ((__local\n                                   double *) red_arr_mem_234131)[(int64_t) 0];\n    if (local_tid_234114 == 0) {\n        ((__global double *) mem_230436)[gtid_217180 * (s_n_m_203636 *\n                        ",
            "                                n_p_203492) +\n                                         gtid_217181 * s_n_m_203636 +\n                                         gtid_217182] =\n            defunc_2_reduce_res_217231;\n    }\n    \n  error_4:\n    return;\n}\n__kernel void mainzisegmap_intragroup_217504(__global int *global_failure,\n                                             uint red_arr_mem_234159_backing_offset_0,\n                                             uint red_arr_mem_234157_backing_offset_1,\n                                             uint red_arr_mem_234153_backing_offset_2,\n                                             uint red_arr_mem_234151_backing_offset_3,\n                                             uint red_arr_mem_234149_backing_offset_4,\n                                             uint color_232022_backing_offset_5,\n                                             uint color_232021_backing_offset_6,\n                                             int64_t n_p_203492,\n                                             int64_t q_s_203493,\n                                             int64_t jump_s_203499,\n                                             int64_t partition_sizze_203577,\n                                             int64_t defunc_0_f_res_203631,\n                                             int64_t pad_css_len_203632,\n                                             int64_t s_n_m_203636, __global\n                                             unsigned char *ext_mem_229264,\n                                             __global\n                                             unsigned char *ext_mem_229265,\n                                             __global\n                                             unsigned char *ext_mem_229362,\n                                             __global\n                                             unsigned char *ext_mem_229363,\n                                             __global unsigned char *mem_229526,\n                                 ",
            "            __global unsigned char *mem_229531,\n                                             __global unsigned char *mem_230450,\n                                             __global unsigned char *mem_230455)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_234159_backing_6 =\n                           &shared_mem[red_arr_mem_234159_backing_offset_0];\n    volatile unsigned char *red_arr_mem_234157_backing_5 =\n                           &shared_mem[red_arr_mem_234157_backing_offset_1];\n    volatile unsigned char *red_arr_mem_234153_backing_4 =\n                           &shared_mem[red_arr_mem_234153_backing_offset_2];\n    volatile unsigned char *red_arr_mem_234151_backing_3 =\n                           &shared_mem[red_arr_mem_234151_backing_offset_3];\n    volatile unsigned char *red_arr_mem_234149_backing_2 =\n                           &shared_mem[red_arr_mem_234149_backing_offset_4];\n    volatile unsigned char *color_232022_backing_1 =\n                           &shared_mem[color_232022_backing_offset_5];\n    volatile unsigned char *color_232021_backing_0 =\n                           &shared_mem[color_232021_backing_offset_6];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234135;\n    int32_t local_tid_234136;\n    int64_t group_sizze_234139;\n    int32_t wave_sizze_234138;\n    int32_t group_tid_234137;\n    \n    global_tid_234135 = get_global_id(0);\n    local_tid_234136 = get_local_id(0);\n    group_sizze_234139 = get_local_size(0);\n    wave_sizze_234138 = LOCKSTEP_WIDTH;\n    group_tid_234137 = get_group_id(0);\n    \n    int32_t phys_tid_217504 = group_tid_234137;\n    int64_t slice_234141 = q_s_203493;\n    int64_t ltid_pre_234140 = sext_i32_i64(local_tid_234136);\n    int64_t remnant_234142 = sext_i32_i64(local_tid_234136) - ltid_pre_234140;\n    int64_t slice_234143 = s_n_m_203636;\n    int64_t slice_234144 = n_p_203492 * slice_234143;\n    int64_t slice_234",
            "145 = partition_sizze_203577 * slice_234144;\n    int64_t gtid_217501 = squot64(sext_i32_i64(group_tid_234137), slice_234144);\n    int64_t remnant_234146 = sext_i32_i64(group_tid_234137) - gtid_217501 *\n            slice_234144;\n    int64_t gtid_217502 = squot64(remnant_234146, slice_234143);\n    int64_t remnant_234147 = remnant_234146 - gtid_217502 * slice_234143;\n    int64_t gtid_217503 = remnant_234147;\n    int64_t remnant_234148 = remnant_234147 - gtid_217503;\n    __local unsigned char *color_232021;\n    \n    color_232021 = (__local unsigned char *) color_232021_backing_0;\n    \n    __local unsigned char *color_232022;\n    \n    color_232022 = (__local unsigned char *) color_232022_backing_1;\n    \n    int64_t x_217511;\n    \n    x_217511 = ((__global int64_t *) ext_mem_229264)[gtid_217501 * n_p_203492 +\n                                                     gtid_217502];\n    \n    int64_t x_217513;\n    \n    x_217513 = ((__global int64_t *) ext_mem_229363)[gtid_217501 *\n                                                     (s_n_m_203636 *\n                                                      n_p_203492) +\n                                                     gtid_217502 *\n                                                     s_n_m_203636 +\n                                                     gtid_217503];\n    \n    double x_217514;\n    \n    x_217514 = ((__global double *) ext_mem_229362)[gtid_217501 *\n                                                    (s_n_m_203636 *\n                                                     n_p_203492) + gtid_217502 *\n                                                    s_n_m_203636 + gtid_217503];\n    \n    bool cond_217515 = gtid_217503 == (int64_t) 0;\n    int64_t defunc_0_m_fun_res_217516;\n    \n    if (cond_217515) {\n        defunc_0_m_fun_res_217516 = (int64_t) 0;\n    } else {\n        int64_t y_217517 = sub64(s_n_m_203636, (int64_t) 1);\n        bool cond_217518 = gtid_217503 == y_217517;\n        int64_t defunc_0_m_fun_res_f_res_217519;\n      ",
            "  \n        if (cond_217518) {\n            int64_t defunc_0_m_fun_res_f_res_t_res_217520 =\n                    sub64(pad_css_len_203632, (int64_t) 1);\n            \n            defunc_0_m_fun_res_f_res_217519 =\n                defunc_0_m_fun_res_f_res_t_res_217520;\n        } else {\n            int64_t x_217521 = sub64(gtid_217503, (int64_t) 1);\n            int64_t x_217522 = mul64(jump_s_203499, x_217521);\n            int64_t min_arg_217523 = add64((int64_t) 1, x_217522);\n            int64_t min_res_217524 = smin64(defunc_0_f_res_203631,\n                                            min_arg_217523);\n            \n            defunc_0_m_fun_res_f_res_217519 = min_res_217524;\n        }\n        defunc_0_m_fun_res_217516 = defunc_0_m_fun_res_f_res_217519;\n    }\n    \n    double defunc_2_reduce_res_217525;\n    double defunc_2_reduce_res_217526;\n    double defunc_2_reduce_res_217527;\n    int64_t gtid_217530 = sext_i32_i64(sext_i64_i32(ltid_pre_234140));\n    int32_t phys_tid_217531 = local_tid_234136;\n    __local unsigned char *red_arr_mem_234149;\n    \n    red_arr_mem_234149 = (__local unsigned char *) red_arr_mem_234149_backing_2;\n    \n    __local unsigned char *red_arr_mem_234151;\n    \n    red_arr_mem_234151 = (__local unsigned char *) red_arr_mem_234151_backing_3;\n    \n    __local unsigned char *red_arr_mem_234153;\n    \n    red_arr_mem_234153 = (__local unsigned char *) red_arr_mem_234153_backing_4;\n    \n    bool cond_217542 = sle64(x_217511, gtid_217530);\n    int64_t defunc_0_f_res_217543;\n    \n    if (cond_217542) {\n        defunc_0_f_res_217543 = (int64_t) 0;\n    } else {\n        int64_t i_217544 = add64(x_217513, gtid_217530);\n        int64_t defunc_0_add_arg_217545;\n        \n        defunc_0_add_arg_217545 = ((__global\n                                    int64_t *) ext_mem_229265)[gtid_217501 *\n                                                               (defunc_0_f_res_203631 *\n                                                                n_p_203492) +\n             ",
            "                                                  gtid_217502 *\n                                                               defunc_0_f_res_203631 +\n                                                               i_217544];\n        \n        int64_t defunc_1_add_res_217546 = add64((int64_t) 1,\n                                                defunc_0_add_arg_217545);\n        \n        defunc_0_f_res_217543 = defunc_1_add_res_217546;\n    }\n    \n    double defunc_0_f_res_217547;\n    \n    if (cond_217542) {\n        defunc_0_f_res_217547 = 0.0;\n    } else {\n        int64_t i_217548 = add64(x_217513, gtid_217530);\n        double defunc_0_add_arg_217549;\n        \n        defunc_0_add_arg_217549 = ((__global double *) mem_229531)[gtid_217501 *\n                                                                   (defunc_0_f_res_203631 *\n                                                                    n_p_203492) +\n                                                                   gtid_217502 *\n                                                                   defunc_0_f_res_203631 +\n                                                                   i_217548];\n        defunc_0_f_res_217547 = defunc_0_add_arg_217549;\n    }\n    \n    int64_t binop_p_217550 = sub64(defunc_0_f_res_217543,\n                                   defunc_0_m_fun_res_217516);\n    double defunc_0_f_res_217551 = sitofp_i64_f64(binop_p_217550);\n    double abs_res_217552 = fabs(defunc_0_f_res_217551);\n    double tmp1_217553 = abs_res_217552 / x_217514;\n    double x_217554 = tmp1_217553 * tmp1_217553;\n    double y_217555 = tmp1_217553 * x_217554;\n    double tmp2_217556 = 1.0 - y_217555;\n    double x_217557 = tmp2_217556 * tmp2_217556;\n    double tmp3_217558 = tmp2_217556 * x_217557;\n    double tmp4_217559 = defunc_0_f_res_217547 * tmp3_217558;\n    double defunc_1_f_res_217560 = defunc_0_f_res_217551 * tmp4_217559;\n    double defunc_1_f_res_217561 = defunc_0_f_res_217551 *\n           defunc_1_f_res_217560;\n    \n",
            "    ((__local double *) red_arr_mem_234149)[gtid_217530] = tmp4_217559;\n    ((__local double *) red_arr_mem_234151)[gtid_217530] =\n        defunc_1_f_res_217560;\n    ((__local double *) red_arr_mem_234153)[gtid_217530] =\n        defunc_1_f_res_217561;\n    ((__local double *) color_232022)[gtid_217530] = defunc_1_f_res_217560;\n    ((__local double *) color_232021)[gtid_217530] = tmp4_217559;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_234155;\n    int32_t skip_waves_234156 = 1;\n    double x_217532;\n    double x_217533;\n    double x_217534;\n    double x_217535;\n    double x_217536;\n    double x_217537;\n    \n    offset_234155 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_234136, sext_i64_i32(q_s_203493))) {\n            x_217532 = ((__local\n                         double *) red_arr_mem_234149)[sext_i32_i64(local_tid_234136 +\n                                                       offset_234155)];\n            x_217533 = ((__local\n                         double *) red_arr_mem_234151)[sext_i32_i64(local_tid_234136 +\n                                                       offset_234155)];\n            x_217534 = ((__local\n                         double *) red_arr_mem_234153)[sext_i32_i64(local_tid_234136 +\n                                                       offset_234155)];\n        }\n    }\n    offset_234155 = 1;\n    while (slt32(offset_234155, wave_sizze_234138)) {\n        if (slt32(local_tid_234136 + offset_234155, sext_i64_i32(q_s_203493)) &&\n            ((local_tid_234136 - squot32(local_tid_234136, wave_sizze_234138) *\n              wave_sizze_234138) & (2 * offset_234155 - 1)) == 0) {\n            // read array element\n            {\n                x_217535 = ((volatile __local\n                             double *) red_arr_mem_234149)[sext_i32_i64(local_tid_234136 +\n                                                           offset_234155)];\n                x_217536 = ((volatile __local\n                     ",
            "        double *) red_arr_mem_234151)[sext_i32_i64(local_tid_234136 +\n                                                           offset_234155)];\n                x_217537 = ((volatile __local\n                             double *) red_arr_mem_234153)[sext_i32_i64(local_tid_234136 +\n                                                           offset_234155)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_217538 = x_217532 + x_217535;\n                double defunc_1_op_res_217539 = x_217533 + x_217536;\n                double defunc_1_op_res_217540 = x_217534 + x_217537;\n                \n                x_217532 = defunc_1_op_res_217538;\n                x_217533 = defunc_1_op_res_217539;\n                x_217534 = defunc_1_op_res_217540;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_234149)[sext_i32_i64(local_tid_234136)] =\n                    x_217532;\n                ((volatile __local\n                  double *) red_arr_mem_234151)[sext_i32_i64(local_tid_234136)] =\n                    x_217533;\n                ((volatile __local\n                  double *) red_arr_mem_234153)[sext_i32_i64(local_tid_234136)] =\n                    x_217534;\n            }\n        }\n        offset_234155 *= 2;\n    }\n    while (slt32(skip_waves_234156, squot32(sext_i64_i32(q_s_203493) +\n                                            wave_sizze_234138 - 1,\n                                            wave_sizze_234138))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_234155 = skip_waves_234156 * wave_sizze_234138;\n        if (slt32(local_tid_234136 + offset_234155, sext_i64_i32(q_s_203493)) &&\n            ((local_tid_234136 - squot32(local_tid_234136, wave_sizze_234138) *\n              wave_sizze_234138) == 0 && (squot32(local_tid_234136,\n                                                  wave_sizze_234138) & (2 *\n                ",
            "                                                        skip_waves_234156 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_217535 = ((__local\n                             double *) red_arr_mem_234149)[sext_i32_i64(local_tid_234136 +\n                                                           offset_234155)];\n                x_217536 = ((__local\n                             double *) red_arr_mem_234151)[sext_i32_i64(local_tid_234136 +\n                                                           offset_234155)];\n                x_217537 = ((__local\n                             double *) red_arr_mem_234153)[sext_i32_i64(local_tid_234136 +\n                                                           offset_234155)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_217538 = x_217532 + x_217535;\n                double defunc_1_op_res_217539 = x_217533 + x_217536;\n                double defunc_1_op_res_217540 = x_217534 + x_217537;\n                \n                x_217532 = defunc_1_op_res_217538;\n                x_217533 = defunc_1_op_res_217539;\n                x_217534 = defunc_1_op_res_217540;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_234149)[sext_i32_i64(local_tid_234136)] =\n                    x_217532;\n                ((__local\n                  double *) red_arr_mem_234151)[sext_i32_i64(local_tid_234136)] =\n                    x_217533;\n                ((__local\n                  double *) red_arr_mem_234153)[sext_i32_i64(local_tid_234136)] =\n                    x_217534;\n            }\n        }\n        skip_waves_234156 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_217525 = ((__local\n                                   double *) red_arr_mem_234149)[(int64_t) 0];\n    defunc_2_reduce",
            "_res_217526 = ((__local\n                                   double *) red_arr_mem_234151)[(int64_t) 0];\n    defunc_2_reduce_res_217527 = ((__local\n                                   double *) red_arr_mem_234153)[(int64_t) 0];\n    \n    double x_217562 = defunc_2_reduce_res_217525 * defunc_2_reduce_res_217527;\n    double y_217563 = defunc_2_reduce_res_217526 * defunc_2_reduce_res_217526;\n    double y_217564 = x_217562 - y_217563;\n    double det1_217565 = 1.0 / y_217564;\n    double a11_217566 = defunc_2_reduce_res_217527 * det1_217565;\n    double x_217567 = 0.0 - defunc_2_reduce_res_217526;\n    double b11_217568 = det1_217565 * x_217567;\n    double c11_217569 = defunc_2_reduce_res_217525 * det1_217565;\n    double defunc_2_reduce_res_217570;\n    double defunc_2_reduce_res_217571;\n    int64_t gtid_217572 = sext_i32_i64(sext_i64_i32(ltid_pre_234140));\n    int32_t phys_tid_217573 = local_tid_234136;\n    __local unsigned char *red_arr_mem_234157;\n    \n    red_arr_mem_234157 = (__local unsigned char *) red_arr_mem_234157_backing_5;\n    \n    __local unsigned char *red_arr_mem_234159;\n    \n    red_arr_mem_234159 = (__local unsigned char *) red_arr_mem_234159_backing_6;\n    \n    double x_217581;\n    \n    x_217581 = ((__local double *) color_232021)[gtid_217572];\n    \n    double x_217582;\n    \n    x_217582 = ((__local double *) color_232022)[gtid_217572];\n    \n    bool cond_217583 = sle64(x_217511, gtid_217572);\n    double defunc_0_f_res_217584;\n    \n    if (cond_217583) {\n        defunc_0_f_res_217584 = 0.0;\n    } else {\n        int64_t i_217585 = add64(x_217513, gtid_217572);\n        double defunc_0_add_arg_217586;\n        \n        defunc_0_add_arg_217586 = ((__global double *) mem_229526)[gtid_217501 *\n                                                                   (defunc_0_f_res_203631 *\n                                                                    n_p_203492) +\n                                                                   gtid_217502 *\n                        ",
            "                                           defunc_0_f_res_203631 +\n                                                                   i_217585];\n        defunc_0_f_res_217584 = defunc_0_add_arg_217586;\n    }\n    \n    double x_217587 = a11_217566 * x_217581;\n    double y_217588 = b11_217568 * x_217582;\n    double x_217589 = x_217587 + y_217588;\n    double defunc_9_fit_fun_res_217590 = defunc_0_f_res_217584 * x_217589;\n    double x_217591 = b11_217568 * x_217581;\n    double y_217592 = c11_217569 * x_217582;\n    double x_217593 = x_217591 + y_217592;\n    double defunc_9_slope_fun_res_217594 = defunc_0_f_res_217584 * x_217593;\n    \n    ((__local double *) red_arr_mem_234157)[gtid_217572] =\n        defunc_9_fit_fun_res_217590;\n    ((__local double *) red_arr_mem_234159)[gtid_217572] =\n        defunc_9_slope_fun_res_217594;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_234161;\n    int32_t skip_waves_234162 = 1;\n    double x_217574;\n    double x_217575;\n    double x_217576;\n    double x_217577;\n    \n    offset_234161 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_234136, sext_i64_i32(q_s_203493))) {\n            x_217574 = ((__local\n                         double *) red_arr_mem_234157)[sext_i32_i64(local_tid_234136 +\n                                                       offset_234161)];\n            x_217575 = ((__local\n                         double *) red_arr_mem_234159)[sext_i32_i64(local_tid_234136 +\n                                                       offset_234161)];\n        }\n    }\n    offset_234161 = 1;\n    while (slt32(offset_234161, wave_sizze_234138)) {\n        if (slt32(local_tid_234136 + offset_234161, sext_i64_i32(q_s_203493)) &&\n            ((local_tid_234136 - squot32(local_tid_234136, wave_sizze_234138) *\n              wave_sizze_234138) & (2 * offset_234161 - 1)) == 0) {\n            // read array element\n            {\n                x_217576 = ((volatile __local\n                             dou",
            "ble *) red_arr_mem_234157)[sext_i32_i64(local_tid_234136 +\n                                                           offset_234161)];\n                x_217577 = ((volatile __local\n                             double *) red_arr_mem_234159)[sext_i32_i64(local_tid_234136 +\n                                                           offset_234161)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_217578 = x_217574 + x_217576;\n                double defunc_1_op_res_217579 = x_217575 + x_217577;\n                \n                x_217574 = defunc_1_op_res_217578;\n                x_217575 = defunc_1_op_res_217579;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_234157)[sext_i32_i64(local_tid_234136)] =\n                    x_217574;\n                ((volatile __local\n                  double *) red_arr_mem_234159)[sext_i32_i64(local_tid_234136)] =\n                    x_217575;\n            }\n        }\n        offset_234161 *= 2;\n    }\n    while (slt32(skip_waves_234162, squot32(sext_i64_i32(q_s_203493) +\n                                            wave_sizze_234138 - 1,\n                                            wave_sizze_234138))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_234161 = skip_waves_234162 * wave_sizze_234138;\n        if (slt32(local_tid_234136 + offset_234161, sext_i64_i32(q_s_203493)) &&\n            ((local_tid_234136 - squot32(local_tid_234136, wave_sizze_234138) *\n              wave_sizze_234138) == 0 && (squot32(local_tid_234136,\n                                                  wave_sizze_234138) & (2 *\n                                                                        skip_waves_234162 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_217576 = ((__local\n                   ",
            "          double *) red_arr_mem_234157)[sext_i32_i64(local_tid_234136 +\n                                                           offset_234161)];\n                x_217577 = ((__local\n                             double *) red_arr_mem_234159)[sext_i32_i64(local_tid_234136 +\n                                                           offset_234161)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_217578 = x_217574 + x_217576;\n                double defunc_1_op_res_217579 = x_217575 + x_217577;\n                \n                x_217574 = defunc_1_op_res_217578;\n                x_217575 = defunc_1_op_res_217579;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_234157)[sext_i32_i64(local_tid_234136)] =\n                    x_217574;\n                ((__local\n                  double *) red_arr_mem_234159)[sext_i32_i64(local_tid_234136)] =\n                    x_217575;\n            }\n        }\n        skip_waves_234162 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_217570 = ((__local\n                                   double *) red_arr_mem_234157)[(int64_t) 0];\n    defunc_2_reduce_res_217571 = ((__local\n                                   double *) red_arr_mem_234159)[(int64_t) 0];\n    if (local_tid_234136 == 0) {\n        ((__global double *) mem_230450)[gtid_217501 * (s_n_m_203636 *\n                                                        n_p_203492) +\n                                         gtid_217502 * s_n_m_203636 +\n                                         gtid_217503] =\n            defunc_2_reduce_res_217570;\n    }\n    if (local_tid_234136 == 0) {\n        ((__global double *) mem_230455)[gtid_217501 * (s_n_m_203636 *\n                                                        n_p_203492) +\n                                         gtid_217502 * s_n_m_203636 +\n                                         gtid_2",
            "17503] =\n            defunc_2_reduce_res_217571;\n    }\n    \n  error_4:\n    return;\n}\n__kernel void mainzisegmap_intragroup_217955(__global int *global_failure,\n                                             uint red_arr_mem_234191_backing_offset_0,\n                                             uint red_arr_mem_234189_backing_offset_1,\n                                             uint red_arr_mem_234185_backing_offset_2,\n                                             uint red_arr_mem_234183_backing_offset_3,\n                                             uint red_arr_mem_234181_backing_offset_4,\n                                             uint red_arr_mem_234179_backing_offset_5,\n                                             uint red_arr_mem_234177_backing_offset_6,\n                                             uint color_232026_backing_offset_7,\n                                             uint color_232025_backing_offset_8,\n                                             uint color_232024_backing_offset_9,\n                                             uint color_232023_backing_offset_10,\n                                             int64_t n_p_203492,\n                                             int64_t q_s_203493,\n                                             int64_t jump_s_203499,\n                                             int64_t partition_sizze_203577,\n                                             int64_t defunc_0_f_res_203631,\n                                             int64_t pad_css_len_203632,\n                                             int64_t s_n_m_203636, __global\n                                             unsigned char *ext_mem_229264,\n                                             __global\n                                             unsigned char *ext_mem_229265,\n                                             __global\n                                             unsigned char *ext_mem_229362,\n                                             __global\n                ",
            "                             unsigned char *ext_mem_229363,\n                                             __global unsigned char *mem_229526,\n                                             __global unsigned char *mem_229531,\n                                             __global unsigned char *mem_230476,\n                                             __global unsigned char *mem_230481)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_234191_backing_10 =\n                           &shared_mem[red_arr_mem_234191_backing_offset_0];\n    volatile unsigned char *red_arr_mem_234189_backing_9 =\n                           &shared_mem[red_arr_mem_234189_backing_offset_1];\n    volatile unsigned char *red_arr_mem_234185_backing_8 =\n                           &shared_mem[red_arr_mem_234185_backing_offset_2];\n    volatile unsigned char *red_arr_mem_234183_backing_7 =\n                           &shared_mem[red_arr_mem_234183_backing_offset_3];\n    volatile unsigned char *red_arr_mem_234181_backing_6 =\n                           &shared_mem[red_arr_mem_234181_backing_offset_4];\n    volatile unsigned char *red_arr_mem_234179_backing_5 =\n                           &shared_mem[red_arr_mem_234179_backing_offset_5];\n    volatile unsigned char *red_arr_mem_234177_backing_4 =\n                           &shared_mem[red_arr_mem_234177_backing_offset_6];\n    volatile unsigned char *color_232026_backing_3 =\n                           &shared_mem[color_232026_backing_offset_7];\n    volatile unsigned char *color_232025_backing_2 =\n                           &shared_mem[color_232025_backing_offset_8];\n    volatile unsigned char *color_232024_backing_1 =\n                           &shared_mem[color_232024_backing_offset_9];\n    volatile unsigned char *color_232023_backing_0 =\n                           &shared_mem[color_232023_backing_offset_10];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global",
            "_tid_234163;\n    int32_t local_tid_234164;\n    int64_t group_sizze_234167;\n    int32_t wave_sizze_234166;\n    int32_t group_tid_234165;\n    \n    global_tid_234163 = get_global_id(0);\n    local_tid_234164 = get_local_id(0);\n    group_sizze_234167 = get_local_size(0);\n    wave_sizze_234166 = LOCKSTEP_WIDTH;\n    group_tid_234165 = get_group_id(0);\n    \n    int32_t phys_tid_217955 = group_tid_234165;\n    int64_t slice_234169 = q_s_203493;\n    int64_t ltid_pre_234168 = sext_i32_i64(local_tid_234164);\n    int64_t remnant_234170 = sext_i32_i64(local_tid_234164) - ltid_pre_234168;\n    int64_t slice_234171 = s_n_m_203636;\n    int64_t slice_234172 = n_p_203492 * slice_234171;\n    int64_t slice_234173 = partition_sizze_203577 * slice_234172;\n    int64_t gtid_217952 = squot64(sext_i32_i64(group_tid_234165), slice_234172);\n    int64_t remnant_234174 = sext_i32_i64(group_tid_234165) - gtid_217952 *\n            slice_234172;\n    int64_t gtid_217953 = squot64(remnant_234174, slice_234171);\n    int64_t remnant_234175 = remnant_234174 - gtid_217953 * slice_234171;\n    int64_t gtid_217954 = remnant_234175;\n    int64_t remnant_234176 = remnant_234175 - gtid_217954;\n    __local unsigned char *color_232023;\n    \n    color_232023 = (__local unsigned char *) color_232023_backing_0;\n    \n    __local unsigned char *color_232024;\n    \n    color_232024 = (__local unsigned char *) color_232024_backing_1;\n    \n    __local unsigned char *color_232025;\n    \n    color_232025 = (__local unsigned char *) color_232025_backing_2;\n    \n    __local unsigned char *color_232026;\n    \n    color_232026 = (__local unsigned char *) color_232026_backing_3;\n    \n    int64_t x_217962;\n    \n    x_217962 = ((__global int64_t *) ext_mem_229264)[gtid_217952 * n_p_203492 +\n                                                     gtid_217953];\n    \n    int64_t x_217964;\n    \n    x_217964 = ((__global int64_t *) ext_mem_229363)[gtid_217952 *\n                                                     (s_n_m_203636 *\n              ",
            "                                        n_p_203492) +\n                                                     gtid_217953 *\n                                                     s_n_m_203636 +\n                                                     gtid_217954];\n    \n    double x_217965;\n    \n    x_217965 = ((__global double *) ext_mem_229362)[gtid_217952 *\n                                                    (s_n_m_203636 *\n                                                     n_p_203492) + gtid_217953 *\n                                                    s_n_m_203636 + gtid_217954];\n    \n    bool cond_217966 = gtid_217954 == (int64_t) 0;\n    int64_t defunc_0_m_fun_res_217967;\n    \n    if (cond_217966) {\n        defunc_0_m_fun_res_217967 = (int64_t) 0;\n    } else {\n        int64_t y_217968 = sub64(s_n_m_203636, (int64_t) 1);\n        bool cond_217969 = gtid_217954 == y_217968;\n        int64_t defunc_0_m_fun_res_f_res_217970;\n        \n        if (cond_217969) {\n            int64_t defunc_0_m_fun_res_f_res_t_res_217971 =\n                    sub64(pad_css_len_203632, (int64_t) 1);\n            \n            defunc_0_m_fun_res_f_res_217970 =\n                defunc_0_m_fun_res_f_res_t_res_217971;\n        } else {\n            int64_t x_217972 = sub64(gtid_217954, (int64_t) 1);\n            int64_t x_217973 = mul64(jump_s_203499, x_217972);\n            int64_t min_arg_217974 = add64((int64_t) 1, x_217973);\n            int64_t min_res_217975 = smin64(defunc_0_f_res_203631,\n                                            min_arg_217974);\n            \n            defunc_0_m_fun_res_f_res_217970 = min_res_217975;\n        }\n        defunc_0_m_fun_res_217967 = defunc_0_m_fun_res_f_res_217970;\n    }\n    \n    int64_t gtid_217978 = sext_i32_i64(sext_i64_i32(ltid_pre_234168));\n    int32_t phys_tid_217979 = local_tid_234164;\n    bool cond_217981 = sle64(x_217962, gtid_217978);\n    int64_t defunc_0_f_res_217982;\n    \n    if (cond_217981) {\n        defunc_0_f_res_217982 = (int64_t) 0;\n    } else {\n   ",
            "     int64_t i_217983 = add64(x_217964, gtid_217978);\n        int64_t defunc_0_add_arg_217984;\n        \n        defunc_0_add_arg_217984 = ((__global\n                                    int64_t *) ext_mem_229265)[gtid_217952 *\n                                                               (defunc_0_f_res_203631 *\n                                                                n_p_203492) +\n                                                               gtid_217953 *\n                                                               defunc_0_f_res_203631 +\n                                                               i_217983];\n        \n        int64_t defunc_1_add_res_217985 = add64((int64_t) 1,\n                                                defunc_0_add_arg_217984);\n        \n        defunc_0_f_res_217982 = defunc_1_add_res_217985;\n    }\n    \n    double defunc_0_f_res_217986;\n    \n    if (cond_217981) {\n        defunc_0_f_res_217986 = 0.0;\n    } else {\n        int64_t i_217987 = add64(x_217964, gtid_217978);\n        double defunc_0_add_arg_217988;\n        \n        defunc_0_add_arg_217988 = ((__global double *) mem_229531)[gtid_217952 *\n                                                                   (defunc_0_f_res_203631 *\n                                                                    n_p_203492) +\n                                                                   gtid_217953 *\n                                                                   defunc_0_f_res_203631 +\n                                                                   i_217987];\n        defunc_0_f_res_217986 = defunc_0_add_arg_217988;\n    }\n    \n    int64_t binop_p_217989 = sub64(defunc_0_f_res_217982,\n                                   defunc_0_m_fun_res_217967);\n    double defunc_0_f_res_217990 = sitofp_i64_f64(binop_p_217989);\n    double abs_res_217991 = fabs(defunc_0_f_res_217990);\n    double tmp1_217992 = abs_res_217991 / x_217965;\n    double x_217993 = tmp1_217992 * tmp1_217992;\n    double y",
            "_217994 = tmp1_217992 * x_217993;\n    double tmp2_217995 = 1.0 - y_217994;\n    double x_217996 = tmp2_217995 * tmp2_217995;\n    double tmp3_217997 = tmp2_217995 * x_217996;\n    double tmp4_217998 = defunc_0_f_res_217986 * tmp3_217997;\n    \n    ((__local double *) color_232026)[gtid_217978] = defunc_0_f_res_217990;\n    ((__local double *) color_232025)[gtid_217978] = tmp4_217998;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    double defunc_2_reduce_res_217999;\n    double defunc_2_reduce_res_218000;\n    double defunc_2_reduce_res_218001;\n    double defunc_2_reduce_res_218002;\n    double defunc_2_reduce_res_218003;\n    int64_t gtid_218006 = sext_i32_i64(sext_i64_i32(ltid_pre_234168));\n    int32_t phys_tid_218007 = local_tid_234164;\n    __local unsigned char *red_arr_mem_234177;\n    \n    red_arr_mem_234177 = (__local unsigned char *) red_arr_mem_234177_backing_4;\n    \n    __local unsigned char *red_arr_mem_234179;\n    \n    red_arr_mem_234179 = (__local unsigned char *) red_arr_mem_234179_backing_5;\n    \n    __local unsigned char *red_arr_mem_234181;\n    \n    red_arr_mem_234181 = (__local unsigned char *) red_arr_mem_234181_backing_6;\n    \n    __local unsigned char *red_arr_mem_234183;\n    \n    red_arr_mem_234183 = (__local unsigned char *) red_arr_mem_234183_backing_7;\n    \n    __local unsigned char *red_arr_mem_234185;\n    \n    red_arr_mem_234185 = (__local unsigned char *) red_arr_mem_234185_backing_8;\n    \n    double x_218023;\n    \n    x_218023 = ((__local double *) color_232026)[gtid_218006];\n    \n    double x_218024;\n    \n    x_218024 = ((__local double *) color_232025)[gtid_218006];\n    \n    double defunc_1_f_res_218025 = x_218023 * x_218024;\n    double defunc_1_f_res_218026 = x_218023 * defunc_1_f_res_218025;\n    double defunc_1_f_res_218027 = x_218023 * defunc_1_f_res_218026;\n    double defunc_1_f_res_218028 = x_218023 * defunc_1_f_res_218027;\n    \n    ((__local double *) red_arr_mem_234177)[gtid_218006] = x_218024;\n    ((__local double *) red_arr_mem_234179)[gtid_2",
            "18006] =\n        defunc_1_f_res_218025;\n    ((__local double *) red_arr_mem_234181)[gtid_218006] =\n        defunc_1_f_res_218026;\n    ((__local double *) red_arr_mem_234183)[gtid_218006] =\n        defunc_1_f_res_218027;\n    ((__local double *) red_arr_mem_234185)[gtid_218006] =\n        defunc_1_f_res_218028;\n    ((__local double *) color_232024)[gtid_218006] = defunc_1_f_res_218026;\n    ((__local double *) color_232023)[gtid_218006] = defunc_1_f_res_218025;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_234187;\n    int32_t skip_waves_234188 = 1;\n    double x_218008;\n    double x_218009;\n    double x_218010;\n    double x_218011;\n    double x_218012;\n    double x_218013;\n    double x_218014;\n    double x_218015;\n    double x_218016;\n    double x_218017;\n    \n    offset_234187 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_234164, sext_i64_i32(q_s_203493))) {\n            x_218008 = ((__local\n                         double *) red_arr_mem_234177)[sext_i32_i64(local_tid_234164 +\n                                                       offset_234187)];\n            x_218009 = ((__local\n                         double *) red_arr_mem_234179)[sext_i32_i64(local_tid_234164 +\n                                                       offset_234187)];\n            x_218010 = ((__local\n                         double *) red_arr_mem_234181)[sext_i32_i64(local_tid_234164 +\n                                                       offset_234187)];\n            x_218011 = ((__local\n                         double *) red_arr_mem_234183)[sext_i32_i64(local_tid_234164 +\n                                                       offset_234187)];\n            x_218012 = ((__local\n                         double *) red_arr_mem_234185)[sext_i32_i64(local_tid_234164 +\n                                                       offset_234187)];\n        }\n    }\n    offset_234187 = 1;\n    while (slt32(offset_234187, wave_sizze_234166)) {\n        if (slt32(loc",
            "al_tid_234164 + offset_234187, sext_i64_i32(q_s_203493)) &&\n            ((local_tid_234164 - squot32(local_tid_234164, wave_sizze_234166) *\n              wave_sizze_234166) & (2 * offset_234187 - 1)) == 0) {\n            // read array element\n            {\n                x_218013 = ((volatile __local\n                             double *) red_arr_mem_234177)[sext_i32_i64(local_tid_234164 +\n                                                           offset_234187)];\n                x_218014 = ((volatile __local\n                             double *) red_arr_mem_234179)[sext_i32_i64(local_tid_234164 +\n                                                           offset_234187)];\n                x_218015 = ((volatile __local\n                             double *) red_arr_mem_234181)[sext_i32_i64(local_tid_234164 +\n                                                           offset_234187)];\n                x_218016 = ((volatile __local\n                             double *) red_arr_mem_234183)[sext_i32_i64(local_tid_234164 +\n                                                           offset_234187)];\n                x_218017 = ((volatile __local\n                             double *) red_arr_mem_234185)[sext_i32_i64(local_tid_234164 +\n                                                           offset_234187)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_218018 = x_218008 + x_218013;\n                double defunc_1_op_res_218019 = x_218009 + x_218014;\n                double defunc_1_op_res_218020 = x_218010 + x_218015;\n                double defunc_1_op_res_218021 = x_218011 + x_218016;\n                double defunc_1_op_res_218022 = x_218012 + x_218017;\n                \n                x_218008 = defunc_1_op_res_218018;\n                x_218009 = defunc_1_op_res_218019;\n                x_218010 = defunc_1_op_res_218020;\n                x_218011 = defunc_1_op_res_218021;\n                x_218012 = defunc_1_op_res_2",
            "18022;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_234177)[sext_i32_i64(local_tid_234164)] =\n                    x_218008;\n                ((volatile __local\n                  double *) red_arr_mem_234179)[sext_i32_i64(local_tid_234164)] =\n                    x_218009;\n                ((volatile __local\n                  double *) red_arr_mem_234181)[sext_i32_i64(local_tid_234164)] =\n                    x_218010;\n                ((volatile __local\n                  double *) red_arr_mem_234183)[sext_i32_i64(local_tid_234164)] =\n                    x_218011;\n                ((volatile __local\n                  double *) red_arr_mem_234185)[sext_i32_i64(local_tid_234164)] =\n                    x_218012;\n            }\n        }\n        offset_234187 *= 2;\n    }\n    while (slt32(skip_waves_234188, squot32(sext_i64_i32(q_s_203493) +\n                                            wave_sizze_234166 - 1,\n                                            wave_sizze_234166))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_234187 = skip_waves_234188 * wave_sizze_234166;\n        if (slt32(local_tid_234164 + offset_234187, sext_i64_i32(q_s_203493)) &&\n            ((local_tid_234164 - squot32(local_tid_234164, wave_sizze_234166) *\n              wave_sizze_234166) == 0 && (squot32(local_tid_234164,\n                                                  wave_sizze_234166) & (2 *\n                                                                        skip_waves_234188 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_218013 = ((__local\n                             double *) red_arr_mem_234177)[sext_i32_i64(local_tid_234164 +\n                                                           offset_234187)];\n                x_218014 = ((__local\n                             double *) re",
            "d_arr_mem_234179)[sext_i32_i64(local_tid_234164 +\n                                                           offset_234187)];\n                x_218015 = ((__local\n                             double *) red_arr_mem_234181)[sext_i32_i64(local_tid_234164 +\n                                                           offset_234187)];\n                x_218016 = ((__local\n                             double *) red_arr_mem_234183)[sext_i32_i64(local_tid_234164 +\n                                                           offset_234187)];\n                x_218017 = ((__local\n                             double *) red_arr_mem_234185)[sext_i32_i64(local_tid_234164 +\n                                                           offset_234187)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_218018 = x_218008 + x_218013;\n                double defunc_1_op_res_218019 = x_218009 + x_218014;\n                double defunc_1_op_res_218020 = x_218010 + x_218015;\n                double defunc_1_op_res_218021 = x_218011 + x_218016;\n                double defunc_1_op_res_218022 = x_218012 + x_218017;\n                \n                x_218008 = defunc_1_op_res_218018;\n                x_218009 = defunc_1_op_res_218019;\n                x_218010 = defunc_1_op_res_218020;\n                x_218011 = defunc_1_op_res_218021;\n                x_218012 = defunc_1_op_res_218022;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_234177)[sext_i32_i64(local_tid_234164)] =\n                    x_218008;\n                ((__local\n                  double *) red_arr_mem_234179)[sext_i32_i64(local_tid_234164)] =\n                    x_218009;\n                ((__local\n                  double *) red_arr_mem_234181)[sext_i32_i64(local_tid_234164)] =\n                    x_218010;\n                ((__local\n                  double *) red_arr_mem_234183)[sext_i32_i64(local_",
            "tid_234164)] =\n                    x_218011;\n                ((__local\n                  double *) red_arr_mem_234185)[sext_i32_i64(local_tid_234164)] =\n                    x_218012;\n            }\n        }\n        skip_waves_234188 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_217999 = ((__local\n                                   double *) red_arr_mem_234177)[(int64_t) 0];\n    defunc_2_reduce_res_218000 = ((__local\n                                   double *) red_arr_mem_234179)[(int64_t) 0];\n    defunc_2_reduce_res_218001 = ((__local\n                                   double *) red_arr_mem_234181)[(int64_t) 0];\n    defunc_2_reduce_res_218002 = ((__local\n                                   double *) red_arr_mem_234183)[(int64_t) 0];\n    defunc_2_reduce_res_218003 = ((__local\n                                   double *) red_arr_mem_234185)[(int64_t) 0];\n    \n    double x_218029 = defunc_2_reduce_res_218001 * defunc_2_reduce_res_218003;\n    double y_218030 = defunc_2_reduce_res_218002 * defunc_2_reduce_res_218002;\n    double a12_218031 = x_218029 - y_218030;\n    double x_218032 = defunc_2_reduce_res_218001 * defunc_2_reduce_res_218002;\n    double y_218033 = defunc_2_reduce_res_218000 * defunc_2_reduce_res_218003;\n    double b12_218034 = x_218032 - y_218033;\n    double x_218035 = defunc_2_reduce_res_218000 * defunc_2_reduce_res_218002;\n    double y_218036 = defunc_2_reduce_res_218001 * defunc_2_reduce_res_218001;\n    double c12_218037 = x_218035 - y_218036;\n    double x_218038 = defunc_2_reduce_res_217999 * defunc_2_reduce_res_218003;\n    double b2_218039 = x_218038 - y_218036;\n    double x_218040 = defunc_2_reduce_res_218000 * defunc_2_reduce_res_218001;\n    double y_218041 = defunc_2_reduce_res_217999 * defunc_2_reduce_res_218002;\n    double c2_218042 = x_218040 - y_218041;\n    double x_218043 = defunc_2_reduce_res_217999 * a12_218031;\n    double y_218044 = defunc_2_reduce_res_218000 * b12_218034;\n    double x_218045 = x_218043 + y_218044;\n   ",
            " double y_218046 = defunc_2_reduce_res_218001 * c12_218037;\n    double y_218047 = x_218045 + y_218046;\n    double det_218048 = 1.0 / y_218047;\n    double a12_218049 = a12_218031 * det_218048;\n    double b12_218050 = b12_218034 * det_218048;\n    double c12_218051 = c12_218037 * det_218048;\n    double b2_218052 = b2_218039 * det_218048;\n    double c2_218053 = c2_218042 * det_218048;\n    double defunc_2_reduce_res_218054;\n    double defunc_2_reduce_res_218055;\n    int64_t gtid_218056 = sext_i32_i64(sext_i64_i32(ltid_pre_234168));\n    int32_t phys_tid_218057 = local_tid_234164;\n    __local unsigned char *red_arr_mem_234189;\n    \n    red_arr_mem_234189 = (__local unsigned char *) red_arr_mem_234189_backing_9;\n    \n    __local unsigned char *red_arr_mem_234191;\n    \n    red_arr_mem_234191 = (__local\n                          unsigned char *) red_arr_mem_234191_backing_10;\n    \n    double x_218065;\n    \n    x_218065 = ((__local double *) color_232025)[gtid_218056];\n    \n    double x_218066;\n    \n    x_218066 = ((__local double *) color_232023)[gtid_218056];\n    \n    double x_218067;\n    \n    x_218067 = ((__local double *) color_232024)[gtid_218056];\n    \n    bool cond_218068 = sle64(x_217962, gtid_218056);\n    double defunc_0_f_res_218069;\n    \n    if (cond_218068) {\n        defunc_0_f_res_218069 = 0.0;\n    } else {\n        int64_t i_218070 = add64(x_217964, gtid_218056);\n        double defunc_0_add_arg_218071;\n        \n        defunc_0_add_arg_218071 = ((__global double *) mem_229526)[gtid_217952 *\n                                                                   (defunc_0_f_res_203631 *\n                                                                    n_p_203492) +\n                                                                   gtid_217953 *\n                                                                   defunc_0_f_res_203631 +\n                                                                   i_218070];\n        defunc_0_f_res_218069 = defunc_0_add_arg_218071;\n ",
            "   }\n    \n    double x_218072 = a12_218049 * x_218065;\n    double y_218073 = b12_218050 * x_218066;\n    double x_218074 = x_218072 + y_218073;\n    double y_218075 = c12_218051 * x_218067;\n    double x_218076 = x_218074 + y_218075;\n    double defunc_9_fit_fun_res_218077 = defunc_0_f_res_218069 * x_218076;\n    double x_218078 = b12_218050 * x_218065;\n    double y_218079 = b2_218052 * x_218066;\n    double x_218080 = x_218078 + y_218079;\n    double y_218081 = c2_218053 * x_218067;\n    double x_218082 = x_218080 + y_218081;\n    double defunc_9_slope_fun_res_218083 = defunc_0_f_res_218069 * x_218082;\n    \n    ((__local double *) red_arr_mem_234189)[gtid_218056] =\n        defunc_9_fit_fun_res_218077;\n    ((__local double *) red_arr_mem_234191)[gtid_218056] =\n        defunc_9_slope_fun_res_218083;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_234193;\n    int32_t skip_waves_234194 = 1;\n    double x_218058;\n    double x_218059;\n    double x_218060;\n    double x_218061;\n    \n    offset_234193 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_234164, sext_i64_i32(q_s_203493))) {\n            x_218058 = ((__local\n                         double *) red_arr_mem_234189)[sext_i32_i64(local_tid_234164 +\n                                                       offset_234193)];\n            x_218059 = ((__local\n                         double *) red_arr_mem_234191)[sext_i32_i64(local_tid_234164 +\n                                                       offset_234193)];\n        }\n    }\n    offset_234193 = 1;\n    while (slt32(offset_234193, wave_sizze_234166)) {\n        if (slt32(local_tid_234164 + offset_234193, sext_i64_i32(q_s_203493)) &&\n            ((local_tid_234164 - squot32(local_tid_234164, wave_sizze_234166) *\n              wave_sizze_234166) & (2 * offset_234193 - 1)) == 0) {\n            // read array element\n            {\n                x_218060 = ((volatile __local\n                             double *) red_arr_mem_234189)[se",
            "xt_i32_i64(local_tid_234164 +\n                                                           offset_234193)];\n                x_218061 = ((volatile __local\n                             double *) red_arr_mem_234191)[sext_i32_i64(local_tid_234164 +\n                                                           offset_234193)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_218062 = x_218058 + x_218060;\n                double defunc_1_op_res_218063 = x_218059 + x_218061;\n                \n                x_218058 = defunc_1_op_res_218062;\n                x_218059 = defunc_1_op_res_218063;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_234189)[sext_i32_i64(local_tid_234164)] =\n                    x_218058;\n                ((volatile __local\n                  double *) red_arr_mem_234191)[sext_i32_i64(local_tid_234164)] =\n                    x_218059;\n            }\n        }\n        offset_234193 *= 2;\n    }\n    while (slt32(skip_waves_234194, squot32(sext_i64_i32(q_s_203493) +\n                                            wave_sizze_234166 - 1,\n                                            wave_sizze_234166))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_234193 = skip_waves_234194 * wave_sizze_234166;\n        if (slt32(local_tid_234164 + offset_234193, sext_i64_i32(q_s_203493)) &&\n            ((local_tid_234164 - squot32(local_tid_234164, wave_sizze_234166) *\n              wave_sizze_234166) == 0 && (squot32(local_tid_234164,\n                                                  wave_sizze_234166) & (2 *\n                                                                        skip_waves_234194 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_218060 = ((__local\n                             double *) red_arr_m",
            "em_234189)[sext_i32_i64(local_tid_234164 +\n                                                           offset_234193)];\n                x_218061 = ((__local\n                             double *) red_arr_mem_234191)[sext_i32_i64(local_tid_234164 +\n                                                           offset_234193)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_218062 = x_218058 + x_218060;\n                double defunc_1_op_res_218063 = x_218059 + x_218061;\n                \n                x_218058 = defunc_1_op_res_218062;\n                x_218059 = defunc_1_op_res_218063;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_234189)[sext_i32_i64(local_tid_234164)] =\n                    x_218058;\n                ((__local\n                  double *) red_arr_mem_234191)[sext_i32_i64(local_tid_234164)] =\n                    x_218059;\n            }\n        }\n        skip_waves_234194 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_218054 = ((__local\n                                   double *) red_arr_mem_234189)[(int64_t) 0];\n    defunc_2_reduce_res_218055 = ((__local\n                                   double *) red_arr_mem_234191)[(int64_t) 0];\n    if (local_tid_234164 == 0) {\n        ((__global double *) mem_230476)[gtid_217952 * (s_n_m_203636 *\n                                                        n_p_203492) +\n                                         gtid_217953 * s_n_m_203636 +\n                                         gtid_217954] =\n            defunc_2_reduce_res_218054;\n    }\n    if (local_tid_234164 == 0) {\n        ((__global double *) mem_230481)[gtid_217952 * (s_n_m_203636 *\n                                                        n_p_203492) +\n                                         gtid_217953 * s_n_m_203636 +\n                                         gtid_217954] =\n            defunc_2",
            "_reduce_res_218055;\n    }\n    \n  error_5:\n    return;\n}\n__kernel void mainzisegmap_intragroup_221669(__global int *global_failure,\n                                             uint red_arr_mem_235507_backing_offset_0,\n                                             uint red_arr_mem_235503_backing_offset_1,\n                                             uint color_232032_backing_offset_2,\n                                             int64_t n_203490,\n                                             int64_t q_l_203495,\n                                             int64_t jump_t_203500,\n                                             int64_t partition_sizze_203577,\n                                             int64_t l_n_m_203643,\n                                             int64_t i_203670,\n                                             int64_t ctx_param_ext_229488,\n                                             int64_t ctx_param_ext_229489,\n                                             int64_t ctx_param_ext_229491,\n                                             __global\n                                             unsigned char *ext_mem_229411,\n                                             __global\n                                             unsigned char *ext_mem_229412,\n                                             __global\n                                             unsigned char *mem_param_229493,\n                                             __global unsigned char *mem_230551,\n                                             __global unsigned char *mem_230861)\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_235507_backing_2 =\n                           &shared_mem[red_arr_mem_235507_backing_offset_0];\n    volatile unsigned char *red_arr_mem_235503_backing_1 =\n                           &shared_mem[red_arr_mem_235503_backing_offset_1];\n    volatile unsigned char *color_232032_backing_0 =\n               ",
            "            &shared_mem[color_232032_backing_offset_2];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235491;\n    int32_t local_tid_235492;\n    int64_t group_sizze_235495;\n    int32_t wave_sizze_235494;\n    int32_t group_tid_235493;\n    \n    global_tid_235491 = get_global_id(0);\n    local_tid_235492 = get_local_id(0);\n    group_sizze_235495 = get_local_size(0);\n    wave_sizze_235494 = LOCKSTEP_WIDTH;\n    group_tid_235493 = get_group_id(0);\n    \n    int32_t phys_tid_221669 = group_tid_235493;\n    int64_t slice_235497 = q_l_203495;\n    int64_t ltid_pre_235496 = sext_i32_i64(local_tid_235492);\n    int64_t remnant_235498 = sext_i32_i64(local_tid_235492) - ltid_pre_235496;\n    int64_t slice_235499 = l_n_m_203643;\n    int64_t slice_235500 = partition_sizze_203577 * slice_235499;\n    int64_t gtid_221667 = squot64(sext_i32_i64(group_tid_235493), slice_235499);\n    int64_t remnant_235501 = sext_i32_i64(group_tid_235493) - gtid_221667 *\n            slice_235499;\n    int64_t gtid_221668 = remnant_235501;\n    int64_t remnant_235502 = remnant_235501 - gtid_221668;\n    __local unsigned char *color_232032;\n    \n    color_232032 = (__local unsigned char *) color_232032_backing_0;\n    \n    int64_t x_221675;\n    \n    x_221675 = ((__global int64_t *) ext_mem_229412)[gtid_221667 *\n                                                     l_n_m_203643 +\n                                                     gtid_221668];\n    \n    double x_221676;\n    \n    x_221676 = ((__global double *) ext_mem_229411)[gtid_221667 * l_n_m_203643 +\n                                                    gtid_221668];\n    \n    int64_t min_arg_221677 = mul64(jump_t_203500, gtid_221668);\n    int64_t min_res_221678 = smin64(i_203670, min_arg_221677);\n    int64_t defunc_0_g_res_221679 = add64((int64_t) 1, min_res_221678);\n    double defunc_2_reduce_res_221680;\n    int64_t gtid_221682 = sext_i32_i64(sext_i64_i32(ltid_pre_235496));\n    int32_t phys_tid_221683 = local_tid_235492;\n    __loca",
            "l unsigned char *red_arr_mem_235503;\n    \n    red_arr_mem_235503 = (__local unsigned char *) red_arr_mem_235503_backing_1;\n    \n    bool cond_221688 = sle64(n_203490, gtid_221682);\n    int64_t defunc_0_f_res_221689;\n    \n    if (cond_221688) {\n        defunc_0_f_res_221689 = (int64_t) 0;\n    } else {\n        int64_t i_221690 = add64(x_221675, gtid_221682);\n        int64_t defunc_1_add_res_221691 = add64((int64_t) 1, i_221690);\n        \n        defunc_0_f_res_221689 = defunc_1_add_res_221691;\n    }\n    \n    double defunc_0_f_res_221692;\n    \n    if (cond_221688) {\n        defunc_0_f_res_221692 = 0.0;\n    } else {\n        int64_t i_221693 = add64(x_221675, gtid_221682);\n        double defunc_0_add_arg_221694;\n        \n        defunc_0_add_arg_221694 = ((__global\n                                    double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                                (gtid_221667 *\n                                                                 ctx_param_ext_229489 +\n                                                                 i_221693 *\n                                                                 ctx_param_ext_229491)];\n        defunc_0_f_res_221692 = defunc_0_add_arg_221694;\n    }\n    \n    int64_t binop_p_221695 = sub64(defunc_0_f_res_221689,\n                                   defunc_0_g_res_221679);\n    double defunc_0_f_res_221696 = sitofp_i64_f64(binop_p_221695);\n    double abs_res_221697 = fabs(defunc_0_f_res_221696);\n    double tmp1_221698 = abs_res_221697 / x_221676;\n    double x_221699 = tmp1_221698 * tmp1_221698;\n    double y_221700 = tmp1_221698 * x_221699;\n    double tmp2_221701 = 1.0 - y_221700;\n    double x_221702 = tmp2_221701 * tmp2_221701;\n    double tmp3_221703 = tmp2_221701 * x_221702;\n    double tmp4_221704 = defunc_0_f_res_221692 * tmp3_221703;\n    \n    ((__local double *) red_arr_mem_235503)[gtid_221682] = tmp4_221704;\n    ((__local double *) color_232032)[gtid_221682] = tmp4_221704;\n    barrie",
            "r(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_235505;\n    int32_t skip_waves_235506 = 1;\n    double x_221684;\n    double x_221685;\n    \n    offset_235505 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_235492, sext_i64_i32(q_l_203495))) {\n            x_221684 = ((__local\n                         double *) red_arr_mem_235503)[sext_i32_i64(local_tid_235492 +\n                                                       offset_235505)];\n        }\n    }\n    offset_235505 = 1;\n    while (slt32(offset_235505, wave_sizze_235494)) {\n        if (slt32(local_tid_235492 + offset_235505, sext_i64_i32(q_l_203495)) &&\n            ((local_tid_235492 - squot32(local_tid_235492, wave_sizze_235494) *\n              wave_sizze_235494) & (2 * offset_235505 - 1)) == 0) {\n            // read array element\n            {\n                x_221685 = ((volatile __local\n                             double *) red_arr_mem_235503)[sext_i32_i64(local_tid_235492 +\n                                                           offset_235505)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_221686 = x_221684 + x_221685;\n                \n                x_221684 = defunc_1_op_res_221686;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_235503)[sext_i32_i64(local_tid_235492)] =\n                    x_221684;\n            }\n        }\n        offset_235505 *= 2;\n    }\n    while (slt32(skip_waves_235506, squot32(sext_i64_i32(q_l_203495) +\n                                            wave_sizze_235494 - 1,\n                                            wave_sizze_235494))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_235505 = skip_waves_235506 * wave_sizze_235494;\n        if (slt32(local_tid_235492 + offset_235505, sext_i64_i32(q_l_203495)) &&\n            ((local_tid_235492 - squot32(local_tid_235492, wave_sizze_23",
            "5494) *\n              wave_sizze_235494) == 0 && (squot32(local_tid_235492,\n                                                  wave_sizze_235494) & (2 *\n                                                                        skip_waves_235506 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_221685 = ((__local\n                             double *) red_arr_mem_235503)[sext_i32_i64(local_tid_235492 +\n                                                           offset_235505)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_221686 = x_221684 + x_221685;\n                \n                x_221684 = defunc_1_op_res_221686;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_235503)[sext_i32_i64(local_tid_235492)] =\n                    x_221684;\n            }\n        }\n        skip_waves_235506 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_221680 = ((__local\n                                   double *) red_arr_mem_235503)[(int64_t) 0];\n    \n    double a0_221705 = 1.0 / defunc_2_reduce_res_221680;\n    double defunc_2_reduce_res_221706;\n    int64_t gtid_221707 = sext_i32_i64(sext_i64_i32(ltid_pre_235496));\n    int32_t phys_tid_221708 = local_tid_235492;\n    __local unsigned char *red_arr_mem_235507;\n    \n    red_arr_mem_235507 = (__local unsigned char *) red_arr_mem_235507_backing_2;\n    \n    double x_221713;\n    \n    x_221713 = ((__local double *) color_232032)[gtid_221707];\n    \n    bool cond_221714 = sle64(n_203490, gtid_221707);\n    double defunc_0_f_res_221715;\n    \n    if (cond_221714) {\n        defunc_0_f_res_221715 = 0.0;\n    } else {\n        int64_t i_221716 = add64(x_221675, gtid_221707);\n        double defunc_0_add_arg_221717;\n        \n        defunc_0_add_arg_221717 = ((__global double ",
            "*) mem_230551)[gtid_221667 *\n                                                                   n_203490 +\n                                                                   i_221716];\n        defunc_0_f_res_221715 = defunc_0_add_arg_221717;\n    }\n    \n    double x_221718 = a0_221705 * x_221713;\n    double defunc_9_fit_fun_res_221719 = defunc_0_f_res_221715 * x_221718;\n    \n    ((__local double *) red_arr_mem_235507)[gtid_221707] =\n        defunc_9_fit_fun_res_221719;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_235509;\n    int32_t skip_waves_235510 = 1;\n    double x_221709;\n    double x_221710;\n    \n    offset_235509 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_235492, sext_i64_i32(q_l_203495))) {\n            x_221709 = ((__local\n                         double *) red_arr_mem_235507)[sext_i32_i64(local_tid_235492 +\n                                                       offset_235509)];\n        }\n    }\n    offset_235509 = 1;\n    while (slt32(offset_235509, wave_sizze_235494)) {\n        if (slt32(local_tid_235492 + offset_235509, sext_i64_i32(q_l_203495)) &&\n            ((local_tid_235492 - squot32(local_tid_235492, wave_sizze_235494) *\n              wave_sizze_235494) & (2 * offset_235509 - 1)) == 0) {\n            // read array element\n            {\n                x_221710 = ((volatile __local\n                             double *) red_arr_mem_235507)[sext_i32_i64(local_tid_235492 +\n                                                           offset_235509)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_221711 = x_221709 + x_221710;\n                \n                x_221709 = defunc_1_op_res_221711;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_235507)[sext_i32_i64(local_tid_235492)] =\n                    x_221709;\n            }\n        }\n        of",
            "fset_235509 *= 2;\n    }\n    while (slt32(skip_waves_235510, squot32(sext_i64_i32(q_l_203495) +\n                                            wave_sizze_235494 - 1,\n                                            wave_sizze_235494))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_235509 = skip_waves_235510 * wave_sizze_235494;\n        if (slt32(local_tid_235492 + offset_235509, sext_i64_i32(q_l_203495)) &&\n            ((local_tid_235492 - squot32(local_tid_235492, wave_sizze_235494) *\n              wave_sizze_235494) == 0 && (squot32(local_tid_235492,\n                                                  wave_sizze_235494) & (2 *\n                                                                        skip_waves_235510 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_221710 = ((__local\n                             double *) red_arr_mem_235507)[sext_i32_i64(local_tid_235492 +\n                                                           offset_235509)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_221711 = x_221709 + x_221710;\n                \n                x_221709 = defunc_1_op_res_221711;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_235507)[sext_i32_i64(local_tid_235492)] =\n                    x_221709;\n            }\n        }\n        skip_waves_235510 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_221706 = ((__local\n                                   double *) red_arr_mem_235507)[(int64_t) 0];\n    if (local_tid_235492 == 0) {\n        ((__global double *) mem_230861)[gtid_221667 * l_n_m_203643 +\n                                         gtid_221668] =\n            defunc_2_reduce_res_221706;\n    }\n    \n  error_4:\n    return;\n}\n__kernel void mainzisegmap_intragroup_221836(__global int",
            " *global_failure,\n                                             uint red_arr_mem_235533_backing_offset_0,\n                                             uint red_arr_mem_235531_backing_offset_1,\n                                             uint red_arr_mem_235527_backing_offset_2,\n                                             uint red_arr_mem_235525_backing_offset_3,\n                                             uint red_arr_mem_235523_backing_offset_4,\n                                             uint color_232034_backing_offset_5,\n                                             uint color_232033_backing_offset_6,\n                                             int64_t n_203490,\n                                             int64_t q_l_203495,\n                                             int64_t jump_t_203500,\n                                             int64_t partition_sizze_203577,\n                                             int64_t l_n_m_203643,\n                                             int64_t i_203670,\n                                             int64_t ctx_param_ext_229488,\n                                             int64_t ctx_param_ext_229489,\n                                             int64_t ctx_param_ext_229491,\n                                             __global\n                                             unsigned char *ext_mem_229411,\n                                             __global\n                                             unsigned char *ext_mem_229412,\n                                             __global\n                                             unsigned char *mem_param_229493,\n                                             __global unsigned char *mem_230551,\n                                             __global unsigned char *mem_230874,\n                                             __global unsigned char *mem_230878)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *re",
            "d_arr_mem_235533_backing_6 =\n                           &shared_mem[red_arr_mem_235533_backing_offset_0];\n    volatile unsigned char *red_arr_mem_235531_backing_5 =\n                           &shared_mem[red_arr_mem_235531_backing_offset_1];\n    volatile unsigned char *red_arr_mem_235527_backing_4 =\n                           &shared_mem[red_arr_mem_235527_backing_offset_2];\n    volatile unsigned char *red_arr_mem_235525_backing_3 =\n                           &shared_mem[red_arr_mem_235525_backing_offset_3];\n    volatile unsigned char *red_arr_mem_235523_backing_2 =\n                           &shared_mem[red_arr_mem_235523_backing_offset_4];\n    volatile unsigned char *color_232034_backing_1 =\n                           &shared_mem[color_232034_backing_offset_5];\n    volatile unsigned char *color_232033_backing_0 =\n                           &shared_mem[color_232033_backing_offset_6];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235511;\n    int32_t local_tid_235512;\n    int64_t group_sizze_235515;\n    int32_t wave_sizze_235514;\n    int32_t group_tid_235513;\n    \n    global_tid_235511 = get_global_id(0);\n    local_tid_235512 = get_local_id(0);\n    group_sizze_235515 = get_local_size(0);\n    wave_sizze_235514 = LOCKSTEP_WIDTH;\n    group_tid_235513 = get_group_id(0);\n    \n    int32_t phys_tid_221836 = group_tid_235513;\n    int64_t slice_235517 = q_l_203495;\n    int64_t ltid_pre_235516 = sext_i32_i64(local_tid_235512);\n    int64_t remnant_235518 = sext_i32_i64(local_tid_235512) - ltid_pre_235516;\n    int64_t slice_235519 = l_n_m_203643;\n    int64_t slice_235520 = partition_sizze_203577 * slice_235519;\n    int64_t gtid_221834 = squot64(sext_i32_i64(group_tid_235513), slice_235519);\n    int64_t remnant_235521 = sext_i32_i64(group_tid_235513) - gtid_221834 *\n            slice_235519;\n    int64_t gtid_221835 = remnant_235521;\n    int64_t remnant_235522 = remnant_235521 - gtid_221835;\n    __local unsigned char *color_232033;\n    \n    color_2",
            "32033 = (__local unsigned char *) color_232033_backing_0;\n    \n    __local unsigned char *color_232034;\n    \n    color_232034 = (__local unsigned char *) color_232034_backing_1;\n    \n    int64_t x_221842;\n    \n    x_221842 = ((__global int64_t *) ext_mem_229412)[gtid_221834 *\n                                                     l_n_m_203643 +\n                                                     gtid_221835];\n    \n    double x_221843;\n    \n    x_221843 = ((__global double *) ext_mem_229411)[gtid_221834 * l_n_m_203643 +\n                                                    gtid_221835];\n    \n    int64_t min_arg_221844 = mul64(jump_t_203500, gtid_221835);\n    int64_t min_res_221845 = smin64(i_203670, min_arg_221844);\n    int64_t defunc_0_g_res_221846 = add64((int64_t) 1, min_res_221845);\n    double defunc_2_reduce_res_221847;\n    double defunc_2_reduce_res_221848;\n    double defunc_2_reduce_res_221849;\n    int64_t gtid_221852 = sext_i32_i64(sext_i64_i32(ltid_pre_235516));\n    int32_t phys_tid_221853 = local_tid_235512;\n    __local unsigned char *red_arr_mem_235523;\n    \n    red_arr_mem_235523 = (__local unsigned char *) red_arr_mem_235523_backing_2;\n    \n    __local unsigned char *red_arr_mem_235525;\n    \n    red_arr_mem_235525 = (__local unsigned char *) red_arr_mem_235525_backing_3;\n    \n    __local unsigned char *red_arr_mem_235527;\n    \n    red_arr_mem_235527 = (__local unsigned char *) red_arr_mem_235527_backing_4;\n    \n    bool cond_221864 = sle64(n_203490, gtid_221852);\n    int64_t defunc_0_f_res_221865;\n    \n    if (cond_221864) {\n        defunc_0_f_res_221865 = (int64_t) 0;\n    } else {\n        int64_t i_221866 = add64(x_221842, gtid_221852);\n        int64_t defunc_1_add_res_221867 = add64((int64_t) 1, i_221866);\n        \n        defunc_0_f_res_221865 = defunc_1_add_res_221867;\n    }\n    \n    double defunc_0_f_res_221868;\n    \n    if (cond_221864) {\n        defunc_0_f_res_221868 = 0.0;\n    } else {\n        int64_t i_221869 = add64(x_221842, gtid_221852);\n       ",
            " double defunc_0_add_arg_221870;\n        \n        defunc_0_add_arg_221870 = ((__global\n                                    double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                                (gtid_221834 *\n                                                                 ctx_param_ext_229489 +\n                                                                 i_221869 *\n                                                                 ctx_param_ext_229491)];\n        defunc_0_f_res_221868 = defunc_0_add_arg_221870;\n    }\n    \n    int64_t binop_p_221871 = sub64(defunc_0_f_res_221865,\n                                   defunc_0_g_res_221846);\n    double defunc_0_f_res_221872 = sitofp_i64_f64(binop_p_221871);\n    double abs_res_221873 = fabs(defunc_0_f_res_221872);\n    double tmp1_221874 = abs_res_221873 / x_221843;\n    double x_221875 = tmp1_221874 * tmp1_221874;\n    double y_221876 = tmp1_221874 * x_221875;\n    double tmp2_221877 = 1.0 - y_221876;\n    double x_221878 = tmp2_221877 * tmp2_221877;\n    double tmp3_221879 = tmp2_221877 * x_221878;\n    double tmp4_221880 = defunc_0_f_res_221868 * tmp3_221879;\n    double defunc_1_f_res_221881 = defunc_0_f_res_221872 * tmp4_221880;\n    double defunc_1_f_res_221882 = defunc_0_f_res_221872 *\n           defunc_1_f_res_221881;\n    \n    ((__local double *) red_arr_mem_235523)[gtid_221852] = tmp4_221880;\n    ((__local double *) red_arr_mem_235525)[gtid_221852] =\n        defunc_1_f_res_221881;\n    ((__local double *) red_arr_mem_235527)[gtid_221852] =\n        defunc_1_f_res_221882;\n    ((__local double *) color_232034)[gtid_221852] = defunc_1_f_res_221881;\n    ((__local double *) color_232033)[gtid_221852] = tmp4_221880;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_235529;\n    int32_t skip_waves_235530 = 1;\n    double x_221854;\n    double x_221855;\n    double x_221856;\n    double x_221857;\n    double x_221858;\n    double x_221859;\n    \n    offset_235529 = 0;\n    // participati",
            "ng threads read initial accumulator\n    {\n        if (slt32(local_tid_235512, sext_i64_i32(q_l_203495))) {\n            x_221854 = ((__local\n                         double *) red_arr_mem_235523)[sext_i32_i64(local_tid_235512 +\n                                                       offset_235529)];\n            x_221855 = ((__local\n                         double *) red_arr_mem_235525)[sext_i32_i64(local_tid_235512 +\n                                                       offset_235529)];\n            x_221856 = ((__local\n                         double *) red_arr_mem_235527)[sext_i32_i64(local_tid_235512 +\n                                                       offset_235529)];\n        }\n    }\n    offset_235529 = 1;\n    while (slt32(offset_235529, wave_sizze_235514)) {\n        if (slt32(local_tid_235512 + offset_235529, sext_i64_i32(q_l_203495)) &&\n            ((local_tid_235512 - squot32(local_tid_235512, wave_sizze_235514) *\n              wave_sizze_235514) & (2 * offset_235529 - 1)) == 0) {\n            // read array element\n            {\n                x_221857 = ((volatile __local\n                             double *) red_arr_mem_235523)[sext_i32_i64(local_tid_235512 +\n                                                           offset_235529)];\n                x_221858 = ((volatile __local\n                             double *) red_arr_mem_235525)[sext_i32_i64(local_tid_235512 +\n                                                           offset_235529)];\n                x_221859 = ((volatile __local\n                             double *) red_arr_mem_235527)[sext_i32_i64(local_tid_235512 +\n                                                           offset_235529)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_221860 = x_221854 + x_221857;\n                double defunc_1_op_res_221861 = x_221855 + x_221858;\n                double defunc_1_op_res_221862 = x_221856 + x_221859;\n                \n               ",
            " x_221854 = defunc_1_op_res_221860;\n                x_221855 = defunc_1_op_res_221861;\n                x_221856 = defunc_1_op_res_221862;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_235523)[sext_i32_i64(local_tid_235512)] =\n                    x_221854;\n                ((volatile __local\n                  double *) red_arr_mem_235525)[sext_i32_i64(local_tid_235512)] =\n                    x_221855;\n                ((volatile __local\n                  double *) red_arr_mem_235527)[sext_i32_i64(local_tid_235512)] =\n                    x_221856;\n            }\n        }\n        offset_235529 *= 2;\n    }\n    while (slt32(skip_waves_235530, squot32(sext_i64_i32(q_l_203495) +\n                                            wave_sizze_235514 - 1,\n                                            wave_sizze_235514))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_235529 = skip_waves_235530 * wave_sizze_235514;\n        if (slt32(local_tid_235512 + offset_235529, sext_i64_i32(q_l_203495)) &&\n            ((local_tid_235512 - squot32(local_tid_235512, wave_sizze_235514) *\n              wave_sizze_235514) == 0 && (squot32(local_tid_235512,\n                                                  wave_sizze_235514) & (2 *\n                                                                        skip_waves_235530 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_221857 = ((__local\n                             double *) red_arr_mem_235523)[sext_i32_i64(local_tid_235512 +\n                                                           offset_235529)];\n                x_221858 = ((__local\n                             double *) red_arr_mem_235525)[sext_i32_i64(local_tid_235512 +\n                                                           offset_235529)];\n                x_221859 = ((__local\n",
            "                             double *) red_arr_mem_235527)[sext_i32_i64(local_tid_235512 +\n                                                           offset_235529)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_221860 = x_221854 + x_221857;\n                double defunc_1_op_res_221861 = x_221855 + x_221858;\n                double defunc_1_op_res_221862 = x_221856 + x_221859;\n                \n                x_221854 = defunc_1_op_res_221860;\n                x_221855 = defunc_1_op_res_221861;\n                x_221856 = defunc_1_op_res_221862;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_235523)[sext_i32_i64(local_tid_235512)] =\n                    x_221854;\n                ((__local\n                  double *) red_arr_mem_235525)[sext_i32_i64(local_tid_235512)] =\n                    x_221855;\n                ((__local\n                  double *) red_arr_mem_235527)[sext_i32_i64(local_tid_235512)] =\n                    x_221856;\n            }\n        }\n        skip_waves_235530 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_221847 = ((__local\n                                   double *) red_arr_mem_235523)[(int64_t) 0];\n    defunc_2_reduce_res_221848 = ((__local\n                                   double *) red_arr_mem_235525)[(int64_t) 0];\n    defunc_2_reduce_res_221849 = ((__local\n                                   double *) red_arr_mem_235527)[(int64_t) 0];\n    \n    double x_221883 = defunc_2_reduce_res_221847 * defunc_2_reduce_res_221849;\n    double y_221884 = defunc_2_reduce_res_221848 * defunc_2_reduce_res_221848;\n    double y_221885 = x_221883 - y_221884;\n    double det1_221886 = 1.0 / y_221885;\n    double a11_221887 = defunc_2_reduce_res_221849 * det1_221886;\n    double x_221888 = 0.0 - defunc_2_reduce_res_221848;\n    double b11_221889 = det1_221886 * x_221888;\n    double c11_221890 = d",
            "efunc_2_reduce_res_221847 * det1_221886;\n    double defunc_2_reduce_res_221891;\n    double defunc_2_reduce_res_221892;\n    int64_t gtid_221893 = sext_i32_i64(sext_i64_i32(ltid_pre_235516));\n    int32_t phys_tid_221894 = local_tid_235512;\n    __local unsigned char *red_arr_mem_235531;\n    \n    red_arr_mem_235531 = (__local unsigned char *) red_arr_mem_235531_backing_5;\n    \n    __local unsigned char *red_arr_mem_235533;\n    \n    red_arr_mem_235533 = (__local unsigned char *) red_arr_mem_235533_backing_6;\n    \n    double x_221902;\n    \n    x_221902 = ((__local double *) color_232033)[gtid_221893];\n    \n    double x_221903;\n    \n    x_221903 = ((__local double *) color_232034)[gtid_221893];\n    \n    bool cond_221904 = sle64(n_203490, gtid_221893);\n    double defunc_0_f_res_221905;\n    \n    if (cond_221904) {\n        defunc_0_f_res_221905 = 0.0;\n    } else {\n        int64_t i_221906 = add64(x_221842, gtid_221893);\n        double defunc_0_add_arg_221907;\n        \n        defunc_0_add_arg_221907 = ((__global double *) mem_230551)[gtid_221834 *\n                                                                   n_203490 +\n                                                                   i_221906];\n        defunc_0_f_res_221905 = defunc_0_add_arg_221907;\n    }\n    \n    double x_221908 = a11_221887 * x_221902;\n    double y_221909 = b11_221889 * x_221903;\n    double x_221910 = x_221908 + y_221909;\n    double defunc_9_fit_fun_res_221911 = defunc_0_f_res_221905 * x_221910;\n    double x_221912 = b11_221889 * x_221902;\n    double y_221913 = c11_221890 * x_221903;\n    double x_221914 = x_221912 + y_221913;\n    double defunc_9_slope_fun_res_221915 = defunc_0_f_res_221905 * x_221914;\n    \n    ((__local double *) red_arr_mem_235531)[gtid_221893] =\n        defunc_9_fit_fun_res_221911;\n    ((__local double *) red_arr_mem_235533)[gtid_221893] =\n        defunc_9_slope_fun_res_221915;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_235535;\n    int32_t skip_waves_235536 = 1;\n    ",
            "double x_221895;\n    double x_221896;\n    double x_221897;\n    double x_221898;\n    \n    offset_235535 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_235512, sext_i64_i32(q_l_203495))) {\n            x_221895 = ((__local\n                         double *) red_arr_mem_235531)[sext_i32_i64(local_tid_235512 +\n                                                       offset_235535)];\n            x_221896 = ((__local\n                         double *) red_arr_mem_235533)[sext_i32_i64(local_tid_235512 +\n                                                       offset_235535)];\n        }\n    }\n    offset_235535 = 1;\n    while (slt32(offset_235535, wave_sizze_235514)) {\n        if (slt32(local_tid_235512 + offset_235535, sext_i64_i32(q_l_203495)) &&\n            ((local_tid_235512 - squot32(local_tid_235512, wave_sizze_235514) *\n              wave_sizze_235514) & (2 * offset_235535 - 1)) == 0) {\n            // read array element\n            {\n                x_221897 = ((volatile __local\n                             double *) red_arr_mem_235531)[sext_i32_i64(local_tid_235512 +\n                                                           offset_235535)];\n                x_221898 = ((volatile __local\n                             double *) red_arr_mem_235533)[sext_i32_i64(local_tid_235512 +\n                                                           offset_235535)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_221899 = x_221895 + x_221897;\n                double defunc_1_op_res_221900 = x_221896 + x_221898;\n                \n                x_221895 = defunc_1_op_res_221899;\n                x_221896 = defunc_1_op_res_221900;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_235531)[sext_i32_i64(local_tid_235512)] =\n                    x_221895;\n                ((volatile __local\n          ",
            "        double *) red_arr_mem_235533)[sext_i32_i64(local_tid_235512)] =\n                    x_221896;\n            }\n        }\n        offset_235535 *= 2;\n    }\n    while (slt32(skip_waves_235536, squot32(sext_i64_i32(q_l_203495) +\n                                            wave_sizze_235514 - 1,\n                                            wave_sizze_235514))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_235535 = skip_waves_235536 * wave_sizze_235514;\n        if (slt32(local_tid_235512 + offset_235535, sext_i64_i32(q_l_203495)) &&\n            ((local_tid_235512 - squot32(local_tid_235512, wave_sizze_235514) *\n              wave_sizze_235514) == 0 && (squot32(local_tid_235512,\n                                                  wave_sizze_235514) & (2 *\n                                                                        skip_waves_235536 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_221897 = ((__local\n                             double *) red_arr_mem_235531)[sext_i32_i64(local_tid_235512 +\n                                                           offset_235535)];\n                x_221898 = ((__local\n                             double *) red_arr_mem_235533)[sext_i32_i64(local_tid_235512 +\n                                                           offset_235535)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_221899 = x_221895 + x_221897;\n                double defunc_1_op_res_221900 = x_221896 + x_221898;\n                \n                x_221895 = defunc_1_op_res_221899;\n                x_221896 = defunc_1_op_res_221900;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_235531)[sext_i32_i64(local_tid_235512)] =\n                    x_221895;\n                ((__local\n                  double",
            " *) red_arr_mem_235533)[sext_i32_i64(local_tid_235512)] =\n                    x_221896;\n            }\n        }\n        skip_waves_235536 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_221891 = ((__local\n                                   double *) red_arr_mem_235531)[(int64_t) 0];\n    defunc_2_reduce_res_221892 = ((__local\n                                   double *) red_arr_mem_235533)[(int64_t) 0];\n    if (local_tid_235512 == 0) {\n        ((__global double *) mem_230874)[gtid_221834 * l_n_m_203643 +\n                                         gtid_221835] =\n            defunc_2_reduce_res_221891;\n    }\n    if (local_tid_235512 == 0) {\n        ((__global double *) mem_230878)[gtid_221834 * l_n_m_203643 +\n                                         gtid_221835] =\n            defunc_2_reduce_res_221892;\n    }\n    \n  error_4:\n    return;\n}\n__kernel void mainzisegmap_intragroup_222093(__global int *global_failure,\n                                             uint red_arr_mem_235563_backing_offset_0,\n                                             uint red_arr_mem_235561_backing_offset_1,\n                                             uint red_arr_mem_235557_backing_offset_2,\n                                             uint red_arr_mem_235555_backing_offset_3,\n                                             uint red_arr_mem_235553_backing_offset_4,\n                                             uint red_arr_mem_235551_backing_offset_5,\n                                             uint red_arr_mem_235549_backing_offset_6,\n                                             uint color_232038_backing_offset_7,\n                                             uint color_232037_backing_offset_8,\n                                             uint color_232036_backing_offset_9,\n                                             uint color_232035_backing_offset_10,\n                                             int64_t n_203490,\n                                             int64_t q_l_203",
            "495,\n                                             int64_t jump_t_203500,\n                                             int64_t partition_sizze_203577,\n                                             int64_t l_n_m_203643,\n                                             int64_t i_203670,\n                                             int64_t ctx_param_ext_229488,\n                                             int64_t ctx_param_ext_229489,\n                                             int64_t ctx_param_ext_229491,\n                                             __global\n                                             unsigned char *ext_mem_229411,\n                                             __global\n                                             unsigned char *ext_mem_229412,\n                                             __global\n                                             unsigned char *mem_param_229493,\n                                             __global unsigned char *mem_230551,\n                                             __global unsigned char *mem_230898,\n                                             __global unsigned char *mem_230902)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_235563_backing_10 =\n                           &shared_mem[red_arr_mem_235563_backing_offset_0];\n    volatile unsigned char *red_arr_mem_235561_backing_9 =\n                           &shared_mem[red_arr_mem_235561_backing_offset_1];\n    volatile unsigned char *red_arr_mem_235557_backing_8 =\n                           &shared_mem[red_arr_mem_235557_backing_offset_2];\n    volatile unsigned char *red_arr_mem_235555_backing_7 =\n                           &shared_mem[red_arr_mem_235555_backing_offset_3];\n    volatile unsigned char *red_arr_mem_235553_backing_6 =\n                           &shared_mem[red_arr_mem_235553_backing_offset_4];\n    volatile unsigned char *red_arr_mem_235551_backing_5 =\n                           &",
            "shared_mem[red_arr_mem_235551_backing_offset_5];\n    volatile unsigned char *red_arr_mem_235549_backing_4 =\n                           &shared_mem[red_arr_mem_235549_backing_offset_6];\n    volatile unsigned char *color_232038_backing_3 =\n                           &shared_mem[color_232038_backing_offset_7];\n    volatile unsigned char *color_232037_backing_2 =\n                           &shared_mem[color_232037_backing_offset_8];\n    volatile unsigned char *color_232036_backing_1 =\n                           &shared_mem[color_232036_backing_offset_9];\n    volatile unsigned char *color_232035_backing_0 =\n                           &shared_mem[color_232035_backing_offset_10];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235537;\n    int32_t local_tid_235538;\n    int64_t group_sizze_235541;\n    int32_t wave_sizze_235540;\n    int32_t group_tid_235539;\n    \n    global_tid_235537 = get_global_id(0);\n    local_tid_235538 = get_local_id(0);\n    group_sizze_235541 = get_local_size(0);\n    wave_sizze_235540 = LOCKSTEP_WIDTH;\n    group_tid_235539 = get_group_id(0);\n    \n    int32_t phys_tid_222093 = group_tid_235539;\n    int64_t slice_235543 = q_l_203495;\n    int64_t ltid_pre_235542 = sext_i32_i64(local_tid_235538);\n    int64_t remnant_235544 = sext_i32_i64(local_tid_235538) - ltid_pre_235542;\n    int64_t slice_235545 = l_n_m_203643;\n    int64_t slice_235546 = partition_sizze_203577 * slice_235545;\n    int64_t gtid_222091 = squot64(sext_i32_i64(group_tid_235539), slice_235545);\n    int64_t remnant_235547 = sext_i32_i64(group_tid_235539) - gtid_222091 *\n            slice_235545;\n    int64_t gtid_222092 = remnant_235547;\n    int64_t remnant_235548 = remnant_235547 - gtid_222092;\n    __local unsigned char *color_232035;\n    \n    color_232035 = (__local unsigned char *) color_232035_backing_0;\n    \n    __local unsigned char *color_232036;\n    \n    color_232036 = (__local unsigned char *) color_232036_backing_1;\n    \n    __local unsigned char *color_",
            "232037;\n    \n    color_232037 = (__local unsigned char *) color_232037_backing_2;\n    \n    __local unsigned char *color_232038;\n    \n    color_232038 = (__local unsigned char *) color_232038_backing_3;\n    \n    int64_t x_222099;\n    \n    x_222099 = ((__global int64_t *) ext_mem_229412)[gtid_222091 *\n                                                     l_n_m_203643 +\n                                                     gtid_222092];\n    \n    double x_222100;\n    \n    x_222100 = ((__global double *) ext_mem_229411)[gtid_222091 * l_n_m_203643 +\n                                                    gtid_222092];\n    \n    int64_t min_arg_222101 = mul64(jump_t_203500, gtid_222092);\n    int64_t min_res_222102 = smin64(i_203670, min_arg_222101);\n    int64_t defunc_0_g_res_222103 = add64((int64_t) 1, min_res_222102);\n    int64_t gtid_222106 = sext_i32_i64(sext_i64_i32(ltid_pre_235542));\n    int32_t phys_tid_222107 = local_tid_235538;\n    bool cond_222109 = sle64(n_203490, gtid_222106);\n    int64_t defunc_0_f_res_222110;\n    \n    if (cond_222109) {\n        defunc_0_f_res_222110 = (int64_t) 0;\n    } else {\n        int64_t i_222111 = add64(x_222099, gtid_222106);\n        int64_t defunc_1_add_res_222112 = add64((int64_t) 1, i_222111);\n        \n        defunc_0_f_res_222110 = defunc_1_add_res_222112;\n    }\n    \n    double defunc_0_f_res_222113;\n    \n    if (cond_222109) {\n        defunc_0_f_res_222113 = 0.0;\n    } else {\n        int64_t i_222114 = add64(x_222099, gtid_222106);\n        double defunc_0_add_arg_222115;\n        \n        defunc_0_add_arg_222115 = ((__global\n                                    double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                                (gtid_222091 *\n                                                                 ctx_param_ext_229489 +\n                                                                 i_222114 *\n                                                                 ctx_param_ext_229491)];\n ",
            "       defunc_0_f_res_222113 = defunc_0_add_arg_222115;\n    }\n    \n    int64_t binop_p_222116 = sub64(defunc_0_f_res_222110,\n                                   defunc_0_g_res_222103);\n    double defunc_0_f_res_222117 = sitofp_i64_f64(binop_p_222116);\n    double abs_res_222118 = fabs(defunc_0_f_res_222117);\n    double tmp1_222119 = abs_res_222118 / x_222100;\n    double x_222120 = tmp1_222119 * tmp1_222119;\n    double y_222121 = tmp1_222119 * x_222120;\n    double tmp2_222122 = 1.0 - y_222121;\n    double x_222123 = tmp2_222122 * tmp2_222122;\n    double tmp3_222124 = tmp2_222122 * x_222123;\n    double tmp4_222125 = defunc_0_f_res_222113 * tmp3_222124;\n    \n    ((__local double *) color_232038)[gtid_222106] = defunc_0_f_res_222117;\n    ((__local double *) color_232037)[gtid_222106] = tmp4_222125;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    double defunc_2_reduce_res_222126;\n    double defunc_2_reduce_res_222127;\n    double defunc_2_reduce_res_222128;\n    double defunc_2_reduce_res_222129;\n    double defunc_2_reduce_res_222130;\n    int64_t gtid_222133 = sext_i32_i64(sext_i64_i32(ltid_pre_235542));\n    int32_t phys_tid_222134 = local_tid_235538;\n    __local unsigned char *red_arr_mem_235549;\n    \n    red_arr_mem_235549 = (__local unsigned char *) red_arr_mem_235549_backing_4;\n    \n    __local unsigned char *red_arr_mem_235551;\n    \n    red_arr_mem_235551 = (__local unsigned char *) red_arr_mem_235551_backing_5;\n    \n    __local unsigned char *red_arr_mem_235553;\n    \n    red_arr_mem_235553 = (__local unsigned char *) red_arr_mem_235553_backing_6;\n    \n    __local unsigned char *red_arr_mem_235555;\n    \n    red_arr_mem_235555 = (__local unsigned char *) red_arr_mem_235555_backing_7;\n    \n    __local unsigned char *red_arr_mem_235557;\n    \n    red_arr_mem_235557 = (__local unsigned char *) red_arr_mem_235557_backing_8;\n    \n    double x_222150;\n    \n    x_222150 = ((__local double *) color_232038)[gtid_222133];\n    \n    double x_222151;\n    \n    x_222151 = ((__local double *)",
            " color_232037)[gtid_222133];\n    \n    double defunc_1_f_res_222152 = x_222150 * x_222151;\n    double defunc_1_f_res_222153 = x_222150 * defunc_1_f_res_222152;\n    double defunc_1_f_res_222154 = x_222150 * defunc_1_f_res_222153;\n    double defunc_1_f_res_222155 = x_222150 * defunc_1_f_res_222154;\n    \n    ((__local double *) red_arr_mem_235549)[gtid_222133] = x_222151;\n    ((__local double *) red_arr_mem_235551)[gtid_222133] =\n        defunc_1_f_res_222152;\n    ((__local double *) red_arr_mem_235553)[gtid_222133] =\n        defunc_1_f_res_222153;\n    ((__local double *) red_arr_mem_235555)[gtid_222133] =\n        defunc_1_f_res_222154;\n    ((__local double *) red_arr_mem_235557)[gtid_222133] =\n        defunc_1_f_res_222155;\n    ((__local double *) color_232036)[gtid_222133] = defunc_1_f_res_222153;\n    ((__local double *) color_232035)[gtid_222133] = defunc_1_f_res_222152;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_235559;\n    int32_t skip_waves_235560 = 1;\n    double x_222135;\n    double x_222136;\n    double x_222137;\n    double x_222138;\n    double x_222139;\n    double x_222140;\n    double x_222141;\n    double x_222142;\n    double x_222143;\n    double x_222144;\n    \n    offset_235559 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_235538, sext_i64_i32(q_l_203495))) {\n            x_222135 = ((__local\n                         double *) red_arr_mem_235549)[sext_i32_i64(local_tid_235538 +\n                                                       offset_235559)];\n            x_222136 = ((__local\n                         double *) red_arr_mem_235551)[sext_i32_i64(local_tid_235538 +\n                                                       offset_235559)];\n            x_222137 = ((__local\n                         double *) red_arr_mem_235553)[sext_i32_i64(local_tid_235538 +\n                                                       offset_235559)];\n            x_222138 = ((__local\n                         double *) red_arr_m",
            "em_235555)[sext_i32_i64(local_tid_235538 +\n                                                       offset_235559)];\n            x_222139 = ((__local\n                         double *) red_arr_mem_235557)[sext_i32_i64(local_tid_235538 +\n                                                       offset_235559)];\n        }\n    }\n    offset_235559 = 1;\n    while (slt32(offset_235559, wave_sizze_235540)) {\n        if (slt32(local_tid_235538 + offset_235559, sext_i64_i32(q_l_203495)) &&\n            ((local_tid_235538 - squot32(local_tid_235538, wave_sizze_235540) *\n              wave_sizze_235540) & (2 * offset_235559 - 1)) == 0) {\n            // read array element\n            {\n                x_222140 = ((volatile __local\n                             double *) red_arr_mem_235549)[sext_i32_i64(local_tid_235538 +\n                                                           offset_235559)];\n                x_222141 = ((volatile __local\n                             double *) red_arr_mem_235551)[sext_i32_i64(local_tid_235538 +\n                                                           offset_235559)];\n                x_222142 = ((volatile __local\n                             double *) red_arr_mem_235553)[sext_i32_i64(local_tid_235538 +\n                                                           offset_235559)];\n                x_222143 = ((volatile __local\n                             double *) red_arr_mem_235555)[sext_i32_i64(local_tid_235538 +\n                                                           offset_235559)];\n                x_222144 = ((volatile __local\n                             double *) red_arr_mem_235557)[sext_i32_i64(local_tid_235538 +\n                                                           offset_235559)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_222145 = x_222135 + x_222140;\n                double defunc_1_op_res_222146 = x_222136 + x_222141;\n                double defunc_1_op_res_222147 = x_2",
            "22137 + x_222142;\n                double defunc_1_op_res_222148 = x_222138 + x_222143;\n                double defunc_1_op_res_222149 = x_222139 + x_222144;\n                \n                x_222135 = defunc_1_op_res_222145;\n                x_222136 = defunc_1_op_res_222146;\n                x_222137 = defunc_1_op_res_222147;\n                x_222138 = defunc_1_op_res_222148;\n                x_222139 = defunc_1_op_res_222149;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_235549)[sext_i32_i64(local_tid_235538)] =\n                    x_222135;\n                ((volatile __local\n                  double *) red_arr_mem_235551)[sext_i32_i64(local_tid_235538)] =\n                    x_222136;\n                ((volatile __local\n                  double *) red_arr_mem_235553)[sext_i32_i64(local_tid_235538)] =\n                    x_222137;\n                ((volatile __local\n                  double *) red_arr_mem_235555)[sext_i32_i64(local_tid_235538)] =\n                    x_222138;\n                ((volatile __local\n                  double *) red_arr_mem_235557)[sext_i32_i64(local_tid_235538)] =\n                    x_222139;\n            }\n        }\n        offset_235559 *= 2;\n    }\n    while (slt32(skip_waves_235560, squot32(sext_i64_i32(q_l_203495) +\n                                            wave_sizze_235540 - 1,\n                                            wave_sizze_235540))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_235559 = skip_waves_235560 * wave_sizze_235540;\n        if (slt32(local_tid_235538 + offset_235559, sext_i64_i32(q_l_203495)) &&\n            ((local_tid_235538 - squot32(local_tid_235538, wave_sizze_235540) *\n              wave_sizze_235540) == 0 && (squot32(local_tid_235538,\n                                                  wave_sizze_235540) & (2 *\n                                                                        skip_waves_235560 -\n       ",
            "                                                                 1)) ==\n             0)) {\n            // read array element\n            {\n                x_222140 = ((__local\n                             double *) red_arr_mem_235549)[sext_i32_i64(local_tid_235538 +\n                                                           offset_235559)];\n                x_222141 = ((__local\n                             double *) red_arr_mem_235551)[sext_i32_i64(local_tid_235538 +\n                                                           offset_235559)];\n                x_222142 = ((__local\n                             double *) red_arr_mem_235553)[sext_i32_i64(local_tid_235538 +\n                                                           offset_235559)];\n                x_222143 = ((__local\n                             double *) red_arr_mem_235555)[sext_i32_i64(local_tid_235538 +\n                                                           offset_235559)];\n                x_222144 = ((__local\n                             double *) red_arr_mem_235557)[sext_i32_i64(local_tid_235538 +\n                                                           offset_235559)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_222145 = x_222135 + x_222140;\n                double defunc_1_op_res_222146 = x_222136 + x_222141;\n                double defunc_1_op_res_222147 = x_222137 + x_222142;\n                double defunc_1_op_res_222148 = x_222138 + x_222143;\n                double defunc_1_op_res_222149 = x_222139 + x_222144;\n                \n                x_222135 = defunc_1_op_res_222145;\n                x_222136 = defunc_1_op_res_222146;\n                x_222137 = defunc_1_op_res_222147;\n                x_222138 = defunc_1_op_res_222148;\n                x_222139 = defunc_1_op_res_222149;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_235549)[sext_i32_i64",
            "(local_tid_235538)] =\n                    x_222135;\n                ((__local\n                  double *) red_arr_mem_235551)[sext_i32_i64(local_tid_235538)] =\n                    x_222136;\n                ((__local\n                  double *) red_arr_mem_235553)[sext_i32_i64(local_tid_235538)] =\n                    x_222137;\n                ((__local\n                  double *) red_arr_mem_235555)[sext_i32_i64(local_tid_235538)] =\n                    x_222138;\n                ((__local\n                  double *) red_arr_mem_235557)[sext_i32_i64(local_tid_235538)] =\n                    x_222139;\n            }\n        }\n        skip_waves_235560 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_222126 = ((__local\n                                   double *) red_arr_mem_235549)[(int64_t) 0];\n    defunc_2_reduce_res_222127 = ((__local\n                                   double *) red_arr_mem_235551)[(int64_t) 0];\n    defunc_2_reduce_res_222128 = ((__local\n                                   double *) red_arr_mem_235553)[(int64_t) 0];\n    defunc_2_reduce_res_222129 = ((__local\n                                   double *) red_arr_mem_235555)[(int64_t) 0];\n    defunc_2_reduce_res_222130 = ((__local\n                                   double *) red_arr_mem_235557)[(int64_t) 0];\n    \n    double x_222156 = defunc_2_reduce_res_222128 * defunc_2_reduce_res_222130;\n    double y_222157 = defunc_2_reduce_res_222129 * defunc_2_reduce_res_222129;\n    double a12_222158 = x_222156 - y_222157;\n    double x_222159 = defunc_2_reduce_res_222128 * defunc_2_reduce_res_222129;\n    double y_222160 = defunc_2_reduce_res_222127 * defunc_2_reduce_res_222130;\n    double b12_222161 = x_222159 - y_222160;\n    double x_222162 = defunc_2_reduce_res_222127 * defunc_2_reduce_res_222129;\n    double y_222163 = defunc_2_reduce_res_222128 * defunc_2_reduce_res_222128;\n    double c12_222164 = x_222162 - y_222163;\n    double x_222165 = defunc_2_reduce_res_222126 * defunc_2_reduce_res_22213",
            "0;\n    double b2_222166 = x_222165 - y_222163;\n    double x_222167 = defunc_2_reduce_res_222127 * defunc_2_reduce_res_222128;\n    double y_222168 = defunc_2_reduce_res_222126 * defunc_2_reduce_res_222129;\n    double c2_222169 = x_222167 - y_222168;\n    double x_222170 = defunc_2_reduce_res_222126 * a12_222158;\n    double y_222171 = defunc_2_reduce_res_222127 * b12_222161;\n    double x_222172 = x_222170 + y_222171;\n    double y_222173 = defunc_2_reduce_res_222128 * c12_222164;\n    double y_222174 = x_222172 + y_222173;\n    double det_222175 = 1.0 / y_222174;\n    double a12_222176 = a12_222158 * det_222175;\n    double b12_222177 = b12_222161 * det_222175;\n    double c12_222178 = c12_222164 * det_222175;\n    double b2_222179 = b2_222166 * det_222175;\n    double c2_222180 = c2_222169 * det_222175;\n    double defunc_2_reduce_res_222181;\n    double defunc_2_reduce_res_222182;\n    int64_t gtid_222183 = sext_i32_i64(sext_i64_i32(ltid_pre_235542));\n    int32_t phys_tid_222184 = local_tid_235538;\n    __local unsigned char *red_arr_mem_235561;\n    \n    red_arr_mem_235561 = (__local unsigned char *) red_arr_mem_235561_backing_9;\n    \n    __local unsigned char *red_arr_mem_235563;\n    \n    red_arr_mem_235563 = (__local\n                          unsigned char *) red_arr_mem_235563_backing_10;\n    \n    double x_222192;\n    \n    x_222192 = ((__local double *) color_232037)[gtid_222183];\n    \n    double x_222193;\n    \n    x_222193 = ((__local double *) color_232035)[gtid_222183];\n    \n    double x_222194;\n    \n    x_222194 = ((__local double *) color_232036)[gtid_222183];\n    \n    bool cond_222195 = sle64(n_203490, gtid_222183);\n    double defunc_0_f_res_222196;\n    \n    if (cond_222195) {\n        defunc_0_f_res_222196 = 0.0;\n    } else {\n        int64_t i_222197 = add64(x_222099, gtid_222183);\n        double defunc_0_add_arg_222198;\n        \n        defunc_0_add_arg_222198 = ((__global double *) mem_230551)[gtid_222091 *\n                                                             ",
            "      n_203490 +\n                                                                   i_222197];\n        defunc_0_f_res_222196 = defunc_0_add_arg_222198;\n    }\n    \n    double x_222199 = a12_222176 * x_222192;\n    double y_222200 = b12_222177 * x_222193;\n    double x_222201 = x_222199 + y_222200;\n    double y_222202 = c12_222178 * x_222194;\n    double x_222203 = x_222201 + y_222202;\n    double defunc_9_fit_fun_res_222204 = defunc_0_f_res_222196 * x_222203;\n    double x_222205 = b12_222177 * x_222192;\n    double y_222206 = b2_222179 * x_222193;\n    double x_222207 = x_222205 + y_222206;\n    double y_222208 = c2_222180 * x_222194;\n    double x_222209 = x_222207 + y_222208;\n    double defunc_9_slope_fun_res_222210 = defunc_0_f_res_222196 * x_222209;\n    \n    ((__local double *) red_arr_mem_235561)[gtid_222183] =\n        defunc_9_fit_fun_res_222204;\n    ((__local double *) red_arr_mem_235563)[gtid_222183] =\n        defunc_9_slope_fun_res_222210;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_235565;\n    int32_t skip_waves_235566 = 1;\n    double x_222185;\n    double x_222186;\n    double x_222187;\n    double x_222188;\n    \n    offset_235565 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_235538, sext_i64_i32(q_l_203495))) {\n            x_222185 = ((__local\n                         double *) red_arr_mem_235561)[sext_i32_i64(local_tid_235538 +\n                                                       offset_235565)];\n            x_222186 = ((__local\n                         double *) red_arr_mem_235563)[sext_i32_i64(local_tid_235538 +\n                                                       offset_235565)];\n        }\n    }\n    offset_235565 = 1;\n    while (slt32(offset_235565, wave_sizze_235540)) {\n        if (slt32(local_tid_235538 + offset_235565, sext_i64_i32(q_l_203495)) &&\n            ((local_tid_235538 - squot32(local_tid_235538, wave_sizze_235540) *\n              wave_sizze_235540) & (2 * offset_235565 - 1)) == 0) {\n  ",
            "          // read array element\n            {\n                x_222187 = ((volatile __local\n                             double *) red_arr_mem_235561)[sext_i32_i64(local_tid_235538 +\n                                                           offset_235565)];\n                x_222188 = ((volatile __local\n                             double *) red_arr_mem_235563)[sext_i32_i64(local_tid_235538 +\n                                                           offset_235565)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_222189 = x_222185 + x_222187;\n                double defunc_1_op_res_222190 = x_222186 + x_222188;\n                \n                x_222185 = defunc_1_op_res_222189;\n                x_222186 = defunc_1_op_res_222190;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_235561)[sext_i32_i64(local_tid_235538)] =\n                    x_222185;\n                ((volatile __local\n                  double *) red_arr_mem_235563)[sext_i32_i64(local_tid_235538)] =\n                    x_222186;\n            }\n        }\n        offset_235565 *= 2;\n    }\n    while (slt32(skip_waves_235566, squot32(sext_i64_i32(q_l_203495) +\n                                            wave_sizze_235540 - 1,\n                                            wave_sizze_235540))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_235565 = skip_waves_235566 * wave_sizze_235540;\n        if (slt32(local_tid_235538 + offset_235565, sext_i64_i32(q_l_203495)) &&\n            ((local_tid_235538 - squot32(local_tid_235538, wave_sizze_235540) *\n              wave_sizze_235540) == 0 && (squot32(local_tid_235538,\n                                                  wave_sizze_235540) & (2 *\n                                                                        skip_waves_235566 -\n                                                                        1)) ==",
            "\n             0)) {\n            // read array element\n            {\n                x_222187 = ((__local\n                             double *) red_arr_mem_235561)[sext_i32_i64(local_tid_235538 +\n                                                           offset_235565)];\n                x_222188 = ((__local\n                             double *) red_arr_mem_235563)[sext_i32_i64(local_tid_235538 +\n                                                           offset_235565)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_222189 = x_222185 + x_222187;\n                double defunc_1_op_res_222190 = x_222186 + x_222188;\n                \n                x_222185 = defunc_1_op_res_222189;\n                x_222186 = defunc_1_op_res_222190;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_235561)[sext_i32_i64(local_tid_235538)] =\n                    x_222185;\n                ((__local\n                  double *) red_arr_mem_235563)[sext_i32_i64(local_tid_235538)] =\n                    x_222186;\n            }\n        }\n        skip_waves_235566 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_222181 = ((__local\n                                   double *) red_arr_mem_235561)[(int64_t) 0];\n    defunc_2_reduce_res_222182 = ((__local\n                                   double *) red_arr_mem_235563)[(int64_t) 0];\n    if (local_tid_235538 == 0) {\n        ((__global double *) mem_230898)[gtid_222091 * l_n_m_203643 +\n                                         gtid_222092] =\n            defunc_2_reduce_res_222181;\n    }\n    if (local_tid_235538 == 0) {\n        ((__global double *) mem_230902)[gtid_222091 * l_n_m_203643 +\n                                         gtid_222092] =\n            defunc_2_reduce_res_222182;\n    }\n    \n  error_5:\n    return;\n}\n__kernel void mainzisegmap_intragroup_225917(__global int *global_failure",
            ",\n                                             uint red_arr_mem_236423_backing_offset_0,\n                                             uint red_arr_mem_236419_backing_offset_1,\n                                             uint color_232053_backing_offset_2,\n                                             int64_t n_203490,\n                                             int64_t q_t_203494,\n                                             int64_t jump_t_203500,\n                                             int64_t partition_sizze_203577,\n                                             int64_t t_n_m_203650,\n                                             int64_t i_203670, __global\n                                             unsigned char *ext_mem_229196,\n                                             __global\n                                             unsigned char *ext_mem_229197,\n                                             __global\n                                             unsigned char *ext_mem_229460,\n                                             __global\n                                             unsigned char *ext_mem_229461,\n                                             __global unsigned char *mem_231416,\n                                             __global unsigned char *mem_231420,\n                                             __global unsigned char *mem_231430)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_236423_backing_2 =\n                           &shared_mem[red_arr_mem_236423_backing_offset_0];\n    volatile unsigned char *red_arr_mem_236419_backing_1 =\n                           &shared_mem[red_arr_mem_236419_backing_offset_1];\n    volatile unsigned char *color_232053_backing_0 =\n                           &shared_mem[color_232053_backing_offset_2];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236407;\n    int32_t local_tid_236408;\n    int64_t group",
            "_sizze_236411;\n    int32_t wave_sizze_236410;\n    int32_t group_tid_236409;\n    \n    global_tid_236407 = get_global_id(0);\n    local_tid_236408 = get_local_id(0);\n    group_sizze_236411 = get_local_size(0);\n    wave_sizze_236410 = LOCKSTEP_WIDTH;\n    group_tid_236409 = get_group_id(0);\n    \n    int32_t phys_tid_225917 = group_tid_236409;\n    int64_t slice_236413 = q_t_203494;\n    int64_t ltid_pre_236412 = sext_i32_i64(local_tid_236408);\n    int64_t remnant_236414 = sext_i32_i64(local_tid_236408) - ltid_pre_236412;\n    int64_t slice_236415 = t_n_m_203650;\n    int64_t slice_236416 = partition_sizze_203577 * slice_236415;\n    int64_t gtid_225915 = squot64(sext_i32_i64(group_tid_236409), slice_236415);\n    int64_t remnant_236417 = sext_i32_i64(group_tid_236409) - gtid_225915 *\n            slice_236415;\n    int64_t gtid_225916 = remnant_236417;\n    int64_t remnant_236418 = remnant_236417 - gtid_225916;\n    __local unsigned char *color_232053;\n    \n    color_232053 = (__local unsigned char *) color_232053_backing_0;\n    \n    int64_t x_225920;\n    \n    x_225920 = ((__global int64_t *) ext_mem_229196)[gtid_225915];\n    \n    int64_t x_225926;\n    \n    x_225926 = ((__global int64_t *) ext_mem_229461)[gtid_225915 *\n                                                     t_n_m_203650 +\n                                                     gtid_225916];\n    \n    double x_225927;\n    \n    x_225927 = ((__global double *) ext_mem_229460)[gtid_225915 * t_n_m_203650 +\n                                                    gtid_225916];\n    \n    int64_t min_arg_225928 = mul64(jump_t_203500, gtid_225916);\n    int64_t min_res_225929 = smin64(i_203670, min_arg_225928);\n    int64_t defunc_0_g_res_225930 = add64((int64_t) 1, min_res_225929);\n    double defunc_2_reduce_res_225931;\n    int64_t gtid_225933 = sext_i32_i64(sext_i64_i32(ltid_pre_236412));\n    int32_t phys_tid_225934 = local_tid_236408;\n    __local unsigned char *red_arr_mem_236419;\n    \n    red_arr_mem_236419 = (__local unsigned char *",
            ") red_arr_mem_236419_backing_1;\n    \n    bool cond_225939 = sle64(x_225920, gtid_225933);\n    int64_t defunc_0_f_res_225940;\n    \n    if (cond_225939) {\n        defunc_0_f_res_225940 = (int64_t) 0;\n    } else {\n        int64_t i_225941 = add64(x_225926, gtid_225933);\n        int64_t defunc_0_add_arg_225942;\n        \n        defunc_0_add_arg_225942 = ((__global\n                                    int64_t *) ext_mem_229197)[gtid_225915 *\n                                                               n_203490 +\n                                                               i_225941];\n        \n        int64_t defunc_1_add_res_225943 = add64((int64_t) 1,\n                                                defunc_0_add_arg_225942);\n        \n        defunc_0_f_res_225940 = defunc_1_add_res_225943;\n    }\n    \n    double defunc_0_f_res_225944;\n    \n    if (cond_225939) {\n        defunc_0_f_res_225944 = 0.0;\n    } else {\n        int64_t i_225945 = add64(x_225926, gtid_225933);\n        double defunc_0_add_arg_225946;\n        \n        defunc_0_add_arg_225946 = ((__global double *) mem_231416)[gtid_225915 *\n                                                                   n_203490 +\n                                                                   i_225945];\n        defunc_0_f_res_225944 = defunc_0_add_arg_225946;\n    }\n    \n    int64_t binop_p_225947 = sub64(defunc_0_f_res_225940,\n                                   defunc_0_g_res_225930);\n    double defunc_0_f_res_225948 = sitofp_i64_f64(binop_p_225947);\n    double abs_res_225949 = fabs(defunc_0_f_res_225948);\n    double tmp1_225950 = abs_res_225949 / x_225927;\n    double x_225951 = tmp1_225950 * tmp1_225950;\n    double y_225952 = tmp1_225950 * x_225951;\n    double tmp2_225953 = 1.0 - y_225952;\n    double x_225954 = tmp2_225953 * tmp2_225953;\n    double tmp3_225955 = tmp2_225953 * x_225954;\n    double tmp4_225956 = defunc_0_f_res_225944 * tmp3_225955;\n    \n    ((__local double *) red_arr_mem_236419)[gtid_225933] = tmp4_225956;\n  ",
            "  ((__local double *) color_232053)[gtid_225933] = tmp4_225956;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_236421;\n    int32_t skip_waves_236422 = 1;\n    double x_225935;\n    double x_225936;\n    \n    offset_236421 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_236408, sext_i64_i32(q_t_203494))) {\n            x_225935 = ((__local\n                         double *) red_arr_mem_236419)[sext_i32_i64(local_tid_236408 +\n                                                       offset_236421)];\n        }\n    }\n    offset_236421 = 1;\n    while (slt32(offset_236421, wave_sizze_236410)) {\n        if (slt32(local_tid_236408 + offset_236421, sext_i64_i32(q_t_203494)) &&\n            ((local_tid_236408 - squot32(local_tid_236408, wave_sizze_236410) *\n              wave_sizze_236410) & (2 * offset_236421 - 1)) == 0) {\n            // read array element\n            {\n                x_225936 = ((volatile __local\n                             double *) red_arr_mem_236419)[sext_i32_i64(local_tid_236408 +\n                                                           offset_236421)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_225937 = x_225935 + x_225936;\n                \n                x_225935 = defunc_1_op_res_225937;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_236419)[sext_i32_i64(local_tid_236408)] =\n                    x_225935;\n            }\n        }\n        offset_236421 *= 2;\n    }\n    while (slt32(skip_waves_236422, squot32(sext_i64_i32(q_t_203494) +\n                                            wave_sizze_236410 - 1,\n                                            wave_sizze_236410))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_236421 = skip_waves_236422 * wave_sizze_236410;\n        if (slt32(local_tid_236408 + offset_236421, sext_i64_i32(q_t_203494)) &",
            "&\n            ((local_tid_236408 - squot32(local_tid_236408, wave_sizze_236410) *\n              wave_sizze_236410) == 0 && (squot32(local_tid_236408,\n                                                  wave_sizze_236410) & (2 *\n                                                                        skip_waves_236422 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_225936 = ((__local\n                             double *) red_arr_mem_236419)[sext_i32_i64(local_tid_236408 +\n                                                           offset_236421)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_225937 = x_225935 + x_225936;\n                \n                x_225935 = defunc_1_op_res_225937;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_236419)[sext_i32_i64(local_tid_236408)] =\n                    x_225935;\n            }\n        }\n        skip_waves_236422 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_225931 = ((__local\n                                   double *) red_arr_mem_236419)[(int64_t) 0];\n    \n    double a0_225957 = 1.0 / defunc_2_reduce_res_225931;\n    double defunc_2_reduce_res_225958;\n    int64_t gtid_225959 = sext_i32_i64(sext_i64_i32(ltid_pre_236412));\n    int32_t phys_tid_225960 = local_tid_236408;\n    __local unsigned char *red_arr_mem_236423;\n    \n    red_arr_mem_236423 = (__local unsigned char *) red_arr_mem_236423_backing_2;\n    \n    double x_225965;\n    \n    x_225965 = ((__local double *) color_232053)[gtid_225959];\n    \n    bool cond_225966 = sle64(x_225920, gtid_225959);\n    double defunc_0_f_res_225967;\n    \n    if (cond_225966) {\n        defunc_0_f_res_225967 = 0.0;\n    } else {\n        int64_t i_225968 = add64(x_225926, gtid_225959);\n        double defunc_0_add",
            "_arg_225969;\n        \n        defunc_0_add_arg_225969 = ((__global double *) mem_231420)[gtid_225915 *\n                                                                   n_203490 +\n                                                                   i_225968];\n        defunc_0_f_res_225967 = defunc_0_add_arg_225969;\n    }\n    \n    double x_225970 = a0_225957 * x_225965;\n    double defunc_9_fit_fun_res_225971 = defunc_0_f_res_225967 * x_225970;\n    \n    ((__local double *) red_arr_mem_236423)[gtid_225959] =\n        defunc_9_fit_fun_res_225971;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_236425;\n    int32_t skip_waves_236426 = 1;\n    double x_225961;\n    double x_225962;\n    \n    offset_236425 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_236408, sext_i64_i32(q_t_203494))) {\n            x_225961 = ((__local\n                         double *) red_arr_mem_236423)[sext_i32_i64(local_tid_236408 +\n                                                       offset_236425)];\n        }\n    }\n    offset_236425 = 1;\n    while (slt32(offset_236425, wave_sizze_236410)) {\n        if (slt32(local_tid_236408 + offset_236425, sext_i64_i32(q_t_203494)) &&\n            ((local_tid_236408 - squot32(local_tid_236408, wave_sizze_236410) *\n              wave_sizze_236410) & (2 * offset_236425 - 1)) == 0) {\n            // read array element\n            {\n                x_225962 = ((volatile __local\n                             double *) red_arr_mem_236423)[sext_i32_i64(local_tid_236408 +\n                                                           offset_236425)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_225963 = x_225961 + x_225962;\n                \n                x_225961 = defunc_1_op_res_225963;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_236423)[sext_i32_i64(local_tid_2",
            "36408)] =\n                    x_225961;\n            }\n        }\n        offset_236425 *= 2;\n    }\n    while (slt32(skip_waves_236426, squot32(sext_i64_i32(q_t_203494) +\n                                            wave_sizze_236410 - 1,\n                                            wave_sizze_236410))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_236425 = skip_waves_236426 * wave_sizze_236410;\n        if (slt32(local_tid_236408 + offset_236425, sext_i64_i32(q_t_203494)) &&\n            ((local_tid_236408 - squot32(local_tid_236408, wave_sizze_236410) *\n              wave_sizze_236410) == 0 && (squot32(local_tid_236408,\n                                                  wave_sizze_236410) & (2 *\n                                                                        skip_waves_236426 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_225962 = ((__local\n                             double *) red_arr_mem_236423)[sext_i32_i64(local_tid_236408 +\n                                                           offset_236425)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_225963 = x_225961 + x_225962;\n                \n                x_225961 = defunc_1_op_res_225963;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_236423)[sext_i32_i64(local_tid_236408)] =\n                    x_225961;\n            }\n        }\n        skip_waves_236426 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_225958 = ((__local\n                                   double *) red_arr_mem_236423)[(int64_t) 0];\n    if (local_tid_236408 == 0) {\n        ((__global double *) mem_231430)[gtid_225915 * t_n_m_203650 +\n                                         gtid_225916] =\n            defunc_2_reduce_res_225958;\n    }\n    \n  error_",
            "4:\n    return;\n}\n__kernel void mainzisegmap_intragroup_226230(__global int *global_failure,\n                                             uint red_arr_mem_236469_backing_offset_0,\n                                             uint red_arr_mem_236467_backing_offset_1,\n                                             uint red_arr_mem_236463_backing_offset_2,\n                                             uint red_arr_mem_236461_backing_offset_3,\n                                             uint red_arr_mem_236459_backing_offset_4,\n                                             uint color_232055_backing_offset_5,\n                                             uint color_232054_backing_offset_6,\n                                             int64_t n_203490,\n                                             int64_t q_t_203494,\n                                             int64_t jump_t_203500,\n                                             int64_t partition_sizze_203577,\n                                             int64_t t_n_m_203650,\n                                             int64_t i_203670, __global\n                                             unsigned char *ext_mem_229196,\n                                             __global\n                                             unsigned char *ext_mem_229197,\n                                             __global\n                                             unsigned char *ext_mem_229460,\n                                             __global\n                                             unsigned char *ext_mem_229461,\n                                             __global unsigned char *mem_231440,\n                                             __global unsigned char *mem_231444,\n                                             __global unsigned char *mem_231457,\n                                             __global unsigned char *mem_231461)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsi",
            "gned char *red_arr_mem_236469_backing_6 =\n                           &shared_mem[red_arr_mem_236469_backing_offset_0];\n    volatile unsigned char *red_arr_mem_236467_backing_5 =\n                           &shared_mem[red_arr_mem_236467_backing_offset_1];\n    volatile unsigned char *red_arr_mem_236463_backing_4 =\n                           &shared_mem[red_arr_mem_236463_backing_offset_2];\n    volatile unsigned char *red_arr_mem_236461_backing_3 =\n                           &shared_mem[red_arr_mem_236461_backing_offset_3];\n    volatile unsigned char *red_arr_mem_236459_backing_2 =\n                           &shared_mem[red_arr_mem_236459_backing_offset_4];\n    volatile unsigned char *color_232055_backing_1 =\n                           &shared_mem[color_232055_backing_offset_5];\n    volatile unsigned char *color_232054_backing_0 =\n                           &shared_mem[color_232054_backing_offset_6];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236447;\n    int32_t local_tid_236448;\n    int64_t group_sizze_236451;\n    int32_t wave_sizze_236450;\n    int32_t group_tid_236449;\n    \n    global_tid_236447 = get_global_id(0);\n    local_tid_236448 = get_local_id(0);\n    group_sizze_236451 = get_local_size(0);\n    wave_sizze_236450 = LOCKSTEP_WIDTH;\n    group_tid_236449 = get_group_id(0);\n    \n    int32_t phys_tid_226230 = group_tid_236449;\n    int64_t slice_236453 = q_t_203494;\n    int64_t ltid_pre_236452 = sext_i32_i64(local_tid_236448);\n    int64_t remnant_236454 = sext_i32_i64(local_tid_236448) - ltid_pre_236452;\n    int64_t slice_236455 = t_n_m_203650;\n    int64_t slice_236456 = partition_sizze_203577 * slice_236455;\n    int64_t gtid_226228 = squot64(sext_i32_i64(group_tid_236449), slice_236455);\n    int64_t remnant_236457 = sext_i32_i64(group_tid_236449) - gtid_226228 *\n            slice_236455;\n    int64_t gtid_226229 = remnant_236457;\n    int64_t remnant_236458 = remnant_236457 - gtid_226229;\n    __local unsigned char *color_232054;\n   ",
            " \n    color_232054 = (__local unsigned char *) color_232054_backing_0;\n    \n    __local unsigned char *color_232055;\n    \n    color_232055 = (__local unsigned char *) color_232055_backing_1;\n    \n    int64_t x_226233;\n    \n    x_226233 = ((__global int64_t *) ext_mem_229196)[gtid_226228];\n    \n    int64_t x_226239;\n    \n    x_226239 = ((__global int64_t *) ext_mem_229461)[gtid_226228 *\n                                                     t_n_m_203650 +\n                                                     gtid_226229];\n    \n    double x_226240;\n    \n    x_226240 = ((__global double *) ext_mem_229460)[gtid_226228 * t_n_m_203650 +\n                                                    gtid_226229];\n    \n    int64_t min_arg_226241 = mul64(jump_t_203500, gtid_226229);\n    int64_t min_res_226242 = smin64(i_203670, min_arg_226241);\n    int64_t defunc_0_g_res_226243 = add64((int64_t) 1, min_res_226242);\n    double defunc_2_reduce_res_226244;\n    double defunc_2_reduce_res_226245;\n    double defunc_2_reduce_res_226246;\n    int64_t gtid_226249 = sext_i32_i64(sext_i64_i32(ltid_pre_236452));\n    int32_t phys_tid_226250 = local_tid_236448;\n    __local unsigned char *red_arr_mem_236459;\n    \n    red_arr_mem_236459 = (__local unsigned char *) red_arr_mem_236459_backing_2;\n    \n    __local unsigned char *red_arr_mem_236461;\n    \n    red_arr_mem_236461 = (__local unsigned char *) red_arr_mem_236461_backing_3;\n    \n    __local unsigned char *red_arr_mem_236463;\n    \n    red_arr_mem_236463 = (__local unsigned char *) red_arr_mem_236463_backing_4;\n    \n    bool cond_226261 = sle64(x_226233, gtid_226249);\n    int64_t defunc_0_f_res_226262;\n    \n    if (cond_226261) {\n        defunc_0_f_res_226262 = (int64_t) 0;\n    } else {\n        int64_t i_226263 = add64(x_226239, gtid_226249);\n        int64_t defunc_0_add_arg_226264;\n        \n        defunc_0_add_arg_226264 = ((__global\n                                    int64_t *) ext_mem_229197)[gtid_226228 *\n                                         ",
            "                      n_203490 +\n                                                               i_226263];\n        \n        int64_t defunc_1_add_res_226265 = add64((int64_t) 1,\n                                                defunc_0_add_arg_226264);\n        \n        defunc_0_f_res_226262 = defunc_1_add_res_226265;\n    }\n    \n    double defunc_0_f_res_226266;\n    \n    if (cond_226261) {\n        defunc_0_f_res_226266 = 0.0;\n    } else {\n        int64_t i_226267 = add64(x_226239, gtid_226249);\n        double defunc_0_add_arg_226268;\n        \n        defunc_0_add_arg_226268 = ((__global double *) mem_231440)[gtid_226228 *\n                                                                   n_203490 +\n                                                                   i_226267];\n        defunc_0_f_res_226266 = defunc_0_add_arg_226268;\n    }\n    \n    int64_t binop_p_226269 = sub64(defunc_0_f_res_226262,\n                                   defunc_0_g_res_226243);\n    double defunc_0_f_res_226270 = sitofp_i64_f64(binop_p_226269);\n    double abs_res_226271 = fabs(defunc_0_f_res_226270);\n    double tmp1_226272 = abs_res_226271 / x_226240;\n    double x_226273 = tmp1_226272 * tmp1_226272;\n    double y_226274 = tmp1_226272 * x_226273;\n    double tmp2_226275 = 1.0 - y_226274;\n    double x_226276 = tmp2_226275 * tmp2_226275;\n    double tmp3_226277 = tmp2_226275 * x_226276;\n    double tmp4_226278 = defunc_0_f_res_226266 * tmp3_226277;\n    double defunc_1_f_res_226279 = defunc_0_f_res_226270 * tmp4_226278;\n    double defunc_1_f_res_226280 = defunc_0_f_res_226270 *\n           defunc_1_f_res_226279;\n    \n    ((__local double *) red_arr_mem_236459)[gtid_226249] = tmp4_226278;\n    ((__local double *) red_arr_mem_236461)[gtid_226249] =\n        defunc_1_f_res_226279;\n    ((__local double *) red_arr_mem_236463)[gtid_226249] =\n        defunc_1_f_res_226280;\n    ((__local double *) color_232055)[gtid_226249] = defunc_1_f_res_226279;\n    ((__local double *) color_232054)[gtid_226249] = tmp4_2262",
            "78;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_236465;\n    int32_t skip_waves_236466 = 1;\n    double x_226251;\n    double x_226252;\n    double x_226253;\n    double x_226254;\n    double x_226255;\n    double x_226256;\n    \n    offset_236465 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_236448, sext_i64_i32(q_t_203494))) {\n            x_226251 = ((__local\n                         double *) red_arr_mem_236459)[sext_i32_i64(local_tid_236448 +\n                                                       offset_236465)];\n            x_226252 = ((__local\n                         double *) red_arr_mem_236461)[sext_i32_i64(local_tid_236448 +\n                                                       offset_236465)];\n            x_226253 = ((__local\n                         double *) red_arr_mem_236463)[sext_i32_i64(local_tid_236448 +\n                                                       offset_236465)];\n        }\n    }\n    offset_236465 = 1;\n    while (slt32(offset_236465, wave_sizze_236450)) {\n        if (slt32(local_tid_236448 + offset_236465, sext_i64_i32(q_t_203494)) &&\n            ((local_tid_236448 - squot32(local_tid_236448, wave_sizze_236450) *\n              wave_sizze_236450) & (2 * offset_236465 - 1)) == 0) {\n            // read array element\n            {\n                x_226254 = ((volatile __local\n                             double *) red_arr_mem_236459)[sext_i32_i64(local_tid_236448 +\n                                                           offset_236465)];\n                x_226255 = ((volatile __local\n                             double *) red_arr_mem_236461)[sext_i32_i64(local_tid_236448 +\n                                                           offset_236465)];\n                x_226256 = ((volatile __local\n                             double *) red_arr_mem_236463)[sext_i32_i64(local_tid_236448 +\n                                                           offset_236465)];\n            }\n            // ap",
            "ply reduction operation\n            {\n                double defunc_1_op_res_226257 = x_226251 + x_226254;\n                double defunc_1_op_res_226258 = x_226252 + x_226255;\n                double defunc_1_op_res_226259 = x_226253 + x_226256;\n                \n                x_226251 = defunc_1_op_res_226257;\n                x_226252 = defunc_1_op_res_226258;\n                x_226253 = defunc_1_op_res_226259;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_236459)[sext_i32_i64(local_tid_236448)] =\n                    x_226251;\n                ((volatile __local\n                  double *) red_arr_mem_236461)[sext_i32_i64(local_tid_236448)] =\n                    x_226252;\n                ((volatile __local\n                  double *) red_arr_mem_236463)[sext_i32_i64(local_tid_236448)] =\n                    x_226253;\n            }\n        }\n        offset_236465 *= 2;\n    }\n    while (slt32(skip_waves_236466, squot32(sext_i64_i32(q_t_203494) +\n                                            wave_sizze_236450 - 1,\n                                            wave_sizze_236450))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_236465 = skip_waves_236466 * wave_sizze_236450;\n        if (slt32(local_tid_236448 + offset_236465, sext_i64_i32(q_t_203494)) &&\n            ((local_tid_236448 - squot32(local_tid_236448, wave_sizze_236450) *\n              wave_sizze_236450) == 0 && (squot32(local_tid_236448,\n                                                  wave_sizze_236450) & (2 *\n                                                                        skip_waves_236466 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_226254 = ((__local\n                             double *) red_arr_mem_236459)[sext_i32_i64(local_tid_236448 +\n                                        ",
            "                   offset_236465)];\n                x_226255 = ((__local\n                             double *) red_arr_mem_236461)[sext_i32_i64(local_tid_236448 +\n                                                           offset_236465)];\n                x_226256 = ((__local\n                             double *) red_arr_mem_236463)[sext_i32_i64(local_tid_236448 +\n                                                           offset_236465)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_226257 = x_226251 + x_226254;\n                double defunc_1_op_res_226258 = x_226252 + x_226255;\n                double defunc_1_op_res_226259 = x_226253 + x_226256;\n                \n                x_226251 = defunc_1_op_res_226257;\n                x_226252 = defunc_1_op_res_226258;\n                x_226253 = defunc_1_op_res_226259;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_236459)[sext_i32_i64(local_tid_236448)] =\n                    x_226251;\n                ((__local\n                  double *) red_arr_mem_236461)[sext_i32_i64(local_tid_236448)] =\n                    x_226252;\n                ((__local\n                  double *) red_arr_mem_236463)[sext_i32_i64(local_tid_236448)] =\n                    x_226253;\n            }\n        }\n        skip_waves_236466 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_226244 = ((__local\n                                   double *) red_arr_mem_236459)[(int64_t) 0];\n    defunc_2_reduce_res_226245 = ((__local\n                                   double *) red_arr_mem_236461)[(int64_t) 0];\n    defunc_2_reduce_res_226246 = ((__local\n                                   double *) red_arr_mem_236463)[(int64_t) 0];\n    \n    double x_226281 = defunc_2_reduce_res_226244 * defunc_2_reduce_res_226246;\n    double y_226282 = defunc_2_reduce_res_226245 * defunc_2_reduce_res_226245;\n  ",
            "  double y_226283 = x_226281 - y_226282;\n    double det1_226284 = 1.0 / y_226283;\n    double a11_226285 = defunc_2_reduce_res_226246 * det1_226284;\n    double x_226286 = 0.0 - defunc_2_reduce_res_226245;\n    double b11_226287 = det1_226284 * x_226286;\n    double c11_226288 = defunc_2_reduce_res_226244 * det1_226284;\n    double defunc_2_reduce_res_226289;\n    double defunc_2_reduce_res_226290;\n    int64_t gtid_226291 = sext_i32_i64(sext_i64_i32(ltid_pre_236452));\n    int32_t phys_tid_226292 = local_tid_236448;\n    __local unsigned char *red_arr_mem_236467;\n    \n    red_arr_mem_236467 = (__local unsigned char *) red_arr_mem_236467_backing_5;\n    \n    __local unsigned char *red_arr_mem_236469;\n    \n    red_arr_mem_236469 = (__local unsigned char *) red_arr_mem_236469_backing_6;\n    \n    double x_226300;\n    \n    x_226300 = ((__local double *) color_232054)[gtid_226291];\n    \n    double x_226301;\n    \n    x_226301 = ((__local double *) color_232055)[gtid_226291];\n    \n    bool cond_226302 = sle64(x_226233, gtid_226291);\n    double defunc_0_f_res_226303;\n    \n    if (cond_226302) {\n        defunc_0_f_res_226303 = 0.0;\n    } else {\n        int64_t i_226304 = add64(x_226239, gtid_226291);\n        double defunc_0_add_arg_226305;\n        \n        defunc_0_add_arg_226305 = ((__global double *) mem_231444)[gtid_226228 *\n                                                                   n_203490 +\n                                                                   i_226304];\n        defunc_0_f_res_226303 = defunc_0_add_arg_226305;\n    }\n    \n    double x_226306 = a11_226285 * x_226300;\n    double y_226307 = b11_226287 * x_226301;\n    double x_226308 = x_226306 + y_226307;\n    double defunc_9_fit_fun_res_226309 = defunc_0_f_res_226303 * x_226308;\n    double x_226310 = b11_226287 * x_226300;\n    double y_226311 = c11_226288 * x_226301;\n    double x_226312 = x_226310 + y_226311;\n    double defunc_9_slope_fun_res_226313 = defunc_0_f_res_226303 * x_226312;\n    \n    ((__local double *",
            ") red_arr_mem_236467)[gtid_226291] =\n        defunc_9_fit_fun_res_226309;\n    ((__local double *) red_arr_mem_236469)[gtid_226291] =\n        defunc_9_slope_fun_res_226313;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_236471;\n    int32_t skip_waves_236472 = 1;\n    double x_226293;\n    double x_226294;\n    double x_226295;\n    double x_226296;\n    \n    offset_236471 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_236448, sext_i64_i32(q_t_203494))) {\n            x_226293 = ((__local\n                         double *) red_arr_mem_236467)[sext_i32_i64(local_tid_236448 +\n                                                       offset_236471)];\n            x_226294 = ((__local\n                         double *) red_arr_mem_236469)[sext_i32_i64(local_tid_236448 +\n                                                       offset_236471)];\n        }\n    }\n    offset_236471 = 1;\n    while (slt32(offset_236471, wave_sizze_236450)) {\n        if (slt32(local_tid_236448 + offset_236471, sext_i64_i32(q_t_203494)) &&\n            ((local_tid_236448 - squot32(local_tid_236448, wave_sizze_236450) *\n              wave_sizze_236450) & (2 * offset_236471 - 1)) == 0) {\n            // read array element\n            {\n                x_226295 = ((volatile __local\n                             double *) red_arr_mem_236467)[sext_i32_i64(local_tid_236448 +\n                                                           offset_236471)];\n                x_226296 = ((volatile __local\n                             double *) red_arr_mem_236469)[sext_i32_i64(local_tid_236448 +\n                                                           offset_236471)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_226297 = x_226293 + x_226295;\n                double defunc_1_op_res_226298 = x_226294 + x_226296;\n                \n                x_226293 = defunc_1_op_res_226297;\n                x_226294 = defunc_1",
            "_op_res_226298;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_236467)[sext_i32_i64(local_tid_236448)] =\n                    x_226293;\n                ((volatile __local\n                  double *) red_arr_mem_236469)[sext_i32_i64(local_tid_236448)] =\n                    x_226294;\n            }\n        }\n        offset_236471 *= 2;\n    }\n    while (slt32(skip_waves_236472, squot32(sext_i64_i32(q_t_203494) +\n                                            wave_sizze_236450 - 1,\n                                            wave_sizze_236450))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_236471 = skip_waves_236472 * wave_sizze_236450;\n        if (slt32(local_tid_236448 + offset_236471, sext_i64_i32(q_t_203494)) &&\n            ((local_tid_236448 - squot32(local_tid_236448, wave_sizze_236450) *\n              wave_sizze_236450) == 0 && (squot32(local_tid_236448,\n                                                  wave_sizze_236450) & (2 *\n                                                                        skip_waves_236472 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_226295 = ((__local\n                             double *) red_arr_mem_236467)[sext_i32_i64(local_tid_236448 +\n                                                           offset_236471)];\n                x_226296 = ((__local\n                             double *) red_arr_mem_236469)[sext_i32_i64(local_tid_236448 +\n                                                           offset_236471)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_226297 = x_226293 + x_226295;\n                double defunc_1_op_res_226298 = x_226294 + x_226296;\n                \n                x_226293 = defunc_1_op_res_226297;\n                x_226294 = defu",
            "nc_1_op_res_226298;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_236467)[sext_i32_i64(local_tid_236448)] =\n                    x_226293;\n                ((__local\n                  double *) red_arr_mem_236469)[sext_i32_i64(local_tid_236448)] =\n                    x_226294;\n            }\n        }\n        skip_waves_236472 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_226289 = ((__local\n                                   double *) red_arr_mem_236467)[(int64_t) 0];\n    defunc_2_reduce_res_226290 = ((__local\n                                   double *) red_arr_mem_236469)[(int64_t) 0];\n    if (local_tid_236448 == 0) {\n        ((__global double *) mem_231457)[gtid_226228 * t_n_m_203650 +\n                                         gtid_226229] =\n            defunc_2_reduce_res_226289;\n    }\n    if (local_tid_236448 == 0) {\n        ((__global double *) mem_231461)[gtid_226228 * t_n_m_203650 +\n                                         gtid_226229] =\n            defunc_2_reduce_res_226290;\n    }\n    \n  error_4:\n    return;\n}\n__kernel void mainzisegmap_intragroup_226634(__global int *global_failure,\n                                             uint red_arr_mem_236519_backing_offset_0,\n                                             uint red_arr_mem_236517_backing_offset_1,\n                                             uint red_arr_mem_236513_backing_offset_2,\n                                             uint red_arr_mem_236511_backing_offset_3,\n                                             uint red_arr_mem_236509_backing_offset_4,\n                                             uint red_arr_mem_236507_backing_offset_5,\n                                             uint red_arr_mem_236505_backing_offset_6,\n                                             uint color_232059_backing_offset_7,\n                                             uint color_232058_backing_offset_8,\n         ",
            "                                    uint color_232057_backing_offset_9,\n                                             uint color_232056_backing_offset_10,\n                                             int64_t n_203490,\n                                             int64_t q_t_203494,\n                                             int64_t jump_t_203500,\n                                             int64_t partition_sizze_203577,\n                                             int64_t t_n_m_203650,\n                                             int64_t i_203670, __global\n                                             unsigned char *ext_mem_229196,\n                                             __global\n                                             unsigned char *ext_mem_229197,\n                                             __global\n                                             unsigned char *ext_mem_229460,\n                                             __global\n                                             unsigned char *ext_mem_229461,\n                                             __global unsigned char *mem_231471,\n                                             __global unsigned char *mem_231475,\n                                             __global unsigned char *mem_231495,\n                                             __global unsigned char *mem_231499)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_236519_backing_10 =\n                           &shared_mem[red_arr_mem_236519_backing_offset_0];\n    volatile unsigned char *red_arr_mem_236517_backing_9 =\n                           &shared_mem[red_arr_mem_236517_backing_offset_1];\n    volatile unsigned char *red_arr_mem_236513_backing_8 =\n                           &shared_mem[red_arr_mem_236513_backing_offset_2];\n    volatile unsigned char *red_arr_mem_236511_backing_7 =\n                           &shared_mem[red_arr_mem_236511_backing_offset_3];\n    vol",
            "atile unsigned char *red_arr_mem_236509_backing_6 =\n                           &shared_mem[red_arr_mem_236509_backing_offset_4];\n    volatile unsigned char *red_arr_mem_236507_backing_5 =\n                           &shared_mem[red_arr_mem_236507_backing_offset_5];\n    volatile unsigned char *red_arr_mem_236505_backing_4 =\n                           &shared_mem[red_arr_mem_236505_backing_offset_6];\n    volatile unsigned char *color_232059_backing_3 =\n                           &shared_mem[color_232059_backing_offset_7];\n    volatile unsigned char *color_232058_backing_2 =\n                           &shared_mem[color_232058_backing_offset_8];\n    volatile unsigned char *color_232057_backing_1 =\n                           &shared_mem[color_232057_backing_offset_9];\n    volatile unsigned char *color_232056_backing_0 =\n                           &shared_mem[color_232056_backing_offset_10];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236493;\n    int32_t local_tid_236494;\n    int64_t group_sizze_236497;\n    int32_t wave_sizze_236496;\n    int32_t group_tid_236495;\n    \n    global_tid_236493 = get_global_id(0);\n    local_tid_236494 = get_local_id(0);\n    group_sizze_236497 = get_local_size(0);\n    wave_sizze_236496 = LOCKSTEP_WIDTH;\n    group_tid_236495 = get_group_id(0);\n    \n    int32_t phys_tid_226634 = group_tid_236495;\n    int64_t slice_236499 = q_t_203494;\n    int64_t ltid_pre_236498 = sext_i32_i64(local_tid_236494);\n    int64_t remnant_236500 = sext_i32_i64(local_tid_236494) - ltid_pre_236498;\n    int64_t slice_236501 = t_n_m_203650;\n    int64_t slice_236502 = partition_sizze_203577 * slice_236501;\n    int64_t gtid_226632 = squot64(sext_i32_i64(group_tid_236495), slice_236501);\n    int64_t remnant_236503 = sext_i32_i64(group_tid_236495) - gtid_226632 *\n            slice_236501;\n    int64_t gtid_226633 = remnant_236503;\n    int64_t remnant_236504 = remnant_236503 - gtid_226633;\n    __local unsigned char *color_232056;\n    \n    color_2",
            "32056 = (__local unsigned char *) color_232056_backing_0;\n    \n    __local unsigned char *color_232057;\n    \n    color_232057 = (__local unsigned char *) color_232057_backing_1;\n    \n    __local unsigned char *color_232058;\n    \n    color_232058 = (__local unsigned char *) color_232058_backing_2;\n    \n    __local unsigned char *color_232059;\n    \n    color_232059 = (__local unsigned char *) color_232059_backing_3;\n    \n    int64_t x_226637;\n    \n    x_226637 = ((__global int64_t *) ext_mem_229196)[gtid_226632];\n    \n    int64_t x_226643;\n    \n    x_226643 = ((__global int64_t *) ext_mem_229461)[gtid_226632 *\n                                                     t_n_m_203650 +\n                                                     gtid_226633];\n    \n    double x_226644;\n    \n    x_226644 = ((__global double *) ext_mem_229460)[gtid_226632 * t_n_m_203650 +\n                                                    gtid_226633];\n    \n    int64_t min_arg_226645 = mul64(jump_t_203500, gtid_226633);\n    int64_t min_res_226646 = smin64(i_203670, min_arg_226645);\n    int64_t defunc_0_g_res_226647 = add64((int64_t) 1, min_res_226646);\n    int64_t gtid_226650 = sext_i32_i64(sext_i64_i32(ltid_pre_236498));\n    int32_t phys_tid_226651 = local_tid_236494;\n    bool cond_226653 = sle64(x_226637, gtid_226650);\n    int64_t defunc_0_f_res_226654;\n    \n    if (cond_226653) {\n        defunc_0_f_res_226654 = (int64_t) 0;\n    } else {\n        int64_t i_226655 = add64(x_226643, gtid_226650);\n        int64_t defunc_0_add_arg_226656;\n        \n        defunc_0_add_arg_226656 = ((__global\n                                    int64_t *) ext_mem_229197)[gtid_226632 *\n                                                               n_203490 +\n                                                               i_226655];\n        \n        int64_t defunc_1_add_res_226657 = add64((int64_t) 1,\n                                                defunc_0_add_arg_226656);\n        \n        defunc_0_f_res_226654 = defunc_1_add",
            "_res_226657;\n    }\n    \n    double defunc_0_f_res_226658;\n    \n    if (cond_226653) {\n        defunc_0_f_res_226658 = 0.0;\n    } else {\n        int64_t i_226659 = add64(x_226643, gtid_226650);\n        double defunc_0_add_arg_226660;\n        \n        defunc_0_add_arg_226660 = ((__global double *) mem_231471)[gtid_226632 *\n                                                                   n_203490 +\n                                                                   i_226659];\n        defunc_0_f_res_226658 = defunc_0_add_arg_226660;\n    }\n    \n    int64_t binop_p_226661 = sub64(defunc_0_f_res_226654,\n                                   defunc_0_g_res_226647);\n    double defunc_0_f_res_226662 = sitofp_i64_f64(binop_p_226661);\n    double abs_res_226663 = fabs(defunc_0_f_res_226662);\n    double tmp1_226664 = abs_res_226663 / x_226644;\n    double x_226665 = tmp1_226664 * tmp1_226664;\n    double y_226666 = tmp1_226664 * x_226665;\n    double tmp2_226667 = 1.0 - y_226666;\n    double x_226668 = tmp2_226667 * tmp2_226667;\n    double tmp3_226669 = tmp2_226667 * x_226668;\n    double tmp4_226670 = defunc_0_f_res_226658 * tmp3_226669;\n    \n    ((__local double *) color_232059)[gtid_226650] = defunc_0_f_res_226662;\n    ((__local double *) color_232058)[gtid_226650] = tmp4_226670;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    double defunc_2_reduce_res_226671;\n    double defunc_2_reduce_res_226672;\n    double defunc_2_reduce_res_226673;\n    double defunc_2_reduce_res_226674;\n    double defunc_2_reduce_res_226675;\n    int64_t gtid_226678 = sext_i32_i64(sext_i64_i32(ltid_pre_236498));\n    int32_t phys_tid_226679 = local_tid_236494;\n    __local unsigned char *red_arr_mem_236505;\n    \n    red_arr_mem_236505 = (__local unsigned char *) red_arr_mem_236505_backing_4;\n    \n    __local unsigned char *red_arr_mem_236507;\n    \n    red_arr_mem_236507 = (__local unsigned char *) red_arr_mem_236507_backing_5;\n    \n    __local unsigned char *red_arr_mem_236509;\n    \n    red_arr_mem_236509 = (__local un",
            "signed char *) red_arr_mem_236509_backing_6;\n    \n    __local unsigned char *red_arr_mem_236511;\n    \n    red_arr_mem_236511 = (__local unsigned char *) red_arr_mem_236511_backing_7;\n    \n    __local unsigned char *red_arr_mem_236513;\n    \n    red_arr_mem_236513 = (__local unsigned char *) red_arr_mem_236513_backing_8;\n    \n    double x_226695;\n    \n    x_226695 = ((__local double *) color_232059)[gtid_226678];\n    \n    double x_226696;\n    \n    x_226696 = ((__local double *) color_232058)[gtid_226678];\n    \n    double defunc_1_f_res_226697 = x_226695 * x_226696;\n    double defunc_1_f_res_226698 = x_226695 * defunc_1_f_res_226697;\n    double defunc_1_f_res_226699 = x_226695 * defunc_1_f_res_226698;\n    double defunc_1_f_res_226700 = x_226695 * defunc_1_f_res_226699;\n    \n    ((__local double *) red_arr_mem_236505)[gtid_226678] = x_226696;\n    ((__local double *) red_arr_mem_236507)[gtid_226678] =\n        defunc_1_f_res_226697;\n    ((__local double *) red_arr_mem_236509)[gtid_226678] =\n        defunc_1_f_res_226698;\n    ((__local double *) red_arr_mem_236511)[gtid_226678] =\n        defunc_1_f_res_226699;\n    ((__local double *) red_arr_mem_236513)[gtid_226678] =\n        defunc_1_f_res_226700;\n    ((__local double *) color_232057)[gtid_226678] = defunc_1_f_res_226698;\n    ((__local double *) color_232056)[gtid_226678] = defunc_1_f_res_226697;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_236515;\n    int32_t skip_waves_236516 = 1;\n    double x_226680;\n    double x_226681;\n    double x_226682;\n    double x_226683;\n    double x_226684;\n    double x_226685;\n    double x_226686;\n    double x_226687;\n    double x_226688;\n    double x_226689;\n    \n    offset_236515 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_236494, sext_i64_i32(q_t_203494))) {\n            x_226680 = ((__local\n                         double *) red_arr_mem_236505)[sext_i32_i64(local_tid_236494 +\n                                                     ",
            "  offset_236515)];\n            x_226681 = ((__local\n                         double *) red_arr_mem_236507)[sext_i32_i64(local_tid_236494 +\n                                                       offset_236515)];\n            x_226682 = ((__local\n                         double *) red_arr_mem_236509)[sext_i32_i64(local_tid_236494 +\n                                                       offset_236515)];\n            x_226683 = ((__local\n                         double *) red_arr_mem_236511)[sext_i32_i64(local_tid_236494 +\n                                                       offset_236515)];\n            x_226684 = ((__local\n                         double *) red_arr_mem_236513)[sext_i32_i64(local_tid_236494 +\n                                                       offset_236515)];\n        }\n    }\n    offset_236515 = 1;\n    while (slt32(offset_236515, wave_sizze_236496)) {\n        if (slt32(local_tid_236494 + offset_236515, sext_i64_i32(q_t_203494)) &&\n            ((local_tid_236494 - squot32(local_tid_236494, wave_sizze_236496) *\n              wave_sizze_236496) & (2 * offset_236515 - 1)) == 0) {\n            // read array element\n            {\n                x_226685 = ((volatile __local\n                             double *) red_arr_mem_236505)[sext_i32_i64(local_tid_236494 +\n                                                           offset_236515)];\n                x_226686 = ((volatile __local\n                             double *) red_arr_mem_236507)[sext_i32_i64(local_tid_236494 +\n                                                           offset_236515)];\n                x_226687 = ((volatile __local\n                             double *) red_arr_mem_236509)[sext_i32_i64(local_tid_236494 +\n                                                           offset_236515)];\n                x_226688 = ((volatile __local\n                             double *) red_arr_mem_236511)[sext_i32_i64(local_tid_236494 +\n                                                           offset_2",
            "36515)];\n                x_226689 = ((volatile __local\n                             double *) red_arr_mem_236513)[sext_i32_i64(local_tid_236494 +\n                                                           offset_236515)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_226690 = x_226680 + x_226685;\n                double defunc_1_op_res_226691 = x_226681 + x_226686;\n                double defunc_1_op_res_226692 = x_226682 + x_226687;\n                double defunc_1_op_res_226693 = x_226683 + x_226688;\n                double defunc_1_op_res_226694 = x_226684 + x_226689;\n                \n                x_226680 = defunc_1_op_res_226690;\n                x_226681 = defunc_1_op_res_226691;\n                x_226682 = defunc_1_op_res_226692;\n                x_226683 = defunc_1_op_res_226693;\n                x_226684 = defunc_1_op_res_226694;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_236505)[sext_i32_i64(local_tid_236494)] =\n                    x_226680;\n                ((volatile __local\n                  double *) red_arr_mem_236507)[sext_i32_i64(local_tid_236494)] =\n                    x_226681;\n                ((volatile __local\n                  double *) red_arr_mem_236509)[sext_i32_i64(local_tid_236494)] =\n                    x_226682;\n                ((volatile __local\n                  double *) red_arr_mem_236511)[sext_i32_i64(local_tid_236494)] =\n                    x_226683;\n                ((volatile __local\n                  double *) red_arr_mem_236513)[sext_i32_i64(local_tid_236494)] =\n                    x_226684;\n            }\n        }\n        offset_236515 *= 2;\n    }\n    while (slt32(skip_waves_236516, squot32(sext_i64_i32(q_t_203494) +\n                                            wave_sizze_236496 - 1,\n                                            wave_sizze_236496))) {\n        barrier(CLK_LOCAL",
            "_MEM_FENCE);\n        offset_236515 = skip_waves_236516 * wave_sizze_236496;\n        if (slt32(local_tid_236494 + offset_236515, sext_i64_i32(q_t_203494)) &&\n            ((local_tid_236494 - squot32(local_tid_236494, wave_sizze_236496) *\n              wave_sizze_236496) == 0 && (squot32(local_tid_236494,\n                                                  wave_sizze_236496) & (2 *\n                                                                        skip_waves_236516 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_226685 = ((__local\n                             double *) red_arr_mem_236505)[sext_i32_i64(local_tid_236494 +\n                                                           offset_236515)];\n                x_226686 = ((__local\n                             double *) red_arr_mem_236507)[sext_i32_i64(local_tid_236494 +\n                                                           offset_236515)];\n                x_226687 = ((__local\n                             double *) red_arr_mem_236509)[sext_i32_i64(local_tid_236494 +\n                                                           offset_236515)];\n                x_226688 = ((__local\n                             double *) red_arr_mem_236511)[sext_i32_i64(local_tid_236494 +\n                                                           offset_236515)];\n                x_226689 = ((__local\n                             double *) red_arr_mem_236513)[sext_i32_i64(local_tid_236494 +\n                                                           offset_236515)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_226690 = x_226680 + x_226685;\n                double defunc_1_op_res_226691 = x_226681 + x_226686;\n                double defunc_1_op_res_226692 = x_226682 + x_226687;\n                double defunc_1_op_res_226693 = x_226683 + x_226688;\n                ",
            "double defunc_1_op_res_226694 = x_226684 + x_226689;\n                \n                x_226680 = defunc_1_op_res_226690;\n                x_226681 = defunc_1_op_res_226691;\n                x_226682 = defunc_1_op_res_226692;\n                x_226683 = defunc_1_op_res_226693;\n                x_226684 = defunc_1_op_res_226694;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_236505)[sext_i32_i64(local_tid_236494)] =\n                    x_226680;\n                ((__local\n                  double *) red_arr_mem_236507)[sext_i32_i64(local_tid_236494)] =\n                    x_226681;\n                ((__local\n                  double *) red_arr_mem_236509)[sext_i32_i64(local_tid_236494)] =\n                    x_226682;\n                ((__local\n                  double *) red_arr_mem_236511)[sext_i32_i64(local_tid_236494)] =\n                    x_226683;\n                ((__local\n                  double *) red_arr_mem_236513)[sext_i32_i64(local_tid_236494)] =\n                    x_226684;\n            }\n        }\n        skip_waves_236516 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_226671 = ((__local\n                                   double *) red_arr_mem_236505)[(int64_t) 0];\n    defunc_2_reduce_res_226672 = ((__local\n                                   double *) red_arr_mem_236507)[(int64_t) 0];\n    defunc_2_reduce_res_226673 = ((__local\n                                   double *) red_arr_mem_236509)[(int64_t) 0];\n    defunc_2_reduce_res_226674 = ((__local\n                                   double *) red_arr_mem_236511)[(int64_t) 0];\n    defunc_2_reduce_res_226675 = ((__local\n                                   double *) red_arr_mem_236513)[(int64_t) 0];\n    \n    double x_226701 = defunc_2_reduce_res_226673 * defunc_2_reduce_res_226675;\n    double y_226702 = defunc_2_reduce_res_226674 * defunc_2_reduce_res_226674;\n    double a12_226703 = x_226701 - y_226702;\n  ",
            "  double x_226704 = defunc_2_reduce_res_226673 * defunc_2_reduce_res_226674;\n    double y_226705 = defunc_2_reduce_res_226672 * defunc_2_reduce_res_226675;\n    double b12_226706 = x_226704 - y_226705;\n    double x_226707 = defunc_2_reduce_res_226672 * defunc_2_reduce_res_226674;\n    double y_226708 = defunc_2_reduce_res_226673 * defunc_2_reduce_res_226673;\n    double c12_226709 = x_226707 - y_226708;\n    double x_226710 = defunc_2_reduce_res_226671 * defunc_2_reduce_res_226675;\n    double b2_226711 = x_226710 - y_226708;\n    double x_226712 = defunc_2_reduce_res_226672 * defunc_2_reduce_res_226673;\n    double y_226713 = defunc_2_reduce_res_226671 * defunc_2_reduce_res_226674;\n    double c2_226714 = x_226712 - y_226713;\n    double x_226715 = defunc_2_reduce_res_226671 * a12_226703;\n    double y_226716 = defunc_2_reduce_res_226672 * b12_226706;\n    double x_226717 = x_226715 + y_226716;\n    double y_226718 = defunc_2_reduce_res_226673 * c12_226709;\n    double y_226719 = x_226717 + y_226718;\n    double det_226720 = 1.0 / y_226719;\n    double a12_226721 = a12_226703 * det_226720;\n    double b12_226722 = b12_226706 * det_226720;\n    double c12_226723 = c12_226709 * det_226720;\n    double b2_226724 = b2_226711 * det_226720;\n    double c2_226725 = c2_226714 * det_226720;\n    double defunc_2_reduce_res_226726;\n    double defunc_2_reduce_res_226727;\n    int64_t gtid_226728 = sext_i32_i64(sext_i64_i32(ltid_pre_236498));\n    int32_t phys_tid_226729 = local_tid_236494;\n    __local unsigned char *red_arr_mem_236517;\n    \n    red_arr_mem_236517 = (__local unsigned char *) red_arr_mem_236517_backing_9;\n    \n    __local unsigned char *red_arr_mem_236519;\n    \n    red_arr_mem_236519 = (__local\n                          unsigned char *) red_arr_mem_236519_backing_10;\n    \n    double x_226737;\n    \n    x_226737 = ((__local double *) color_232058)[gtid_226728];\n    \n    double x_226738;\n    \n    x_226738 = ((__local double *) color_232056)[gtid_226728];\n    \n    double x_226739;\n    \n ",
            "   x_226739 = ((__local double *) color_232057)[gtid_226728];\n    \n    bool cond_226740 = sle64(x_226637, gtid_226728);\n    double defunc_0_f_res_226741;\n    \n    if (cond_226740) {\n        defunc_0_f_res_226741 = 0.0;\n    } else {\n        int64_t i_226742 = add64(x_226643, gtid_226728);\n        double defunc_0_add_arg_226743;\n        \n        defunc_0_add_arg_226743 = ((__global double *) mem_231475)[gtid_226632 *\n                                                                   n_203490 +\n                                                                   i_226742];\n        defunc_0_f_res_226741 = defunc_0_add_arg_226743;\n    }\n    \n    double x_226744 = a12_226721 * x_226737;\n    double y_226745 = b12_226722 * x_226738;\n    double x_226746 = x_226744 + y_226745;\n    double y_226747 = c12_226723 * x_226739;\n    double x_226748 = x_226746 + y_226747;\n    double defunc_9_fit_fun_res_226749 = defunc_0_f_res_226741 * x_226748;\n    double x_226750 = b12_226722 * x_226737;\n    double y_226751 = b2_226724 * x_226738;\n    double x_226752 = x_226750 + y_226751;\n    double y_226753 = c2_226725 * x_226739;\n    double x_226754 = x_226752 + y_226753;\n    double defunc_9_slope_fun_res_226755 = defunc_0_f_res_226741 * x_226754;\n    \n    ((__local double *) red_arr_mem_236517)[gtid_226728] =\n        defunc_9_fit_fun_res_226749;\n    ((__local double *) red_arr_mem_236519)[gtid_226728] =\n        defunc_9_slope_fun_res_226755;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_236521;\n    int32_t skip_waves_236522 = 1;\n    double x_226730;\n    double x_226731;\n    double x_226732;\n    double x_226733;\n    \n    offset_236521 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_236494, sext_i64_i32(q_t_203494))) {\n            x_226730 = ((__local\n                         double *) red_arr_mem_236517)[sext_i32_i64(local_tid_236494 +\n                                                       offset_236521)];\n            x_226731 = ((__local\n   ",
            "                      double *) red_arr_mem_236519)[sext_i32_i64(local_tid_236494 +\n                                                       offset_236521)];\n        }\n    }\n    offset_236521 = 1;\n    while (slt32(offset_236521, wave_sizze_236496)) {\n        if (slt32(local_tid_236494 + offset_236521, sext_i64_i32(q_t_203494)) &&\n            ((local_tid_236494 - squot32(local_tid_236494, wave_sizze_236496) *\n              wave_sizze_236496) & (2 * offset_236521 - 1)) == 0) {\n            // read array element\n            {\n                x_226732 = ((volatile __local\n                             double *) red_arr_mem_236517)[sext_i32_i64(local_tid_236494 +\n                                                           offset_236521)];\n                x_226733 = ((volatile __local\n                             double *) red_arr_mem_236519)[sext_i32_i64(local_tid_236494 +\n                                                           offset_236521)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_226734 = x_226730 + x_226732;\n                double defunc_1_op_res_226735 = x_226731 + x_226733;\n                \n                x_226730 = defunc_1_op_res_226734;\n                x_226731 = defunc_1_op_res_226735;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_236517)[sext_i32_i64(local_tid_236494)] =\n                    x_226730;\n                ((volatile __local\n                  double *) red_arr_mem_236519)[sext_i32_i64(local_tid_236494)] =\n                    x_226731;\n            }\n        }\n        offset_236521 *= 2;\n    }\n    while (slt32(skip_waves_236522, squot32(sext_i64_i32(q_t_203494) +\n                                            wave_sizze_236496 - 1,\n                                            wave_sizze_236496))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_236521 = skip_waves_236522 * wave_sizze_236",
            "496;\n        if (slt32(local_tid_236494 + offset_236521, sext_i64_i32(q_t_203494)) &&\n            ((local_tid_236494 - squot32(local_tid_236494, wave_sizze_236496) *\n              wave_sizze_236496) == 0 && (squot32(local_tid_236494,\n                                                  wave_sizze_236496) & (2 *\n                                                                        skip_waves_236522 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_226732 = ((__local\n                             double *) red_arr_mem_236517)[sext_i32_i64(local_tid_236494 +\n                                                           offset_236521)];\n                x_226733 = ((__local\n                             double *) red_arr_mem_236519)[sext_i32_i64(local_tid_236494 +\n                                                           offset_236521)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_226734 = x_226730 + x_226732;\n                double defunc_1_op_res_226735 = x_226731 + x_226733;\n                \n                x_226730 = defunc_1_op_res_226734;\n                x_226731 = defunc_1_op_res_226735;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_236517)[sext_i32_i64(local_tid_236494)] =\n                    x_226730;\n                ((__local\n                  double *) red_arr_mem_236519)[sext_i32_i64(local_tid_236494)] =\n                    x_226731;\n            }\n        }\n        skip_waves_236522 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_226726 = ((__local\n                                   double *) red_arr_mem_236517)[(int64_t) 0];\n    defunc_2_reduce_res_226727 = ((__local\n                                   double *) red_arr_mem_236519)[(int64_t) 0];\n    if (local_tid_236494 == 0) {\n",
            "        ((__global double *) mem_231495)[gtid_226632 * t_n_m_203650 +\n                                         gtid_226633] =\n            defunc_2_reduce_res_226726;\n    }\n    if (local_tid_236494 == 0) {\n        ((__global double *) mem_231499)[gtid_226632 * t_n_m_203650 +\n                                         gtid_226633] =\n            defunc_2_reduce_res_226727;\n    }\n    \n  error_5:\n    return;\n}\n__kernel void mainzisegmap_intragroup_226984(__global int *global_failure,\n                                             int failure_is_an_option, __global\n                                             int64_t *global_failure_args,\n                                             uint color_232061_backing_offset_0,\n                                             uint color_232060_backing_offset_1,\n                                             int64_t n_203490,\n                                             int64_t partition_sizze_203577,\n                                             int64_t ext_231522, __global\n                                             unsigned char *mem_229161, __global\n                                             unsigned char *ext_mem_229197,\n                                             __global\n                                             unsigned char *ext_mem_231517,\n                                             __global\n                                             unsigned char *ext_mem_231518,\n                                             __global unsigned char *mem_231545,\n                                             __global unsigned char *mem_231549)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *color_232061_backing_1 =\n                           &shared_mem[color_232061_backing_offset_0];\n    volatile unsigned char *color_232060_backing_0 =\n                           &shared_mem[color_232060_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_236533;\n    int32_t local_tid_236534;\n    int64_t group_sizze_236537;\n    int32_t wave_sizze_236536;\n    int32_t group_tid_236535;\n    \n    global_tid_236533 = get_global_id(0);\n    local_tid_236534 = get_local_id(0);\n    group_sizze_236537 = get_local_size(0);\n    wave_sizze_236536 = LOCKSTEP_WIDTH;\n    group_tid_236535 = get_group_id(0);\n    \n    int32_t phys_tid_226984 = group_tid_236535;\n    int64_t slice_236539 = n_203490;\n    int64_t ltid_pre_236538 = sext_i32_i64(local_tid_236534);\n    int64_t remnant_236540 = sext_i32_i64(local_tid_236534) - ltid_pre_236538;\n    int64_t slice_236541 = partition_sizze_203577;\n    int64_t gtid_226983 = sext_i32_i64(group_tid_236535);\n    int64_t remnant_236542 = sext_i32_i64(group_tid_236535) - gtid_226983;\n    __local unsigned char *color_232060;\n    \n    color_232060 = (__local unsigned char *) color_232060_backing_0;\n    \n    __local unsigned char *color_232061;\n    \n    color_232061 = (__local unsigned char *) color_232061_backing_1;\n    \n    int64_t gtid_226994 = sext_i32_i64(sext_i64_i32(ltid_pre_236538));\n    int32_t phys_tid_226995 = local_tid_236534;\n    double x_226996;\n    \n    x_226996 = ((__global double *) mem_229161)[gtid_226983 * n_203490 +\n                                                gtid_226994];\n    \n    double x_226997;\n    \n    x_226997 = ((__global double *) ext_mem_231518)[gtid_226983 * n_203490 +\n                                                    gtid_226994];\n    \n    double x_226998;\n    \n    x_226998 = ((__global double *) ext_mem_231517)[gtid_226983 * ext_231522 +\n                                                    gtid_226994];\n    \n    double x_226999 = x_226996 - x_226997;\n    double defunc_2_f_res_227000 = x_226999 - x_226998;\n    bool isnan_res_227001;\n    \n    isnan_res_227001 = futrts_isnan64(de",
            "func_2_f_res_227000);\n    \n    double defunc_0_f_res_227002;\n    \n    if (isnan_res_227001) {\n        defunc_0_f_res_227002 = defunc_2_f_res_227000;\n    } else {\n        double abs_res_227003 = fabs(defunc_2_f_res_227000);\n        \n        defunc_0_f_res_227002 = abs_res_227003;\n    }\n    ((__local double *) color_232061)[gtid_226994] = defunc_0_f_res_227002;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_227005 = sext_i32_i64(sext_i64_i32(ltid_pre_236538));\n    int32_t phys_tid_227006 = local_tid_236534;\n    int64_t x_227007;\n    \n    x_227007 = ((__global int64_t *) ext_mem_229197)[gtid_226983 * n_203490 +\n                                                     gtid_227005];\n    \n    bool cond_227008 = sle64((int64_t) 0, x_227007);\n    double defunc_0_f_res_227009;\n    \n    if (cond_227008) {\n        bool y_227010 = slt64(x_227007, n_203490);\n        bool bounds_check_227011 = cond_227008 && y_227010;\n        bool index_certs_227012;\n        \n        if (!bounds_check_227011) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 72) == -1) {\n                    global_failure_args[0] = (int64_t) x_227007;\n                    global_failure_args[1] = (int64_t) n_203490;\n                    ;\n                }\n                local_failure = true;\n                goto error_1;\n            }\n        }\n        \n        double defunc_0_f_res_t_res_227013;\n        \n        defunc_0_f_res_t_res_227013 = ((__local\n                                        double *) color_232061)[x_227007];\n        defunc_0_f_res_227009 = defunc_0_f_res_t_res_227013;\n    } else {\n        defunc_0_f_res_227009 = INFINITY;\n    }\n    ((__local double *) color_232060)[gtid_227005] = defunc_0_f_res_227009;\n    \n  error_1:\n    barrier(CLK_LOCAL_MEM_FENCE);\n    if (local_failure)\n        return;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    double tmp_236543;\n    \n    tmp_236543 = ((__local\n                   double *) color_232060)[sext_i32_i64(local_tid_236534)];\n  ",
            "  ((__global double *) mem_231545)[gtid_226983 * n_203490 +\n                                     sext_i32_i64(local_tid_236534)] =\n        tmp_236543;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    double tmp_236544;\n    \n    tmp_236544 = ((__local\n                   double *) color_232061)[sext_i32_i64(local_tid_236534)];\n    ((__global double *) mem_231549)[gtid_226983 * n_203490 +\n                                     sext_i32_i64(local_tid_236534)] =\n        tmp_236544;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n  error_2:\n    return;\n}\n__kernel void mainzisegmap_intragroup_227359(__global int *global_failure,\n                                             uint color_232076_backing_offset_0,\n                                             uint color_232075_backing_offset_1,\n                                             uint color_232074_backing_offset_2,\n                                             uint color_232073_backing_offset_3,\n                                             uint color_232072_backing_offset_4,\n                                             uint color_232071_backing_offset_5,\n                                             int64_t n_203490,\n                                             int64_t partition_sizze_203577,\n                                             int64_t i_203670,\n                                             int32_t iters_206665, __global\n                                             unsigned char *ext_mem_231561,\n                                             __global unsigned char *mem_231721,\n                                             __global\n                                             unsigned char *color_232069,\n                                             __global\n                                             unsigned char *color_232070)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *color_232076_backing_5 =\n                           &shared_mem[color_232076_backing_offs",
            "et_0];\n    volatile unsigned char *color_232075_backing_4 =\n                           &shared_mem[color_232075_backing_offset_1];\n    volatile unsigned char *color_232074_backing_3 =\n                           &shared_mem[color_232074_backing_offset_2];\n    volatile unsigned char *color_232073_backing_2 =\n                           &shared_mem[color_232073_backing_offset_3];\n    volatile unsigned char *color_232072_backing_1 =\n                           &shared_mem[color_232072_backing_offset_4];\n    volatile unsigned char *color_232071_backing_0 =\n                           &shared_mem[color_232071_backing_offset_5];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236600;\n    int32_t local_tid_236601;\n    int64_t group_sizze_236604;\n    int32_t wave_sizze_236603;\n    int32_t group_tid_236602;\n    \n    global_tid_236600 = get_global_id(0);\n    local_tid_236601 = get_local_id(0);\n    group_sizze_236604 = get_local_size(0);\n    wave_sizze_236603 = LOCKSTEP_WIDTH;\n    group_tid_236602 = get_group_id(0);\n    \n    int32_t phys_tid_227359 = group_tid_236602;\n    int64_t slice_236606 = n_203490;\n    int64_t ltid_pre_236605 = sext_i32_i64(local_tid_236601);\n    int64_t remnant_236607 = sext_i32_i64(local_tid_236601) - ltid_pre_236605;\n    int64_t slice_236608 = partition_sizze_203577;\n    int64_t gtid_227358 = sext_i32_i64(group_tid_236602);\n    int64_t remnant_236609 = sext_i32_i64(group_tid_236602) - gtid_227358;\n    __local unsigned char *color_232071;\n    \n    color_232071 = (__local unsigned char *) color_232071_backing_0;\n    \n    __local unsigned char *color_232072;\n    \n    color_232072 = (__local unsigned char *) color_232072_backing_1;\n    \n    __local unsigned char *color_232073;\n    \n    color_232073 = (__local unsigned char *) color_232073_backing_2;\n    \n    __local unsigned char *color_232074;\n    \n    color_232074 = (__local unsigned char *) color_232074_backing_3;\n    \n    __local unsigned char *color_232075;\n    \n    color_2",
            "32075 = (__local unsigned char *) color_232075_backing_4;\n    \n    __local unsigned char *color_232076;\n    \n    color_232076 = (__local unsigned char *) color_232076_backing_5;\n    \n    double tmp_236610;\n    \n    tmp_236610 = ((__global double *) ext_mem_231561)[gtid_227358 * n_203490 +\n                                                      sext_i32_i64(local_tid_236601)];\n    ((__global double *) color_232069)[phys_tid_227359 * n_203490 +\n                                       sext_i32_i64(local_tid_236601)] =\n        tmp_236610;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    __global unsigned char *ext_mem_231713;\n    __global unsigned char *ext_mem_unused_231961;\n    __global unsigned char *mem_param_231684;\n    __global unsigned char *mem_param_out_231962;\n    \n    mem_param_231684 = color_232069;\n    mem_param_out_231962 = color_232070;\n    for (int32_t i_227363 = 0; i_227363 < iters_206665; i_227363++) {\n        int32_t defunc_2_radix_sort_step_arg_227365 = mul32(2, i_227363);\n        int32_t defunc_0_get_bit_arg_227366 = add32(1,\n                                                    defunc_2_radix_sort_step_arg_227365);\n        bool cond_f_res_227367 = defunc_0_get_bit_arg_227366 == 63;\n        bool cond_f_res_227368 = defunc_2_radix_sort_step_arg_227365 == 63;\n        int64_t unsign_arg_227369 = zext_i32_i64(defunc_0_get_bit_arg_227366);\n        int64_t unsign_arg_227370 =\n                zext_i32_i64(defunc_2_radix_sort_step_arg_227365);\n        int64_t gtid_227376 = sext_i32_i64(sext_i64_i32(ltid_pre_236605));\n        int32_t phys_tid_227377 = local_tid_236601;\n        double x_227390;\n        \n        x_227390 = ((__global double *) mem_param_231684)[phys_tid_227359 *\n                                                          n_203490 +\n                                                          gtid_227376];\n        \n        int64_t i64_arg_227391;\n        \n        i64_arg_227391 = futrts_to_bits64(x_227390);\n        \n        int64_t unsign_arg_227392 = ashr64(i",
            "64_arg_227391, unsign_arg_227369);\n        int64_t unsign_arg_227393 = (int64_t) 1 & unsign_arg_227392;\n        int32_t to_i32_res_227394 = zext_i64_i32(unsign_arg_227393);\n        int64_t unsign_arg_227395 = ashr64(i64_arg_227391, (int64_t) 63);\n        int64_t unsign_arg_227396 = (int64_t) 1 & unsign_arg_227395;\n        int32_t to_i32_res_227397 = zext_i64_i32(unsign_arg_227396);\n        bool cond_227398 = to_i32_res_227397 == 1;\n        bool x_227399 = !cond_227398;\n        bool y_227400 = cond_f_res_227367 && x_227399;\n        bool cond_227401 = cond_227398 || y_227400;\n        int32_t defunc_1_get_bit_res_227402;\n        \n        if (cond_227401) {\n            int32_t defunc_1_get_bit_res_t_res_227403 = 1 ^ to_i32_res_227394;\n            \n            defunc_1_get_bit_res_227402 = defunc_1_get_bit_res_t_res_227403;\n        } else {\n            defunc_1_get_bit_res_227402 = to_i32_res_227394;\n        }\n        \n        int32_t x_227404 = mul32(2, defunc_1_get_bit_res_227402);\n        int64_t unsign_arg_227405 = ashr64(i64_arg_227391, unsign_arg_227370);\n        int64_t unsign_arg_227406 = (int64_t) 1 & unsign_arg_227405;\n        int32_t to_i32_res_227407 = zext_i64_i32(unsign_arg_227406);\n        bool y_227408 = cond_f_res_227368 && x_227399;\n        bool cond_227409 = cond_227398 || y_227408;\n        int32_t defunc_1_get_bit_res_227410;\n        \n        if (cond_227409) {\n            int32_t defunc_1_get_bit_res_t_res_227411 = 1 ^ to_i32_res_227407;\n            \n            defunc_1_get_bit_res_227410 = defunc_1_get_bit_res_t_res_227411;\n        } else {\n            defunc_1_get_bit_res_227410 = to_i32_res_227407;\n        }\n        \n        int32_t defunc_0_f_res_227412 = add32(x_227404,\n                                              defunc_1_get_bit_res_227410);\n        bool cond_227413 = defunc_0_f_res_227412 == 0;\n        int64_t defunc_0_f_res_227414 = btoi_bool_i64(cond_227413);\n        int64_t defunc_0_f_res_227415;\n        int64_t defunc_0_f_res_227416;\n  ",
            "      int64_t defunc_0_f_res_227417;\n        \n        if (cond_227413) {\n            defunc_0_f_res_227415 = (int64_t) 0;\n            defunc_0_f_res_227416 = (int64_t) 0;\n            defunc_0_f_res_227417 = (int64_t) 0;\n        } else {\n            bool cond_227418 = defunc_0_f_res_227412 == 1;\n            int64_t defunc_0_f_res_f_res_227419 = btoi_bool_i64(cond_227418);\n            int64_t defunc_0_f_res_f_res_227420;\n            int64_t defunc_0_f_res_f_res_227421;\n            \n            if (cond_227418) {\n                defunc_0_f_res_f_res_227420 = (int64_t) 0;\n                defunc_0_f_res_f_res_227421 = (int64_t) 0;\n            } else {\n                bool cond_227422 = defunc_0_f_res_227412 == 2;\n                int64_t defunc_0_f_res_f_res_f_res_227423 =\n                        btoi_bool_i64(cond_227422);\n                bool cond_neg_227424 = !cond_227422;\n                int64_t defunc_0_f_res_f_res_f_res_227425 =\n                        btoi_bool_i64(cond_neg_227424);\n                \n                defunc_0_f_res_f_res_227420 = defunc_0_f_res_f_res_f_res_227423;\n                defunc_0_f_res_f_res_227421 = defunc_0_f_res_f_res_f_res_227425;\n            }\n            defunc_0_f_res_227415 = defunc_0_f_res_f_res_227419;\n            defunc_0_f_res_227416 = defunc_0_f_res_f_res_227420;\n            defunc_0_f_res_227417 = defunc_0_f_res_f_res_227421;\n        }\n        ((__local int64_t *) color_232076)[gtid_227376] = defunc_0_f_res_227414;\n        ((__local int64_t *) color_232075)[gtid_227376] = defunc_0_f_res_227415;\n        ((__local int64_t *) color_232074)[gtid_227376] = defunc_0_f_res_227416;\n        ((__local int64_t *) color_232073)[gtid_227376] = defunc_0_f_res_227417;\n        ((__local int32_t *) color_232072)[gtid_227376] = defunc_0_f_res_227412;\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int64_t dims_flat_236614 = n_203490;\n        int64_t x_227378;\n        int64_t x_227379;\n        int64_t x_227380;\n        int64_t x_227381;\n  ",
            "      int64_t x_227382;\n        int64_t x_227383;\n        int64_t x_227384;\n        int64_t x_227385;\n        int64_t x_236619;\n        int64_t x_236620;\n        int64_t x_236621;\n        int64_t x_236622;\n        int64_t x_236623;\n        int64_t x_236624;\n        int64_t x_236625;\n        int64_t x_236626;\n        bool ltid_in_bounds_236631 = slt64(sext_i32_i64(local_tid_236601),\n                                           n_203490);\n        int32_t skip_threads_236632;\n        \n        // read input for in-block scan\n        {\n            if (ltid_in_bounds_236631) {\n                x_227382 = ((volatile __local\n                             int64_t *) color_232076)[sext_i32_i64(local_tid_236601)];\n                x_227383 = ((volatile __local\n                             int64_t *) color_232075)[sext_i32_i64(local_tid_236601)];\n                x_227384 = ((volatile __local\n                             int64_t *) color_232074)[sext_i32_i64(local_tid_236601)];\n                x_227385 = ((volatile __local\n                             int64_t *) color_232073)[sext_i32_i64(local_tid_236601)];\n                if ((local_tid_236601 - squot32(local_tid_236601, 32) * 32) ==\n                    0) {\n                    x_227378 = x_227382;\n                    x_227379 = x_227383;\n                    x_227380 = x_227384;\n                    x_227381 = x_227385;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_236632 = 1;\n            while (slt32(skip_threads_236632, 32)) {\n                bool thread_active_236633 = sle32(skip_threads_236632,\n                                                  local_tid_236601 -\n                                                  squot32(local_tid_236601,\n                                                          32) * 32) &&\n                     ltid_in_bounds_236631;\n                \n                if (thread_active_236633) {\n                    // read operan",
            "ds\n                    {\n                        x_227378 = ((volatile __local\n                                     int64_t *) color_232076)[sext_i32_i64(local_tid_236601) -\n                                                              sext_i32_i64(skip_threads_236632)];\n                        x_227379 = ((volatile __local\n                                     int64_t *) color_232075)[sext_i32_i64(local_tid_236601) -\n                                                              sext_i32_i64(skip_threads_236632)];\n                        x_227380 = ((volatile __local\n                                     int64_t *) color_232074)[sext_i32_i64(local_tid_236601) -\n                                                              sext_i32_i64(skip_threads_236632)];\n                        x_227381 = ((volatile __local\n                                     int64_t *) color_232073)[sext_i32_i64(local_tid_236601) -\n                                                              sext_i32_i64(skip_threads_236632)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_236634 =\n                         slt64(srem64(sext_i32_i64(local_tid_236601), n_203490),\n                               sext_i32_i64(local_tid_236601) -\n                               sext_i32_i64(local_tid_236601 -\n                               skip_threads_236632));\n                    \n                    if (thread_active_236633 && inactive_236634) {\n                        x_227378 = x_227382;\n                        x_227379 = x_227383;\n                        x_227380 = x_227384;\n                        x_227381 = x_227385;\n                    }\n                    if (thread_active_236633) {\n                        if (!inactive_236634) {\n                            int64_t defunc_1_op_res_227386 = add64(x_227378,\n                                                                   x_227382);\n                            int64_t defunc_1_o",
            "p_res_227387 = add64(x_227379,\n                                                                   x_227383);\n                            int64_t defunc_1_op_res_227388 = add64(x_227380,\n                                                                   x_227384);\n                            int64_t defunc_1_op_res_227389 = add64(x_227381,\n                                                                   x_227385);\n                            \n                            x_227378 = defunc_1_op_res_227386;\n                            x_227379 = defunc_1_op_res_227387;\n                            x_227380 = defunc_1_op_res_227388;\n                            x_227381 = defunc_1_op_res_227389;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_236603, skip_threads_236632)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_236633) {\n                    // write result\n                    {\n                        ((volatile __local\n                          int64_t *) color_232076)[sext_i32_i64(local_tid_236601)] =\n                            x_227378;\n                        x_227382 = x_227378;\n                        ((volatile __local\n                          int64_t *) color_232075)[sext_i32_i64(local_tid_236601)] =\n                            x_227379;\n                        x_227383 = x_227379;\n                        ((volatile __local\n                          int64_t *) color_232074)[sext_i32_i64(local_tid_236601)] =\n                            x_227380;\n                        x_227384 = x_227380;\n                        ((volatile __local\n                          int64_t *) color_232073)[sext_i32_i64(local_tid_236601)] =\n                            x_227381;\n                        x_227385 = x_227381;\n                    }\n                }\n                if (sle32(wave_sizze_236603, skip_threads_236632)) {\n                    barrier(CLK_LOCAL_MEM_",
            "FENCE);\n                }\n                skip_threads_236632 *= 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_236601 - squot32(local_tid_236601, 32) * 32) == 31 &&\n                ltid_in_bounds_236631) {\n                ((volatile __local\n                  int64_t *) color_232076)[sext_i32_i64(squot32(local_tid_236601,\n                                                                32))] =\n                    x_227378;\n                ((volatile __local\n                  int64_t *) color_232075)[sext_i32_i64(squot32(local_tid_236601,\n                                                                32))] =\n                    x_227379;\n                ((volatile __local\n                  int64_t *) color_232074)[sext_i32_i64(squot32(local_tid_236601,\n                                                                32))] =\n                    x_227380;\n                ((volatile __local\n                  int64_t *) color_232073)[sext_i32_i64(squot32(local_tid_236601,\n                                                                32))] =\n                    x_227381;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n        {\n            int32_t skip_threads_236635;\n            \n            // read input for in-block scan\n            {\n                if (squot32(local_tid_236601, 32) == 0 &&\n                    ltid_in_bounds_236631) {\n                    x_236623 = ((volatile __local\n                                 int64_t *) color_232076)[sext_i32_i64(local_tid_236601)];\n                    x_236624 = ((volatile __local\n                                 int64_t *) color_232075)[sext_i32_i64(local_tid_236601)];\n                    x_236625 = ((volatile __local\n                                 int64_t *) color_232074)[sext_i32_i64(local_tid_2366",
            "01)];\n                    x_236626 = ((volatile __local\n                                 int64_t *) color_232073)[sext_i32_i64(local_tid_236601)];\n                    if ((local_tid_236601 - squot32(local_tid_236601, 32) *\n                         32) == 0) {\n                        x_236619 = x_236623;\n                        x_236620 = x_236624;\n                        x_236621 = x_236625;\n                        x_236622 = x_236626;\n                    }\n                }\n            }\n            // in-block scan (hopefully no barriers needed)\n            {\n                skip_threads_236635 = 1;\n                while (slt32(skip_threads_236635, 32)) {\n                    bool thread_active_236636 = sle32(skip_threads_236635,\n                                                      local_tid_236601 -\n                                                      squot32(local_tid_236601,\n                                                              32) * 32) &&\n                         (squot32(local_tid_236601, 32) == 0 &&\n                          ltid_in_bounds_236631);\n                    \n                    if (thread_active_236636) {\n                        // read operands\n                        {\n                            x_236619 = ((volatile __local\n                                         int64_t *) color_232076)[sext_i32_i64(local_tid_236601) -\n                                                                  sext_i32_i64(skip_threads_236635)];\n                            x_236620 = ((volatile __local\n                                         int64_t *) color_232075)[sext_i32_i64(local_tid_236601) -\n                                                                  sext_i32_i64(skip_threads_236635)];\n                            x_236621 = ((volatile __local\n                                         int64_t *) color_232074)[sext_i32_i64(local_tid_236601) -\n                                                                  sext_i32_i64(skip_threads_236635)];\n    ",
            "                        x_236622 = ((volatile __local\n                                         int64_t *) color_232073)[sext_i32_i64(local_tid_236601) -\n                                                                  sext_i32_i64(skip_threads_236635)];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_236637 =\n                             slt64(srem64(sext_i32_i64(local_tid_236601 * 32 +\n                                          32 - 1), n_203490),\n                                   sext_i32_i64(local_tid_236601 * 32 + 32 -\n                                   1) - sext_i32_i64((local_tid_236601 -\n                                                      skip_threads_236635) *\n                                   32 + 32 - 1));\n                        \n                        if (thread_active_236636 && inactive_236637) {\n                            x_236619 = x_236623;\n                            x_236620 = x_236624;\n                            x_236621 = x_236625;\n                            x_236622 = x_236626;\n                        }\n                        if (thread_active_236636) {\n                            if (!inactive_236637) {\n                                int64_t defunc_1_op_res_236627 = add64(x_236619,\n                                                                       x_236623);\n                                int64_t defunc_1_op_res_236628 = add64(x_236620,\n                                                                       x_236624);\n                                int64_t defunc_1_op_res_236629 = add64(x_236621,\n                                                                       x_236625);\n                                int64_t defunc_1_op_res_236630 = add64(x_236622,\n                                                                       x_236626);\n                                \n                                x_236619 = defunc_1_op_res_236",
            "627;\n                                x_236620 = defunc_1_op_res_236628;\n                                x_236621 = defunc_1_op_res_236629;\n                                x_236622 = defunc_1_op_res_236630;\n                            }\n                        }\n                    }\n                    if (sle32(wave_sizze_236603, skip_threads_236635)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    if (thread_active_236636) {\n                        // write result\n                        {\n                            ((volatile __local\n                              int64_t *) color_232076)[sext_i32_i64(local_tid_236601)] =\n                                x_236619;\n                            x_236623 = x_236619;\n                            ((volatile __local\n                              int64_t *) color_232075)[sext_i32_i64(local_tid_236601)] =\n                                x_236620;\n                            x_236624 = x_236620;\n                            ((volatile __local\n                              int64_t *) color_232074)[sext_i32_i64(local_tid_236601)] =\n                                x_236621;\n                            x_236625 = x_236621;\n                            ((volatile __local\n                              int64_t *) color_232073)[sext_i32_i64(local_tid_236601)] =\n                                x_236622;\n                            x_236626 = x_236622;\n                        }\n                    }\n                    if (sle32(wave_sizze_236603, skip_threads_236635)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    skip_threads_236635 *= 2;\n                }\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        bool no_carry_in_236638 = squot32(local_tid_236601, 32) == 0 ||\n             !ltid_in_bounds_236631;\n        \n        // carry-in for every block except the first\n        {\n            // read operands\n   ",
            "         {\n                if (!no_carry_in_236638) {\n                    x_227382 = x_227378;\n                    x_227383 = x_227379;\n                    x_227384 = x_227380;\n                    x_227385 = x_227381;\n                    x_227378 = ((__local\n                                 int64_t *) color_232076)[sext_i32_i64(squot32(local_tid_236601,\n                                                                               32)) -\n                                                          (int64_t) 1];\n                    x_227379 = ((__local\n                                 int64_t *) color_232075)[sext_i32_i64(squot32(local_tid_236601,\n                                                                               32)) -\n                                                          (int64_t) 1];\n                    x_227380 = ((__local\n                                 int64_t *) color_232074)[sext_i32_i64(squot32(local_tid_236601,\n                                                                               32)) -\n                                                          (int64_t) 1];\n                    x_227381 = ((__local\n                                 int64_t *) color_232073)[sext_i32_i64(squot32(local_tid_236601,\n                                                                               32)) -\n                                                          (int64_t) 1];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_236639 =\n                     slt64(srem64(sext_i32_i64(local_tid_236601), n_203490),\n                           sext_i32_i64(local_tid_236601) -\n                           sext_i32_i64(squot32(local_tid_236601, 32) * 32 -\n                           1));\n                \n                if (!no_carry_in_236638) {\n                    if (inactive_236639) {\n                        x_227378 = x_227382;\n                        x_227379 = x_227383;\n                        x_227380 = x_2273",
            "84;\n                        x_227381 = x_227385;\n                    }\n                }\n                if (!no_carry_in_236638) {\n                    if (!inactive_236639) {\n                        int64_t defunc_1_op_res_227386 = add64(x_227378,\n                                                               x_227382);\n                        int64_t defunc_1_op_res_227387 = add64(x_227379,\n                                                               x_227383);\n                        int64_t defunc_1_op_res_227388 = add64(x_227380,\n                                                               x_227384);\n                        int64_t defunc_1_op_res_227389 = add64(x_227381,\n                                                               x_227385);\n                        \n                        x_227378 = defunc_1_op_res_227386;\n                        x_227379 = defunc_1_op_res_227387;\n                        x_227380 = defunc_1_op_res_227388;\n                        x_227381 = defunc_1_op_res_227389;\n                    }\n                }\n            }\n            // write final result\n            {\n                if (!no_carry_in_236638) {\n                    ((__local\n                      int64_t *) color_232076)[sext_i32_i64(local_tid_236601)] =\n                        x_227378;\n                    ((__local\n                      int64_t *) color_232075)[sext_i32_i64(local_tid_236601)] =\n                        x_227379;\n                    ((__local\n                      int64_t *) color_232074)[sext_i32_i64(local_tid_236601)] =\n                        x_227380;\n                    ((__local\n                      int64_t *) color_232073)[sext_i32_i64(local_tid_236601)] =\n                        x_227381;\n                }\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // restore correct values for first block\n        {\n            if (squot32(local_tid_236601, 32) == 0 && ltid_in_bounds_236631) {\n                ((__local\n     ",
            "             int64_t *) color_232076)[sext_i32_i64(local_tid_236601)] =\n                    x_227382;\n                ((__local\n                  int64_t *) color_232075)[sext_i32_i64(local_tid_236601)] =\n                    x_227383;\n                ((__local\n                  int64_t *) color_232074)[sext_i32_i64(local_tid_236601)] =\n                    x_227384;\n                ((__local\n                  int64_t *) color_232073)[sext_i32_i64(local_tid_236601)] =\n                    x_227385;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int64_t last_res_227426;\n        \n        last_res_227426 = ((__local int64_t *) color_232076)[i_203670];\n        \n        int64_t last_res_227427;\n        \n        last_res_227427 = ((__local int64_t *) color_232075)[i_203670];\n        \n        int64_t last_res_227428;\n        \n        last_res_227428 = ((__local int64_t *) color_232074)[i_203670];\n        \n        double tmp_236640;\n        \n        tmp_236640 = ((__global double *) mem_param_231684)[phys_tid_227359 *\n                                                            n_203490 +\n                                                            sext_i32_i64(local_tid_236601)];\n        ((__local double *) color_232071)[sext_i32_i64(local_tid_236601)] =\n            tmp_236640;\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int64_t write_i_227431 = sext_i32_i64(sext_i64_i32(ltid_pre_236605));\n        int32_t phys_tid_227432 = local_tid_236601;\n        int32_t x_227433;\n        \n        x_227433 = ((__local int32_t *) color_232072)[write_i_227431];\n        \n        double write_value_227438;\n        \n        write_value_227438 = ((__global\n                               double *) mem_param_231684)[phys_tid_227359 *\n                                                           n_203490 +\n                                                           write_i_227431];\n        \n        bool match_lit_227439 = 0 == x_227433;\n        int64_t defunc_1_f",
            "_res_227440;\n        \n        if (match_lit_227439) {\n            int64_t x_227434;\n            \n            x_227434 = ((__local int64_t *) color_232076)[write_i_227431];\n            \n            int64_t case_res_227441 = sub64(x_227434, (int64_t) 1);\n            \n            defunc_1_f_res_227440 = case_res_227441;\n        } else {\n            bool match_lit_227442 = 1 == x_227433;\n            int64_t x_227443;\n            \n            if (match_lit_227442) {\n                int64_t x_227435;\n                \n                x_227435 = ((__local int64_t *) color_232075)[write_i_227431];\n                \n                int64_t x_227444 = add64(last_res_227426, x_227435);\n                int64_t case_res_227445 = sub64(x_227444, (int64_t) 1);\n                \n                x_227443 = case_res_227445;\n            } else {\n                bool match_lit_227446 = 2 == x_227433;\n                int64_t x_227447;\n                \n                if (match_lit_227446) {\n                    int64_t x_227436;\n                    \n                    x_227436 = ((__local\n                                 int64_t *) color_232074)[write_i_227431];\n                    \n                    int64_t x_227448 = add64(last_res_227426, last_res_227427);\n                    int64_t x_227449 = add64(x_227436, x_227448);\n                    int64_t case_res_227450 = sub64(x_227449, (int64_t) 1);\n                    \n                    x_227447 = case_res_227450;\n                } else {\n                    int64_t x_227437;\n                    \n                    x_227437 = ((__local\n                                 int64_t *) color_232073)[write_i_227431];\n                    \n                    int64_t x_227451 = add64(last_res_227426, last_res_227427);\n                    int64_t x_227452 = add64(last_res_227428, x_227451);\n                    int64_t x_227453 = add64(x_227437, x_227452);\n                    int64_t defunc_1_f_res_res_227454 = sub64(x_227453,\n                   ",
            "                                           (int64_t) 1);\n                    \n                    x_227447 = defunc_1_f_res_res_227454;\n                }\n                x_227443 = x_227447;\n            }\n            defunc_1_f_res_227440 = x_227443;\n        }\n        if (sle64((int64_t) 0, defunc_1_f_res_227440) &&\n            slt64(defunc_1_f_res_227440, n_203490)) {\n            ((__local double *) color_232071)[defunc_1_f_res_227440] =\n                write_value_227438;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        double tmp_236641;\n        \n        tmp_236641 = ((__local\n                       double *) color_232071)[sext_i32_i64(local_tid_236601)];\n        ((__global double *) mem_param_out_231962)[phys_tid_227359 * n_203490 +\n                                                   sext_i32_i64(local_tid_236601)] =\n            tmp_236641;\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        __global unsigned char *mem_param_tmp_236611;\n        \n        mem_param_tmp_236611 = mem_param_out_231962;\n        \n        __global unsigned char *mem_param_out_tmp_236612;\n        \n        mem_param_out_tmp_236612 = mem_param_231684;\n        mem_param_231684 = mem_param_tmp_236611;\n        mem_param_out_231962 = mem_param_out_tmp_236612;\n    }\n    ext_mem_231713 = mem_param_231684;\n    ext_mem_unused_231961 = mem_param_out_231962;\n    if (local_tid_236601 == 0) {\n        for (int64_t i_236642 = 0; i_236642 < n_203490; i_236642++) {\n            double tmp_236643;\n            \n            tmp_236643 = ((__global double *) ext_mem_231713)[phys_tid_227359 *\n                                                              n_203490 +\n                                                              i_236642];\n            ((__global double *) mem_231721)[gtid_227358 * n_203490 +\n                                             i_236642] = tmp_236643;\n        }\n    }\n    \n  error_2:\n    return;\n}\n__kernel void mainzisegmap_intragroup_227815(__global int *global_failure,\n  ",
            "                                           uint color_232082_backing_offset_0,\n                                             uint color_232081_backing_offset_1,\n                                             uint color_232080_backing_offset_2,\n                                             uint color_232079_backing_offset_3,\n                                             uint color_232078_backing_offset_4,\n                                             uint color_232077_backing_offset_5,\n                                             int64_t n_203490,\n                                             int64_t partition_sizze_203577,\n                                             int64_t i_203670,\n                                             unsigned char cond_f_res_227801_bits,\n                                             unsigned char cond_f_res_227802_bits,\n                                             int64_t unsign_arg_227803,\n                                             int64_t unsign_arg_227804, __global\n                                             unsigned char *mem_param_231733,\n                                             __global unsigned char *mem_231764)\n{\n    bool cond_f_res_227801 = cond_f_res_227801_bits;\n    bool cond_f_res_227802 = cond_f_res_227802_bits;\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *color_232082_backing_5 =\n                           &shared_mem[color_232082_backing_offset_0];\n    volatile unsigned char *color_232081_backing_4 =\n                           &shared_mem[color_232081_backing_offset_1];\n    volatile unsigned char *color_232080_backing_3 =\n                           &shared_mem[color_232080_backing_offset_2];\n    volatile unsigned char *color_232079_backing_2 =\n                           &shared_mem[color_232079_backing_offset_3];\n    volatile unsigned char *color_232078_backing_1 =\n                           &shared_mem[color_232078_backing_offset_4];\n    volatile unsi",
            "gned char *color_232077_backing_0 =\n                           &shared_mem[color_232077_backing_offset_5];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236646;\n    int32_t local_tid_236647;\n    int64_t group_sizze_236650;\n    int32_t wave_sizze_236649;\n    int32_t group_tid_236648;\n    \n    global_tid_236646 = get_global_id(0);\n    local_tid_236647 = get_local_id(0);\n    group_sizze_236650 = get_local_size(0);\n    wave_sizze_236649 = LOCKSTEP_WIDTH;\n    group_tid_236648 = get_group_id(0);\n    \n    int32_t phys_tid_227815 = group_tid_236648;\n    int64_t slice_236652 = n_203490;\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_203577;\n    int64_t gtid_227814 = sext_i32_i64(group_tid_236648);\n    int64_t remnant_236655 = sext_i32_i64(group_tid_236648) - gtid_227814;\n    __local unsigned char *color_232077;\n    \n    color_232077 = (__local unsigned char *) color_232077_backing_0;\n    \n    __local unsigned char *color_232078;\n    \n    color_232078 = (__local unsigned char *) color_232078_backing_1;\n    \n    __local unsigned char *color_232079;\n    \n    color_232079 = (__local unsigned char *) color_232079_backing_2;\n    \n    __local unsigned char *color_232080;\n    \n    color_232080 = (__local unsigned char *) color_232080_backing_3;\n    \n    __local unsigned char *color_232081;\n    \n    color_232081 = (__local unsigned char *) color_232081_backing_4;\n    \n    __local unsigned char *color_232082;\n    \n    color_232082 = (__local unsigned char *) color_232082_backing_5;\n    \n    double tmp_236656;\n    \n    tmp_236656 = ((__global double *) mem_param_231733)[gtid_227814 * n_203490 +\n                                                        sext_i32_i64(local_tid_236647)];\n    ((__local double *) color_232082)[sext_i32_i64(local_tid_236647)] =\n        tmp_236656;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int6",
            "4_t gtid_227825 = sext_i32_i64(sext_i64_i32(ltid_pre_236651));\n    int32_t phys_tid_227826 = local_tid_236647;\n    double x_227839;\n    \n    x_227839 = ((__global double *) mem_param_231733)[gtid_227814 * n_203490 +\n                                                      gtid_227825];\n    \n    int64_t i64_arg_227840;\n    \n    i64_arg_227840 = futrts_to_bits64(x_227839);\n    \n    int64_t unsign_arg_227841 = ashr64(i64_arg_227840, unsign_arg_227803);\n    int64_t unsign_arg_227842 = (int64_t) 1 & unsign_arg_227841;\n    int32_t to_i32_res_227843 = zext_i64_i32(unsign_arg_227842);\n    int64_t unsign_arg_227844 = ashr64(i64_arg_227840, (int64_t) 63);\n    int64_t unsign_arg_227845 = (int64_t) 1 & unsign_arg_227844;\n    int32_t to_i32_res_227846 = zext_i64_i32(unsign_arg_227845);\n    bool cond_227847 = to_i32_res_227846 == 1;\n    bool x_227848 = !cond_227847;\n    bool y_227849 = cond_f_res_227801 && x_227848;\n    bool cond_227850 = cond_227847 || y_227849;\n    int32_t defunc_1_get_bit_res_227851;\n    \n    if (cond_227850) {\n        int32_t defunc_1_get_bit_res_t_res_227852 = 1 ^ to_i32_res_227843;\n        \n        defunc_1_get_bit_res_227851 = defunc_1_get_bit_res_t_res_227852;\n    } else {\n        defunc_1_get_bit_res_227851 = to_i32_res_227843;\n    }\n    \n    int32_t x_227853 = mul32(2, defunc_1_get_bit_res_227851);\n    int64_t unsign_arg_227854 = ashr64(i64_arg_227840, unsign_arg_227804);\n    int64_t unsign_arg_227855 = (int64_t) 1 & unsign_arg_227854;\n    int32_t to_i32_res_227856 = zext_i64_i32(unsign_arg_227855);\n    bool y_227857 = cond_f_res_227802 && x_227848;\n    bool cond_227858 = cond_227847 || y_227857;\n    int32_t defunc_1_get_bit_res_227859;\n    \n    if (cond_227858) {\n        int32_t defunc_1_get_bit_res_t_res_227860 = 1 ^ to_i32_res_227856;\n        \n        defunc_1_get_bit_res_227859 = defunc_1_get_bit_res_t_res_227860;\n    } else {\n        defunc_1_get_bit_res_227859 = to_i32_res_227856;\n    }\n    \n    int32_t defunc_0_f_res_227861 = add32(x_227853,\n       ",
            "                                   defunc_1_get_bit_res_227859);\n    bool cond_227862 = defunc_0_f_res_227861 == 0;\n    int64_t defunc_0_f_res_227863 = btoi_bool_i64(cond_227862);\n    int64_t defunc_0_f_res_227864;\n    int64_t defunc_0_f_res_227865;\n    int64_t defunc_0_f_res_227866;\n    \n    if (cond_227862) {\n        defunc_0_f_res_227864 = (int64_t) 0;\n        defunc_0_f_res_227865 = (int64_t) 0;\n        defunc_0_f_res_227866 = (int64_t) 0;\n    } else {\n        bool cond_227867 = defunc_0_f_res_227861 == 1;\n        int64_t defunc_0_f_res_f_res_227868 = btoi_bool_i64(cond_227867);\n        int64_t defunc_0_f_res_f_res_227869;\n        int64_t defunc_0_f_res_f_res_227870;\n        \n        if (cond_227867) {\n            defunc_0_f_res_f_res_227869 = (int64_t) 0;\n            defunc_0_f_res_f_res_227870 = (int64_t) 0;\n        } else {\n            bool cond_227871 = defunc_0_f_res_227861 == 2;\n            int64_t defunc_0_f_res_f_res_f_res_227872 =\n                    btoi_bool_i64(cond_227871);\n            bool cond_neg_227873 = !cond_227871;\n            int64_t defunc_0_f_res_f_res_f_res_227874 =\n                    btoi_bool_i64(cond_neg_227873);\n            \n            defunc_0_f_res_f_res_227869 = defunc_0_f_res_f_res_f_res_227872;\n            defunc_0_f_res_f_res_227870 = defunc_0_f_res_f_res_f_res_227874;\n        }\n        defunc_0_f_res_227864 = defunc_0_f_res_f_res_227868;\n        defunc_0_f_res_227865 = defunc_0_f_res_f_res_227869;\n        defunc_0_f_res_227866 = defunc_0_f_res_f_res_227870;\n    }\n    ((__local int64_t *) color_232081)[gtid_227825] = defunc_0_f_res_227863;\n    ((__local int64_t *) color_232080)[gtid_227825] = defunc_0_f_res_227864;\n    ((__local int64_t *) color_232079)[gtid_227825] = defunc_0_f_res_227865;\n    ((__local int64_t *) color_232078)[gtid_227825] = defunc_0_f_res_227866;\n    ((__local int32_t *) color_232077)[gtid_227825] = defunc_0_f_res_227861;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t dims_flat_236657 = n_203490;\n    in",
            "t64_t x_227827;\n    int64_t x_227828;\n    int64_t x_227829;\n    int64_t x_227830;\n    int64_t x_227831;\n    int64_t x_227832;\n    int64_t x_227833;\n    int64_t x_227834;\n    int64_t x_236662;\n    int64_t x_236663;\n    int64_t x_236664;\n    int64_t x_236665;\n    int64_t x_236666;\n    int64_t x_236667;\n    int64_t x_236668;\n    int64_t x_236669;\n    bool ltid_in_bounds_236674 = slt64(sext_i32_i64(local_tid_236647),\n                                       n_203490);\n    int32_t skip_threads_236675;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_236674) {\n            x_227831 = ((volatile __local\n                         int64_t *) color_232081)[sext_i32_i64(local_tid_236647)];\n            x_227832 = ((volatile __local\n                         int64_t *) color_232080)[sext_i32_i64(local_tid_236647)];\n            x_227833 = ((volatile __local\n                         int64_t *) color_232079)[sext_i32_i64(local_tid_236647)];\n            x_227834 = ((volatile __local\n                         int64_t *) color_232078)[sext_i32_i64(local_tid_236647)];\n            if ((local_tid_236647 - squot32(local_tid_236647, 32) * 32) == 0) {\n                x_227827 = x_227831;\n                x_227828 = x_227832;\n                x_227829 = x_227833;\n                x_227830 = x_227834;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_236675 = 1;\n        while (slt32(skip_threads_236675, 32)) {\n            bool thread_active_236676 = sle32(skip_threads_236675,\n                                              local_tid_236647 -\n                                              squot32(local_tid_236647, 32) *\n                                              32) && ltid_in_bounds_236674;\n            \n            if (thread_active_236676) {\n                // read operands\n                {\n                    x_227827 = ((volatile __local\n                                 int64_t *) color_232081)[sext_i32_i64(local_t",
            "id_236647) -\n                                                          sext_i32_i64(skip_threads_236675)];\n                    x_227828 = ((volatile __local\n                                 int64_t *) color_232080)[sext_i32_i64(local_tid_236647) -\n                                                          sext_i32_i64(skip_threads_236675)];\n                    x_227829 = ((volatile __local\n                                 int64_t *) color_232079)[sext_i32_i64(local_tid_236647) -\n                                                          sext_i32_i64(skip_threads_236675)];\n                    x_227830 = ((volatile __local\n                                 int64_t *) color_232078)[sext_i32_i64(local_tid_236647) -\n                                                          sext_i32_i64(skip_threads_236675)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_236677 =\n                     slt64(srem64(sext_i32_i64(local_tid_236647), n_203490),\n                           sext_i32_i64(local_tid_236647) -\n                           sext_i32_i64(local_tid_236647 -\n                           skip_threads_236675));\n                \n                if (thread_active_236676 && inactive_236677) {\n                    x_227827 = x_227831;\n                    x_227828 = x_227832;\n                    x_227829 = x_227833;\n                    x_227830 = x_227834;\n                }\n                if (thread_active_236676) {\n                    if (!inactive_236677) {\n                        int64_t defunc_1_op_res_227835 = add64(x_227827,\n                                                               x_227831);\n                        int64_t defunc_1_op_res_227836 = add64(x_227828,\n                                                               x_227832);\n                        int64_t defunc_1_op_res_227837 = add64(x_227829,\n                                                               x_227833);\n                        int64_t d",
            "efunc_1_op_res_227838 = add64(x_227830,\n                                                               x_227834);\n                        \n                        x_227827 = defunc_1_op_res_227835;\n                        x_227828 = defunc_1_op_res_227836;\n                        x_227829 = defunc_1_op_res_227837;\n                        x_227830 = defunc_1_op_res_227838;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_236649, skip_threads_236675)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (thread_active_236676) {\n                // write result\n                {\n                    ((volatile __local\n                      int64_t *) color_232081)[sext_i32_i64(local_tid_236647)] =\n                        x_227827;\n                    x_227831 = x_227827;\n                    ((volatile __local\n                      int64_t *) color_232080)[sext_i32_i64(local_tid_236647)] =\n                        x_227828;\n                    x_227832 = x_227828;\n                    ((volatile __local\n                      int64_t *) color_232079)[sext_i32_i64(local_tid_236647)] =\n                        x_227829;\n                    x_227833 = x_227829;\n                    ((volatile __local\n                      int64_t *) color_232078)[sext_i32_i64(local_tid_236647)] =\n                        x_227830;\n                    x_227834 = x_227830;\n                }\n            }\n            if (sle32(wave_sizze_236649, skip_threads_236675)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_236675 *= 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_236647 - squot32(local_tid_236647, 32) * 32) == 31 &&\n            ltid_in_bounds_236674) {\n            ((volatile __local\n              int64_t *) color_232081)[sext_i32_i64(squot32(local_tid_236647,\n                                      ",
            "                      32))] = x_227827;\n            ((volatile __local\n              int64_t *) color_232080)[sext_i32_i64(squot32(local_tid_236647,\n                                                            32))] = x_227828;\n            ((volatile __local\n              int64_t *) color_232079)[sext_i32_i64(squot32(local_tid_236647,\n                                                            32))] = x_227829;\n            ((volatile __local\n              int64_t *) color_232078)[sext_i32_i64(squot32(local_tid_236647,\n                                                            32))] = x_227830;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n    {\n        int32_t skip_threads_236678;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_236647, 32) == 0 && ltid_in_bounds_236674) {\n                x_236666 = ((volatile __local\n                             int64_t *) color_232081)[sext_i32_i64(local_tid_236647)];\n                x_236667 = ((volatile __local\n                             int64_t *) color_232080)[sext_i32_i64(local_tid_236647)];\n                x_236668 = ((volatile __local\n                             int64_t *) color_232079)[sext_i32_i64(local_tid_236647)];\n                x_236669 = ((volatile __local\n                             int64_t *) color_232078)[sext_i32_i64(local_tid_236647)];\n                if ((local_tid_236647 - squot32(local_tid_236647, 32) * 32) ==\n                    0) {\n                    x_236662 = x_236666;\n                    x_236663 = x_236667;\n                    x_236664 = x_236668;\n                    x_236665 = x_236669;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_236678 = 1;\n            while (slt32(skip_threads_236678, 32)) {\n                bool thread_active_236679 = sle32(skip_threads_236678,\n             ",
            "                                     local_tid_236647 -\n                                                  squot32(local_tid_236647,\n                                                          32) * 32) &&\n                     (squot32(local_tid_236647, 32) == 0 &&\n                      ltid_in_bounds_236674);\n                \n                if (thread_active_236679) {\n                    // read operands\n                    {\n                        x_236662 = ((volatile __local\n                                     int64_t *) color_232081)[sext_i32_i64(local_tid_236647) -\n                                                              sext_i32_i64(skip_threads_236678)];\n                        x_236663 = ((volatile __local\n                                     int64_t *) color_232080)[sext_i32_i64(local_tid_236647) -\n                                                              sext_i32_i64(skip_threads_236678)];\n                        x_236664 = ((volatile __local\n                                     int64_t *) color_232079)[sext_i32_i64(local_tid_236647) -\n                                                              sext_i32_i64(skip_threads_236678)];\n                        x_236665 = ((volatile __local\n                                     int64_t *) color_232078)[sext_i32_i64(local_tid_236647) -\n                                                              sext_i32_i64(skip_threads_236678)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_236680 =\n                         slt64(srem64(sext_i32_i64(local_tid_236647 * 32 + 32 -\n                                      1), n_203490),\n                               sext_i32_i64(local_tid_236647 * 32 + 32 - 1) -\n                               sext_i32_i64((local_tid_236647 -\n                                             skip_threads_236678) * 32 + 32 -\n                               1));\n                    \n                    if (thread_acti",
            "ve_236679 && inactive_236680) {\n                        x_236662 = x_236666;\n                        x_236663 = x_236667;\n                        x_236664 = x_236668;\n                        x_236665 = x_236669;\n                    }\n                    if (thread_active_236679) {\n                        if (!inactive_236680) {\n                            int64_t defunc_1_op_res_236670 = add64(x_236662,\n                                                                   x_236666);\n                            int64_t defunc_1_op_res_236671 = add64(x_236663,\n                                                                   x_236667);\n                            int64_t defunc_1_op_res_236672 = add64(x_236664,\n                                                                   x_236668);\n                            int64_t defunc_1_op_res_236673 = add64(x_236665,\n                                                                   x_236669);\n                            \n                            x_236662 = defunc_1_op_res_236670;\n                            x_236663 = defunc_1_op_res_236671;\n                            x_236664 = defunc_1_op_res_236672;\n                            x_236665 = defunc_1_op_res_236673;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_236649, skip_threads_236678)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_236679) {\n                    // write result\n                    {\n                        ((volatile __local\n                          int64_t *) color_232081)[sext_i32_i64(local_tid_236647)] =\n                            x_236662;\n                        x_236666 = x_236662;\n                        ((volatile __local\n                          int64_t *) color_232080)[sext_i32_i64(local_tid_236647)] =\n                            x_236663;\n                        x_236667 = x_236663;\n                        ((volatile __local",
            "\n                          int64_t *) color_232079)[sext_i32_i64(local_tid_236647)] =\n                            x_236664;\n                        x_236668 = x_236664;\n                        ((volatile __local\n                          int64_t *) color_232078)[sext_i32_i64(local_tid_236647)] =\n                            x_236665;\n                        x_236669 = x_236665;\n                    }\n                }\n                if (sle32(wave_sizze_236649, skip_threads_236678)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_236678 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_236681 = squot32(local_tid_236647, 32) == 0 ||\n         !ltid_in_bounds_236674;\n    \n    // carry-in for every block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_236681) {\n                x_227831 = x_227827;\n                x_227832 = x_227828;\n                x_227833 = x_227829;\n                x_227834 = x_227830;\n                x_227827 = ((__local\n                             int64_t *) color_232081)[sext_i32_i64(squot32(local_tid_236647,\n                                                                           32)) -\n                                                      (int64_t) 1];\n                x_227828 = ((__local\n                             int64_t *) color_232080)[sext_i32_i64(squot32(local_tid_236647,\n                                                                           32)) -\n                                                      (int64_t) 1];\n                x_227829 = ((__local\n                             int64_t *) color_232079)[sext_i32_i64(squot32(local_tid_236647,\n                                                                           32)) -\n                                                      (int64_t) 1];\n                x_227830 = ((__local\n                             int64_t *) color_232078)[sext_i32_i64(squot",
            "32(local_tid_236647,\n                                                                           32)) -\n                                                      (int64_t) 1];\n            }\n        }\n        // perform operation\n        {\n            bool inactive_236682 = slt64(srem64(sext_i32_i64(local_tid_236647),\n                                                n_203490),\n                                         sext_i32_i64(local_tid_236647) -\n                                         sext_i32_i64(squot32(local_tid_236647,\n                                                              32) * 32 - 1));\n            \n            if (!no_carry_in_236681) {\n                if (inactive_236682) {\n                    x_227827 = x_227831;\n                    x_227828 = x_227832;\n                    x_227829 = x_227833;\n                    x_227830 = x_227834;\n                }\n            }\n            if (!no_carry_in_236681) {\n                if (!inactive_236682) {\n                    int64_t defunc_1_op_res_227835 = add64(x_227827, x_227831);\n                    int64_t defunc_1_op_res_227836 = add64(x_227828, x_227832);\n                    int64_t defunc_1_op_res_227837 = add64(x_227829, x_227833);\n                    int64_t defunc_1_op_res_227838 = add64(x_227830, x_227834);\n                    \n                    x_227827 = defunc_1_op_res_227835;\n                    x_227828 = defunc_1_op_res_227836;\n                    x_227829 = defunc_1_op_res_227837;\n                    x_227830 = defunc_1_op_res_227838;\n                }\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_236681) {\n                ((__local\n                  int64_t *) color_232081)[sext_i32_i64(local_tid_236647)] =\n                    x_227827;\n                ((__local\n                  int64_t *) color_232080)[sext_i32_i64(local_tid_236647)] =\n                    x_227828;\n                ((__local\n                  int64_t *) color_232079)[sext_i32_i64",
            "(local_tid_236647)] =\n                    x_227829;\n                ((__local\n                  int64_t *) color_232078)[sext_i32_i64(local_tid_236647)] =\n                    x_227830;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_236647, 32) == 0 && ltid_in_bounds_236674) {\n            ((__local int64_t *) color_232081)[sext_i32_i64(local_tid_236647)] =\n                x_227831;\n            ((__local int64_t *) color_232080)[sext_i32_i64(local_tid_236647)] =\n                x_227832;\n            ((__local int64_t *) color_232079)[sext_i32_i64(local_tid_236647)] =\n                x_227833;\n            ((__local int64_t *) color_232078)[sext_i32_i64(local_tid_236647)] =\n                x_227834;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t last_res_227875;\n    \n    last_res_227875 = ((__local int64_t *) color_232081)[i_203670];\n    \n    int64_t last_res_227876;\n    \n    last_res_227876 = ((__local int64_t *) color_232080)[i_203670];\n    \n    int64_t last_res_227877;\n    \n    last_res_227877 = ((__local int64_t *) color_232079)[i_203670];\n    \n    int64_t write_i_227879 = sext_i32_i64(sext_i64_i32(ltid_pre_236651));\n    int32_t phys_tid_227880 = local_tid_236647;\n    int32_t x_227881;\n    \n    x_227881 = ((__local int32_t *) color_232077)[write_i_227879];\n    \n    double write_value_227886;\n    \n    write_value_227886 = ((__global double *) mem_param_231733)[gtid_227814 *\n                                                                n_203490 +\n                                                                write_i_227879];\n    \n    bool match_lit_227887 = 0 == x_227881;\n    int64_t defunc_1_f_res_227888;\n    \n    if (match_lit_227887) {\n        int64_t x_227882;\n        \n        x_227882 = ((__local int64_t *) color_232081)[write_i_227879];\n        \n        int64_t case_res_227889 = sub64(x_227882, (int64_t) 1);\n        \n        defunc_1_f_res_22",
            "7888 = case_res_227889;\n    } else {\n        bool match_lit_227890 = 1 == x_227881;\n        int64_t x_227891;\n        \n        if (match_lit_227890) {\n            int64_t x_227883;\n            \n            x_227883 = ((__local int64_t *) color_232080)[write_i_227879];\n            \n            int64_t x_227892 = add64(last_res_227875, x_227883);\n            int64_t case_res_227893 = sub64(x_227892, (int64_t) 1);\n            \n            x_227891 = case_res_227893;\n        } else {\n            bool match_lit_227894 = 2 == x_227881;\n            int64_t x_227895;\n            \n            if (match_lit_227894) {\n                int64_t x_227884;\n                \n                x_227884 = ((__local int64_t *) color_232079)[write_i_227879];\n                \n                int64_t x_227896 = add64(last_res_227875, last_res_227876);\n                int64_t x_227897 = add64(x_227884, x_227896);\n                int64_t case_res_227898 = sub64(x_227897, (int64_t) 1);\n                \n                x_227895 = case_res_227898;\n            } else {\n                int64_t x_227885;\n                \n                x_227885 = ((__local int64_t *) color_232078)[write_i_227879];\n                \n                int64_t x_227899 = add64(last_res_227875, last_res_227876);\n                int64_t x_227900 = add64(last_res_227877, x_227899);\n                int64_t x_227901 = add64(x_227885, x_227900);\n                int64_t defunc_1_f_res_res_227902 = sub64(x_227901,\n                                                          (int64_t) 1);\n                \n                x_227895 = defunc_1_f_res_res_227902;\n            }\n            x_227891 = x_227895;\n        }\n        defunc_1_f_res_227888 = x_227891;\n    }\n    if (sle64((int64_t) 0, defunc_1_f_res_227888) &&\n        slt64(defunc_1_f_res_227888, n_203490)) {\n        ((__local double *) color_232082)[defunc_1_f_res_227888] =\n            write_value_227886;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    double tmp_236683;\n    \n ",
            "   tmp_236683 = ((__local\n                   double *) color_232082)[sext_i32_i64(local_tid_236647)];\n    ((__global double *) mem_231764)[gtid_227814 * n_203490 +\n                                     sext_i32_i64(local_tid_236647)] =\n        tmp_236683;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n  error_2:\n    return;\n}\n__kernel void mainzisegred_large_212003(__global int *global_failure,\n                                        uint sync_arr_mem_233192_backing_offset_0,\n                                        uint red_arr_mem_233190_backing_offset_1,\n                                        int64_t n_p_203492, int64_t q_s_203493,\n                                        int64_t partition_sizze_203577,\n                                        int64_t defunc_0_f_res_203631,\n                                        int64_t s_n_m_203636,\n                                        int64_t num_groups_211996,\n                                        int64_t groups_per_segment_233176,\n                                        int64_t elements_per_thread_233177,\n                                        int64_t virt_num_groups_233178,\n                                        int64_t threads_per_segment_233180,\n                                        __global unsigned char *ext_mem_229264,\n                                        __global unsigned char *ext_mem_229265,\n                                        __global unsigned char *ext_mem_229362,\n                                        __global unsigned char *ext_mem_229363,\n                                        __global unsigned char *mem_229531,\n                                        __global unsigned char *mem_229687,\n                                        __global unsigned char *mem_229697,\n                                        __global\n                                        unsigned char *segred_tmp_mem_233181,\n                                        __global\n                                        unsigned char *mainzicounter_me",
            "m_233183)\n{\n    #define segred_group_sizze_211995 (mainzisegred_group_sizze_211176)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *sync_arr_mem_233192_backing_1 =\n                           &shared_mem[sync_arr_mem_233192_backing_offset_0];\n    volatile unsigned char *red_arr_mem_233190_backing_0 =\n                           &shared_mem[red_arr_mem_233190_backing_offset_1];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233185;\n    int32_t local_tid_233186;\n    int64_t group_sizze_233189;\n    int32_t wave_sizze_233188;\n    int32_t group_tid_233187;\n    \n    global_tid_233185 = get_global_id(0);\n    local_tid_233186 = get_local_id(0);\n    group_sizze_233189 = get_local_size(0);\n    wave_sizze_233188 = LOCKSTEP_WIDTH;\n    group_tid_233187 = get_group_id(0);\n    \n    int32_t phys_tid_212003 = global_tid_233185;\n    __local unsigned char *red_arr_mem_233190;\n    \n    red_arr_mem_233190 = (__local unsigned char *) red_arr_mem_233190_backing_0;\n    \n    __local unsigned char *sync_arr_mem_233192;\n    \n    sync_arr_mem_233192 = (__local\n                           unsigned char *) sync_arr_mem_233192_backing_1;\n    \n    int32_t phys_group_id_233194;\n    \n    phys_group_id_233194 = get_group_id(0);\n    for (int32_t i_233195 = 0; i_233195 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_233178) - phys_group_id_233194,\n                   sext_i64_i32(num_groups_211996)); i_233195++) {\n        int32_t virt_group_id_233196 = phys_group_id_233194 + i_233195 *\n                sext_i64_i32(num_groups_211996);\n        int32_t flat_segment_id_233197 = squot32(virt_group_id_233196,\n                                                 sext_i64_i32(groups_per_segment_233176));\n        int64_t global_tid_233198 = srem64(sext_i32_i64(virt_group_id_233196) *\n                                           segred_group_sizze_211995 +\n                                           sext_i32_i64(loc",
            "al_tid_233186),\n                                           segred_group_sizze_211995 *\n                                           groups_per_segment_233176);\n        int64_t slice_233199 = s_n_m_203636;\n        int64_t slice_233200 = n_p_203492 * slice_233199;\n        int64_t slice_233201 = partition_sizze_203577 * slice_233200;\n        int64_t gtid_211999 = squot64(sext_i32_i64(flat_segment_id_233197),\n                                      slice_233200);\n        int64_t remnant_233202 = sext_i32_i64(flat_segment_id_233197) -\n                gtid_211999 * slice_233200;\n        int64_t gtid_212000 = squot64(remnant_233202, slice_233199);\n        int64_t remnant_233203 = remnant_233202 - gtid_212000 * slice_233199;\n        int64_t gtid_212001 = remnant_233203;\n        int64_t remnant_233204 = remnant_233203 - gtid_212001;\n        int64_t gtid_212002;\n        double x_acc_233205;\n        int64_t chunk_sizze_233206 = smin64(elements_per_thread_233177,\n                                            sdiv_up64(q_s_203493 -\n                                                      global_tid_233198,\n                                                      threads_per_segment_233180));\n        double x_212004;\n        double x_212005;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_233205 = 0.0;\n        }\n        for (int64_t i_233210 = 0; i_233210 < chunk_sizze_233206; i_233210++) {\n            gtid_212002 = global_tid_233198 + threads_per_segment_233180 *\n                i_233210;\n            // apply map function\n            {\n                int64_t x_212015;\n                \n                x_212015 = ((__global int64_t *) ext_mem_229264)[gtid_211999 *\n                                                                 n_p_203492 +\n                                                                 gtid_212000];\n                \n                int64_t x_212019;\n                \n                x_212019 = ((__global int64_t *) ext_mem_229363)[gtid_21",
            "1999 *\n                                                                 (s_n_m_203636 *\n                                                                  n_p_203492) +\n                                                                 gtid_212000 *\n                                                                 s_n_m_203636 +\n                                                                 gtid_212001];\n                \n                double x_212020;\n                \n                x_212020 = ((__global double *) ext_mem_229362)[gtid_211999 *\n                                                                (s_n_m_203636 *\n                                                                 n_p_203492) +\n                                                                gtid_212000 *\n                                                                s_n_m_203636 +\n                                                                gtid_212001];\n                \n                int64_t defunc_0_m_fun_res_212021;\n                \n                defunc_0_m_fun_res_212021 = ((__global\n                                              int64_t *) mem_229687)[gtid_211999 *\n                                                                     (s_n_m_203636 *\n                                                                      n_p_203492) +\n                                                                     gtid_212000 *\n                                                                     s_n_m_203636 +\n                                                                     gtid_212001];\n                \n                bool cond_212023 = sle64(x_212015, gtid_212002);\n                int64_t defunc_0_f_res_212024;\n                \n                if (cond_212023) {\n                    defunc_0_f_res_212024 = (int64_t) 0;\n                } else {\n                    int64_t i_212025 = add64(gtid_212002, x_212019);\n                    int64_t defunc_0_add_arg_212026;\n                    \n       ",
            "             defunc_0_add_arg_212026 = ((__global\n                                                int64_t *) ext_mem_229265)[gtid_211999 *\n                                                                           (defunc_0_f_res_203631 *\n                                                                            n_p_203492) +\n                                                                           gtid_212000 *\n                                                                           defunc_0_f_res_203631 +\n                                                                           i_212025];\n                    \n                    int64_t defunc_1_add_res_212027 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_212026);\n                    \n                    defunc_0_f_res_212024 = defunc_1_add_res_212027;\n                }\n                \n                double defunc_0_f_res_212028;\n                \n                if (cond_212023) {\n                    defunc_0_f_res_212028 = 0.0;\n                } else {\n                    int64_t i_212029 = add64(gtid_212002, x_212019);\n                    double defunc_0_add_arg_212030;\n                    \n                    defunc_0_add_arg_212030 = ((__global\n                                                double *) mem_229531)[gtid_211999 *\n                                                                      (defunc_0_f_res_203631 *\n                                                                       n_p_203492) +\n                                                                      gtid_212000 *\n                                                                      defunc_0_f_res_203631 +\n                                                                      i_212029];\n                    defunc_0_f_res_212028 = defunc_0_add_arg_212030;\n                }\n                \n                int64_t binop_p_212031 = sub64(defunc_0_f_res_212024,\n                        ",
            "                       defunc_0_m_fun_res_212021);\n                double defunc_0_f_res_212032 = sitofp_i64_f64(binop_p_212031);\n                double abs_res_212033 = fabs(defunc_0_f_res_212032);\n                double tmp1_212034 = abs_res_212033 / x_212020;\n                double x_212035 = tmp1_212034 * tmp1_212034;\n                double y_212036 = tmp1_212034 * x_212035;\n                double tmp2_212037 = 1.0 - y_212036;\n                double x_212038 = tmp2_212037 * tmp2_212037;\n                double tmp3_212039 = tmp2_212037 * x_212038;\n                double w_j_212040 = defunc_0_f_res_212028 * tmp3_212039;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_212004 = x_acc_233205;\n                }\n                // load new values\n                {\n                    x_212005 = w_j_212040;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_212006 = x_212004 + x_212005;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_233205 = defunc_1_op_res_212006;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_212004 = x_acc_233205;\n            ((__local\n              double *) red_arr_mem_233190)[sext_i32_i64(local_tid_233186)] =\n                x_212004;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_233211;\n        int32_t skip_waves_233212 = 1;\n        double x_233207;\n        double x_233208;\n        \n        offset_233211 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_233186,\n                      sext_i64_i32(segred_group_sizze_211995))) {\n                x_233207 = ((__local\n                             double *) red_arr_",
            "mem_233190)[sext_i32_i64(local_tid_233186 +\n                                                           offset_233211)];\n            }\n        }\n        offset_233211 = 1;\n        while (slt32(offset_233211, wave_sizze_233188)) {\n            if (slt32(local_tid_233186 + offset_233211,\n                      sext_i64_i32(segred_group_sizze_211995)) &&\n                ((local_tid_233186 - squot32(local_tid_233186,\n                                             wave_sizze_233188) *\n                  wave_sizze_233188) & (2 * offset_233211 - 1)) == 0) {\n                // read array element\n                {\n                    x_233208 = ((volatile __local\n                                 double *) red_arr_mem_233190)[sext_i32_i64(local_tid_233186 +\n                                                               offset_233211)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_233209 = x_233207 + x_233208;\n                    \n                    x_233207 = defunc_1_op_res_233209;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_233190)[sext_i32_i64(local_tid_233186)] =\n                        x_233207;\n                }\n            }\n            offset_233211 *= 2;\n        }\n        while (slt32(skip_waves_233212,\n                     squot32(sext_i64_i32(segred_group_sizze_211995) +\n                             wave_sizze_233188 - 1, wave_sizze_233188))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_233211 = skip_waves_233212 * wave_sizze_233188;\n            if (slt32(local_tid_233186 + offset_233211,\n                      sext_i64_i32(segred_group_sizze_211995)) &&\n                ((local_tid_233186 - squot32(local_tid_233186,\n                                             wave_sizze_233188) *\n                  wave_sizze_233188) == 0 && (squot32(local_tid_233186,\n     ",
            "                                                 wave_sizze_233188) & (2 *\n                                                                            skip_waves_233212 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_233208 = ((__local\n                                 double *) red_arr_mem_233190)[sext_i32_i64(local_tid_233186 +\n                                                               offset_233211)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_233209 = x_233207 + x_233208;\n                    \n                    x_233207 = defunc_1_op_res_233209;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_233190)[sext_i32_i64(local_tid_233186)] =\n                        x_233207;\n                }\n            }\n            skip_waves_233212 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_233186) == (int64_t) 0) {\n                x_acc_233205 = x_233207;\n            }\n        }\n        if (groups_per_segment_233176 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_233186 == 0) {\n                    ((__global double *) mem_229697)[gtid_211999 *\n                                                     (s_n_m_203636 *\n                                                      n_p_203492) +\n                                                     gtid_212000 *\n                                                     s_n_m_203636 +\n                                                     gtid_212001] =\n                        x_acc_233205;\n                }\n            }\n        } else {\n   ",
            "         int32_t old_counter_233213;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_233186 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_233181)[sext_i32_i64(virt_group_id_233196)] =\n                        x_acc_233205;\n                    mem_fence_global();\n                    old_counter_233213 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_233183)[sext_i32_i64(srem32(flat_segment_id_233197,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_233192)[(int64_t) 0] =\n                        old_counter_233213 == groups_per_segment_233176 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_233214;\n            \n            is_last_group_233214 = ((__local\n                                     bool *) sync_arr_mem_233192)[(int64_t) 0];\n            if (is_last_group_233214) {\n                if (local_tid_233186 == 0) {\n                    old_counter_233213 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_233183)[sext_i32_i64(srem32(flat_segment_id_233197,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_233176));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_233215 =\n                        ",
            "    sdiv_up64(groups_per_segment_233176,\n                                      segred_group_sizze_211995);\n                    \n                    x_212004 = 0.0;\n                    for (int64_t i_233216 = 0; i_233216 <\n                         read_per_thread_233215; i_233216++) {\n                        int64_t group_res_id_233217 =\n                                sext_i32_i64(local_tid_233186) *\n                                read_per_thread_233215 + i_233216;\n                        int64_t index_of_group_res_233218 =\n                                sext_i32_i64(flat_segment_id_233197) *\n                                groups_per_segment_233176 + group_res_id_233217;\n                        \n                        if (slt64(group_res_id_233217,\n                                  groups_per_segment_233176)) {\n                            x_212005 = ((__global\n                                         double *) segred_tmp_mem_233181)[index_of_group_res_233218];\n                            \n                            double defunc_1_op_res_212006 = x_212004 + x_212005;\n                            \n                            x_212004 = defunc_1_op_res_212006;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_233190)[sext_i32_i64(local_tid_233186)] =\n                    x_212004;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_233219;\n                    int32_t skip_waves_233220 = 1;\n                    double x_233207;\n                    double x_233208;\n                    \n                    offset_233219 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_233186,\n                                  sext_i64_i32(segred_group_sizze_211995))) {\n                            x_233207 = ((__local\n    ",
            "                                     double *) red_arr_mem_233190)[sext_i32_i64(local_tid_233186 +\n                                                                       offset_233219)];\n                        }\n                    }\n                    offset_233219 = 1;\n                    while (slt32(offset_233219, wave_sizze_233188)) {\n                        if (slt32(local_tid_233186 + offset_233219,\n                                  sext_i64_i32(segred_group_sizze_211995)) &&\n                            ((local_tid_233186 - squot32(local_tid_233186,\n                                                         wave_sizze_233188) *\n                              wave_sizze_233188) & (2 * offset_233219 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_233208 = ((volatile __local\n                                             double *) red_arr_mem_233190)[sext_i32_i64(local_tid_233186 +\n                                                                           offset_233219)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_233209 = x_233207 +\n                                       x_233208;\n                                \n                                x_233207 = defunc_1_op_res_233209;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_233190)[sext_i32_i64(local_tid_233186)] =\n                                    x_233207;\n                            }\n                        }\n                        offset_233219 *= 2;\n                    }\n                    while (slt32(skip_waves_233220,\n                                 squot32(sext_i64_i32(segred_group_sizze_2119",
            "95) +\n                                         wave_sizze_233188 - 1,\n                                         wave_sizze_233188))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_233219 = skip_waves_233220 * wave_sizze_233188;\n                        if (slt32(local_tid_233186 + offset_233219,\n                                  sext_i64_i32(segred_group_sizze_211995)) &&\n                            ((local_tid_233186 - squot32(local_tid_233186,\n                                                         wave_sizze_233188) *\n                              wave_sizze_233188) == 0 &&\n                             (squot32(local_tid_233186, wave_sizze_233188) &\n                              (2 * skip_waves_233220 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_233208 = ((__local\n                                             double *) red_arr_mem_233190)[sext_i32_i64(local_tid_233186 +\n                                                                           offset_233219)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_233209 = x_233207 +\n                                       x_233208;\n                                \n                                x_233207 = defunc_1_op_res_233209;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_233190)[sext_i32_i64(local_tid_233186)] =\n                                    x_233207;\n                            }\n                        }\n                        skip_waves_233220 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_233186",
            " == 0) {\n                            ((__global double *) mem_229697)[gtid_211999 *\n                                                             (s_n_m_203636 *\n                                                              n_p_203492) +\n                                                             gtid_212000 *\n                                                             s_n_m_203636 +\n                                                             gtid_212001] =\n                                x_233207;\n                        }\n                    }\n                }\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_211995\n}\n__kernel void mainzisegred_large_212077(__global int *global_failure,\n                                        uint sync_arr_mem_233280_backing_offset_0,\n                                        uint red_arr_mem_233278_backing_offset_1,\n                                        int64_t n_p_203492, int64_t q_s_203493,\n                                        int64_t partition_sizze_203577,\n                                        int64_t defunc_0_f_res_203631,\n                                        int64_t s_n_m_203636,\n                                        int64_t num_groups_212070,\n                                        int64_t groups_per_segment_233264,\n                                        int64_t elements_per_thread_233265,\n                                        int64_t virt_num_groups_233266,\n                                        int64_t threads_per_segment_233268,\n                                        __global unsigned char *ext_mem_229264,\n                                        __global unsigned char *ext_mem_229265,\n                                        __global unsigned char *ext_mem_229362,\n                                        __global unsigned char *ext_mem_229363,\n                                        __global unsigned char *",
            "mem_229526,\n                                        __global unsigned char *mem_229531,\n                                        __global unsigned char *mem_229703,\n                                        __global unsigned char *mem_229708,\n                                        __global unsigned char *mem_229714,\n                                        __global\n                                        unsigned char *segred_tmp_mem_233269,\n                                        __global\n                                        unsigned char *mainzicounter_mem_233271)\n{\n    #define segred_group_sizze_212069 (mainzisegred_group_sizze_211074)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *sync_arr_mem_233280_backing_1 =\n                           &shared_mem[sync_arr_mem_233280_backing_offset_0];\n    volatile unsigned char *red_arr_mem_233278_backing_0 =\n                           &shared_mem[red_arr_mem_233278_backing_offset_1];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233273;\n    int32_t local_tid_233274;\n    int64_t group_sizze_233277;\n    int32_t wave_sizze_233276;\n    int32_t group_tid_233275;\n    \n    global_tid_233273 = get_global_id(0);\n    local_tid_233274 = get_local_id(0);\n    group_sizze_233277 = get_local_size(0);\n    wave_sizze_233276 = LOCKSTEP_WIDTH;\n    group_tid_233275 = get_group_id(0);\n    \n    int32_t phys_tid_212077 = global_tid_233273;\n    __local unsigned char *red_arr_mem_233278;\n    \n    red_arr_mem_233278 = (__local unsigned char *) red_arr_mem_233278_backing_0;\n    \n    __local unsigned char *sync_arr_mem_233280;\n    \n    sync_arr_mem_233280 = (__local\n                           unsigned char *) sync_arr_mem_233280_backing_1;\n    \n    int32_t phys_group_id_233282;\n    \n    phys_group_id_233282 = get_group_id(0);\n    for (int32_t i_233283 = 0; i_233283 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_233266) - phys_group_id_233282",
            ",\n                   sext_i64_i32(num_groups_212070)); i_233283++) {\n        int32_t virt_group_id_233284 = phys_group_id_233282 + i_233283 *\n                sext_i64_i32(num_groups_212070);\n        int32_t flat_segment_id_233285 = squot32(virt_group_id_233284,\n                                                 sext_i64_i32(groups_per_segment_233264));\n        int64_t global_tid_233286 = srem64(sext_i32_i64(virt_group_id_233284) *\n                                           segred_group_sizze_212069 +\n                                           sext_i32_i64(local_tid_233274),\n                                           segred_group_sizze_212069 *\n                                           groups_per_segment_233264);\n        int64_t slice_233287 = s_n_m_203636;\n        int64_t slice_233288 = n_p_203492 * slice_233287;\n        int64_t slice_233289 = partition_sizze_203577 * slice_233288;\n        int64_t gtid_212073 = squot64(sext_i32_i64(flat_segment_id_233285),\n                                      slice_233288);\n        int64_t remnant_233290 = sext_i32_i64(flat_segment_id_233285) -\n                gtid_212073 * slice_233288;\n        int64_t gtid_212074 = squot64(remnant_233290, slice_233287);\n        int64_t remnant_233291 = remnant_233290 - gtid_212074 * slice_233287;\n        int64_t gtid_212075 = remnant_233291;\n        int64_t remnant_233292 = remnant_233291 - gtid_212075;\n        int64_t gtid_212076;\n        double x_acc_233293;\n        int64_t chunk_sizze_233294 = smin64(elements_per_thread_233265,\n                                            sdiv_up64(q_s_203493 -\n                                                      global_tid_233286,\n                                                      threads_per_segment_233268));\n        double x_212078;\n        double x_212079;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_233293 = 0.0;\n        }\n        for (int64_t i_233298 = 0; i_233298 < chunk_sizze_233294; i_233298++) {\n            g",
            "tid_212076 = global_tid_233286 + threads_per_segment_233268 *\n                i_233298;\n            // apply map function\n            {\n                int64_t x_212092;\n                \n                x_212092 = ((__global int64_t *) ext_mem_229264)[gtid_212073 *\n                                                                 n_p_203492 +\n                                                                 gtid_212074];\n                \n                int64_t x_212097;\n                \n                x_212097 = ((__global int64_t *) ext_mem_229363)[gtid_212073 *\n                                                                 (s_n_m_203636 *\n                                                                  n_p_203492) +\n                                                                 gtid_212074 *\n                                                                 s_n_m_203636 +\n                                                                 gtid_212075];\n                \n                double x_212098;\n                \n                x_212098 = ((__global double *) ext_mem_229362)[gtid_212073 *\n                                                                (s_n_m_203636 *\n                                                                 n_p_203492) +\n                                                                gtid_212074 *\n                                                                s_n_m_203636 +\n                                                                gtid_212075];\n                \n                double a0_212099;\n                \n                a0_212099 = ((__global double *) mem_229703)[gtid_212073 *\n                                                             (s_n_m_203636 *\n                                                              n_p_203492) +\n                                                             gtid_212074 *\n                                                             s_n_m_203636 +\n                                             ",
            "                gtid_212075];\n                \n                int64_t defunc_0_m_fun_res_212100;\n                \n                defunc_0_m_fun_res_212100 = ((__global\n                                              int64_t *) mem_229708)[gtid_212073 *\n                                                                     (s_n_m_203636 *\n                                                                      n_p_203492) +\n                                                                     gtid_212074 *\n                                                                     s_n_m_203636 +\n                                                                     gtid_212075];\n                \n                bool cond_212102 = sle64(x_212092, gtid_212076);\n                int64_t defunc_0_f_res_212103;\n                \n                if (cond_212102) {\n                    defunc_0_f_res_212103 = (int64_t) 0;\n                } else {\n                    int64_t i_212104 = add64(gtid_212076, x_212097);\n                    int64_t defunc_0_add_arg_212105;\n                    \n                    defunc_0_add_arg_212105 = ((__global\n                                                int64_t *) ext_mem_229265)[gtid_212073 *\n                                                                           (defunc_0_f_res_203631 *\n                                                                            n_p_203492) +\n                                                                           gtid_212074 *\n                                                                           defunc_0_f_res_203631 +\n                                                                           i_212104];\n                    \n                    int64_t defunc_1_add_res_212106 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_212105);\n                    \n                    defunc_0_f_res_212103 = defunc_1_add_res_212106;\n                }\n                \n       ",
            "         double defunc_0_f_res_212107;\n                \n                if (cond_212102) {\n                    defunc_0_f_res_212107 = 0.0;\n                } else {\n                    int64_t i_212108 = add64(gtid_212076, x_212097);\n                    double defunc_0_add_arg_212109;\n                    \n                    defunc_0_add_arg_212109 = ((__global\n                                                double *) mem_229531)[gtid_212073 *\n                                                                      (defunc_0_f_res_203631 *\n                                                                       n_p_203492) +\n                                                                      gtid_212074 *\n                                                                      defunc_0_f_res_203631 +\n                                                                      i_212108];\n                    defunc_0_f_res_212107 = defunc_0_add_arg_212109;\n                }\n                \n                int64_t binop_p_212110 = sub64(defunc_0_f_res_212103,\n                                               defunc_0_m_fun_res_212100);\n                double defunc_0_f_res_212111 = sitofp_i64_f64(binop_p_212110);\n                double abs_res_212112 = fabs(defunc_0_f_res_212111);\n                double tmp1_212113 = abs_res_212112 / x_212098;\n                double x_212114 = tmp1_212113 * tmp1_212113;\n                double y_212115 = tmp1_212113 * x_212114;\n                double tmp2_212116 = 1.0 - y_212115;\n                double x_212117 = tmp2_212116 * tmp2_212116;\n                double tmp3_212118 = tmp2_212116 * x_212117;\n                double tmp4_212119 = defunc_0_f_res_212107 * tmp3_212118;\n                double defunc_0_f_res_212120;\n                \n                if (cond_212102) {\n                    defunc_0_f_res_212120 = 0.0;\n                } else {\n                    int64_t i_212121 = add64(gtid_212076, x_212097);\n                    double defunc_0_add_arg",
            "_212122;\n                    \n                    defunc_0_add_arg_212122 = ((__global\n                                                double *) mem_229526)[gtid_212073 *\n                                                                      (defunc_0_f_res_203631 *\n                                                                       n_p_203492) +\n                                                                      gtid_212074 *\n                                                                      defunc_0_f_res_203631 +\n                                                                      i_212121];\n                    defunc_0_f_res_212120 = defunc_0_add_arg_212122;\n                }\n                \n                double x_212123 = a0_212099 * tmp4_212119;\n                double defunc_9_fit_fun_res_212124 = defunc_0_f_res_212120 *\n                       x_212123;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_212078 = x_acc_233293;\n                }\n                // load new values\n                {\n                    x_212079 = defunc_9_fit_fun_res_212124;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_212080 = x_212078 + x_212079;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_233293 = defunc_1_op_res_212080;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_212078 = x_acc_233293;\n            ((__local\n              double *) red_arr_mem_233278)[sext_i32_i64(local_tid_233274)] =\n                x_212078;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_233299;\n        int32_t skip_waves_233300 = 1;\n        double x_233295;\n        double x_233296;\n        \n        offset_",
            "233299 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_233274,\n                      sext_i64_i32(segred_group_sizze_212069))) {\n                x_233295 = ((__local\n                             double *) red_arr_mem_233278)[sext_i32_i64(local_tid_233274 +\n                                                           offset_233299)];\n            }\n        }\n        offset_233299 = 1;\n        while (slt32(offset_233299, wave_sizze_233276)) {\n            if (slt32(local_tid_233274 + offset_233299,\n                      sext_i64_i32(segred_group_sizze_212069)) &&\n                ((local_tid_233274 - squot32(local_tid_233274,\n                                             wave_sizze_233276) *\n                  wave_sizze_233276) & (2 * offset_233299 - 1)) == 0) {\n                // read array element\n                {\n                    x_233296 = ((volatile __local\n                                 double *) red_arr_mem_233278)[sext_i32_i64(local_tid_233274 +\n                                                               offset_233299)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_233297 = x_233295 + x_233296;\n                    \n                    x_233295 = defunc_1_op_res_233297;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_233278)[sext_i32_i64(local_tid_233274)] =\n                        x_233295;\n                }\n            }\n            offset_233299 *= 2;\n        }\n        while (slt32(skip_waves_233300,\n                     squot32(sext_i64_i32(segred_group_sizze_212069) +\n                             wave_sizze_233276 - 1, wave_sizze_233276))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_233299 = skip_waves_233300 * wave_sizze_233276;\n            if (slt32(local_tid_233274 + offset_233299,\n  ",
            "                    sext_i64_i32(segred_group_sizze_212069)) &&\n                ((local_tid_233274 - squot32(local_tid_233274,\n                                             wave_sizze_233276) *\n                  wave_sizze_233276) == 0 && (squot32(local_tid_233274,\n                                                      wave_sizze_233276) & (2 *\n                                                                            skip_waves_233300 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_233296 = ((__local\n                                 double *) red_arr_mem_233278)[sext_i32_i64(local_tid_233274 +\n                                                               offset_233299)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_233297 = x_233295 + x_233296;\n                    \n                    x_233295 = defunc_1_op_res_233297;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_233278)[sext_i32_i64(local_tid_233274)] =\n                        x_233295;\n                }\n            }\n            skip_waves_233300 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_233274) == (int64_t) 0) {\n                x_acc_233293 = x_233295;\n            }\n        }\n        if (groups_per_segment_233264 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_233274 == 0) {\n                    ((__global double *) mem_229714)[gtid_212073 *\n                                                     (s_n_m_203636 *\n                                                      n_p_203492) +\n                       ",
            "                              gtid_212074 *\n                                                     s_n_m_203636 +\n                                                     gtid_212075] =\n                        x_acc_233293;\n                }\n            }\n        } else {\n            int32_t old_counter_233301;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_233274 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_233269)[sext_i32_i64(virt_group_id_233284)] =\n                        x_acc_233293;\n                    mem_fence_global();\n                    old_counter_233301 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_233271)[sext_i32_i64(srem32(flat_segment_id_233285,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_233280)[(int64_t) 0] =\n                        old_counter_233301 == groups_per_segment_233264 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_233302;\n            \n            is_last_group_233302 = ((__local\n                                     bool *) sync_arr_mem_233280)[(int64_t) 0];\n            if (is_last_group_233302) {\n                if (local_tid_233274 == 0) {\n                    old_counter_233301 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_233271)[sext_i32_i64(srem32(flat_segment_id_233285,\n                                                                                                      10240))],\n                                         ",
            "     (int) ((int64_t) 0 -\n                                                     groups_per_segment_233264));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_233303 =\n                            sdiv_up64(groups_per_segment_233264,\n                                      segred_group_sizze_212069);\n                    \n                    x_212078 = 0.0;\n                    for (int64_t i_233304 = 0; i_233304 <\n                         read_per_thread_233303; i_233304++) {\n                        int64_t group_res_id_233305 =\n                                sext_i32_i64(local_tid_233274) *\n                                read_per_thread_233303 + i_233304;\n                        int64_t index_of_group_res_233306 =\n                                sext_i32_i64(flat_segment_id_233285) *\n                                groups_per_segment_233264 + group_res_id_233305;\n                        \n                        if (slt64(group_res_id_233305,\n                                  groups_per_segment_233264)) {\n                            x_212079 = ((__global\n                                         double *) segred_tmp_mem_233269)[index_of_group_res_233306];\n                            \n                            double defunc_1_op_res_212080 = x_212078 + x_212079;\n                            \n                            x_212078 = defunc_1_op_res_212080;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_233278)[sext_i32_i64(local_tid_233274)] =\n                    x_212078;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_233307;\n                    int32_t skip_waves_233308 = 1;\n                    double x_233295;\n                    double x_233296;\n                    \n                    offset_233307 = 0;\n     ",
            "               // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_233274,\n                                  sext_i64_i32(segred_group_sizze_212069))) {\n                            x_233295 = ((__local\n                                         double *) red_arr_mem_233278)[sext_i32_i64(local_tid_233274 +\n                                                                       offset_233307)];\n                        }\n                    }\n                    offset_233307 = 1;\n                    while (slt32(offset_233307, wave_sizze_233276)) {\n                        if (slt32(local_tid_233274 + offset_233307,\n                                  sext_i64_i32(segred_group_sizze_212069)) &&\n                            ((local_tid_233274 - squot32(local_tid_233274,\n                                                         wave_sizze_233276) *\n                              wave_sizze_233276) & (2 * offset_233307 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_233296 = ((volatile __local\n                                             double *) red_arr_mem_233278)[sext_i32_i64(local_tid_233274 +\n                                                                           offset_233307)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_233297 = x_233295 +\n                                       x_233296;\n                                \n                                x_233295 = defunc_1_op_res_233297;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_233278)[sext_i32_i64(local_tid_233274)] =\n                           ",
            "         x_233295;\n                            }\n                        }\n                        offset_233307 *= 2;\n                    }\n                    while (slt32(skip_waves_233308,\n                                 squot32(sext_i64_i32(segred_group_sizze_212069) +\n                                         wave_sizze_233276 - 1,\n                                         wave_sizze_233276))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_233307 = skip_waves_233308 * wave_sizze_233276;\n                        if (slt32(local_tid_233274 + offset_233307,\n                                  sext_i64_i32(segred_group_sizze_212069)) &&\n                            ((local_tid_233274 - squot32(local_tid_233274,\n                                                         wave_sizze_233276) *\n                              wave_sizze_233276) == 0 &&\n                             (squot32(local_tid_233274, wave_sizze_233276) &\n                              (2 * skip_waves_233308 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_233296 = ((__local\n                                             double *) red_arr_mem_233278)[sext_i32_i64(local_tid_233274 +\n                                                                           offset_233307)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_233297 = x_233295 +\n                                       x_233296;\n                                \n                                x_233295 = defunc_1_op_res_233297;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_233278)[sext_i32_i64(local_tid_233274)] =\n                                ",
            "    x_233295;\n                            }\n                        }\n                        skip_waves_233308 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_233274 == 0) {\n                            ((__global double *) mem_229714)[gtid_212073 *\n                                                             (s_n_m_203636 *\n                                                              n_p_203492) +\n                                                             gtid_212074 *\n                                                             s_n_m_203636 +\n                                                             gtid_212075] =\n                                x_233295;\n                        }\n                    }\n                }\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_212069\n}\n__kernel void mainzisegred_large_214137(__global int *global_failure,\n                                        uint sync_arr_mem_233545_backing_offset_0,\n                                        uint red_arr_mem_233543_backing_offset_1,\n                                        uint red_arr_mem_233541_backing_offset_2,\n                                        uint red_arr_mem_233539_backing_offset_3,\n                                        int64_t n_p_203492, int64_t q_s_203493,\n                                        int64_t partition_sizze_203577,\n                                        int64_t defunc_0_f_res_203631,\n                                        int64_t s_n_m_203636,\n                                        int64_t num_groups_214128,\n                                        int64_t groups_per_segment_233521,\n                                        int64_t elements_per_thread_233522,\n                                        int64_t virt_num_groups_233523,\n                          ",
            "              int64_t threads_per_segment_233525,\n                                        __global unsigned char *ext_mem_229264,\n                                        __global unsigned char *ext_mem_229265,\n                                        __global unsigned char *ext_mem_229362,\n                                        __global unsigned char *ext_mem_229363,\n                                        __global unsigned char *mem_229531,\n                                        __global unsigned char *mem_229973,\n                                        __global unsigned char *mem_229983,\n                                        __global unsigned char *mem_229988,\n                                        __global unsigned char *mem_229993,\n                                        __global\n                                        unsigned char *segred_tmp_mem_233526,\n                                        __global\n                                        unsigned char *segred_tmp_mem_233528,\n                                        __global\n                                        unsigned char *segred_tmp_mem_233530,\n                                        __global\n                                        unsigned char *mainzicounter_mem_233532)\n{\n    #define segred_group_sizze_214127 (mainzisegred_group_sizze_213093)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *sync_arr_mem_233545_backing_3 =\n                           &shared_mem[sync_arr_mem_233545_backing_offset_0];\n    volatile unsigned char *red_arr_mem_233543_backing_2 =\n                           &shared_mem[red_arr_mem_233543_backing_offset_1];\n    volatile unsigned char *red_arr_mem_233541_backing_1 =\n                           &shared_mem[red_arr_mem_233541_backing_offset_2];\n    volatile unsigned char *red_arr_mem_233539_backing_0 =\n                           &shared_mem[red_arr_mem_233539_backing_offset_3];\n    \n    if (*global_fai",
            "lure >= 0)\n        return;\n    \n    int32_t global_tid_233534;\n    int32_t local_tid_233535;\n    int64_t group_sizze_233538;\n    int32_t wave_sizze_233537;\n    int32_t group_tid_233536;\n    \n    global_tid_233534 = get_global_id(0);\n    local_tid_233535 = get_local_id(0);\n    group_sizze_233538 = get_local_size(0);\n    wave_sizze_233537 = LOCKSTEP_WIDTH;\n    group_tid_233536 = get_group_id(0);\n    \n    int32_t phys_tid_214137 = global_tid_233534;\n    __local unsigned char *red_arr_mem_233539;\n    \n    red_arr_mem_233539 = (__local unsigned char *) red_arr_mem_233539_backing_0;\n    \n    __local unsigned char *red_arr_mem_233541;\n    \n    red_arr_mem_233541 = (__local unsigned char *) red_arr_mem_233541_backing_1;\n    \n    __local unsigned char *red_arr_mem_233543;\n    \n    red_arr_mem_233543 = (__local unsigned char *) red_arr_mem_233543_backing_2;\n    \n    __local unsigned char *sync_arr_mem_233545;\n    \n    sync_arr_mem_233545 = (__local\n                           unsigned char *) sync_arr_mem_233545_backing_3;\n    \n    int32_t phys_group_id_233547;\n    \n    phys_group_id_233547 = get_group_id(0);\n    for (int32_t i_233548 = 0; i_233548 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_233523) - phys_group_id_233547,\n                   sext_i64_i32(num_groups_214128)); i_233548++) {\n        int32_t virt_group_id_233549 = phys_group_id_233547 + i_233548 *\n                sext_i64_i32(num_groups_214128);\n        int32_t flat_segment_id_233550 = squot32(virt_group_id_233549,\n                                                 sext_i64_i32(groups_per_segment_233521));\n        int64_t global_tid_233551 = srem64(sext_i32_i64(virt_group_id_233549) *\n                                           segred_group_sizze_214127 +\n                                           sext_i32_i64(local_tid_233535),\n                                           segred_group_sizze_214127 *\n                                           groups_per_segment_233521);\n        int64_t slice_233552 = s_n_m_203636",
            ";\n        int64_t slice_233553 = n_p_203492 * slice_233552;\n        int64_t slice_233554 = partition_sizze_203577 * slice_233553;\n        int64_t gtid_214133 = squot64(sext_i32_i64(flat_segment_id_233550),\n                                      slice_233553);\n        int64_t remnant_233555 = sext_i32_i64(flat_segment_id_233550) -\n                gtid_214133 * slice_233553;\n        int64_t gtid_214134 = squot64(remnant_233555, slice_233552);\n        int64_t remnant_233556 = remnant_233555 - gtid_214134 * slice_233552;\n        int64_t gtid_214135 = remnant_233556;\n        int64_t remnant_233557 = remnant_233556 - gtid_214135;\n        int64_t gtid_214136;\n        double x_acc_233558;\n        double x_acc_233559;\n        double x_acc_233560;\n        int64_t chunk_sizze_233561 = smin64(elements_per_thread_233522,\n                                            sdiv_up64(q_s_203493 -\n                                                      global_tid_233551,\n                                                      threads_per_segment_233525));\n        double x_214138;\n        double x_214139;\n        double x_214140;\n        double x_214141;\n        double x_214142;\n        double x_214143;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_233558 = 0.0;\n            x_acc_233559 = 0.0;\n            x_acc_233560 = 0.0;\n        }\n        for (int64_t i_233571 = 0; i_233571 < chunk_sizze_233561; i_233571++) {\n            gtid_214136 = global_tid_233551 + threads_per_segment_233525 *\n                i_233571;\n            // apply map function\n            {\n                int64_t x_214155;\n                \n                x_214155 = ((__global int64_t *) ext_mem_229264)[gtid_214133 *\n                                                                 n_p_203492 +\n                                                                 gtid_214134];\n                \n                int64_t x_214159;\n                \n                x_214159 = ((__global int64_t *) ex",
            "t_mem_229363)[gtid_214133 *\n                                                                 (s_n_m_203636 *\n                                                                  n_p_203492) +\n                                                                 gtid_214134 *\n                                                                 s_n_m_203636 +\n                                                                 gtid_214135];\n                \n                double x_214160;\n                \n                x_214160 = ((__global double *) ext_mem_229362)[gtid_214133 *\n                                                                (s_n_m_203636 *\n                                                                 n_p_203492) +\n                                                                gtid_214134 *\n                                                                s_n_m_203636 +\n                                                                gtid_214135];\n                \n                int64_t defunc_0_m_fun_res_214161;\n                \n                defunc_0_m_fun_res_214161 = ((__global\n                                              int64_t *) mem_229973)[gtid_214133 *\n                                                                     (s_n_m_203636 *\n                                                                      n_p_203492) +\n                                                                     gtid_214134 *\n                                                                     s_n_m_203636 +\n                                                                     gtid_214135];\n                \n                bool cond_214163 = sle64(x_214155, gtid_214136);\n                int64_t defunc_0_f_res_214164;\n                \n                if (cond_214163) {\n                    defunc_0_f_res_214164 = (int64_t) 0;\n                } else {\n                    int64_t i_214165 = add64(gtid_214136, x_214159);\n                    int64_t defunc_0_add_arg_214166;\n       ",
            "             \n                    defunc_0_add_arg_214166 = ((__global\n                                                int64_t *) ext_mem_229265)[gtid_214133 *\n                                                                           (defunc_0_f_res_203631 *\n                                                                            n_p_203492) +\n                                                                           gtid_214134 *\n                                                                           defunc_0_f_res_203631 +\n                                                                           i_214165];\n                    \n                    int64_t defunc_1_add_res_214167 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_214166);\n                    \n                    defunc_0_f_res_214164 = defunc_1_add_res_214167;\n                }\n                \n                double defunc_0_f_res_214168;\n                \n                if (cond_214163) {\n                    defunc_0_f_res_214168 = 0.0;\n                } else {\n                    int64_t i_214169 = add64(gtid_214136, x_214159);\n                    double defunc_0_add_arg_214170;\n                    \n                    defunc_0_add_arg_214170 = ((__global\n                                                double *) mem_229531)[gtid_214133 *\n                                                                      (defunc_0_f_res_203631 *\n                                                                       n_p_203492) +\n                                                                      gtid_214134 *\n                                                                      defunc_0_f_res_203631 +\n                                                                      i_214169];\n                    defunc_0_f_res_214168 = defunc_0_add_arg_214170;\n                }\n                \n                int64_t binop_p_214171 = sub64(defunc_0_f_res_214164,\n   ",
            "                                            defunc_0_m_fun_res_214161);\n                double defunc_0_f_res_214172 = sitofp_i64_f64(binop_p_214171);\n                double abs_res_214173 = fabs(defunc_0_f_res_214172);\n                double tmp1_214174 = abs_res_214173 / x_214160;\n                double x_214175 = tmp1_214174 * tmp1_214174;\n                double y_214176 = tmp1_214174 * x_214175;\n                double tmp2_214177 = 1.0 - y_214176;\n                double x_214178 = tmp2_214177 * tmp2_214177;\n                double tmp3_214179 = tmp2_214177 * x_214178;\n                double w_j_214180 = defunc_0_f_res_214168 * tmp3_214179;\n                double xw_j_214181 = defunc_0_f_res_214172 * w_j_214180;\n                double x2w_j_214182 = defunc_0_f_res_214172 * xw_j_214181;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_214138 = x_acc_233558;\n                    x_214139 = x_acc_233559;\n                    x_214140 = x_acc_233560;\n                }\n                // load new values\n                {\n                    x_214141 = w_j_214180;\n                    x_214142 = xw_j_214181;\n                    x_214143 = x2w_j_214182;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_214144 = x_214138 + x_214141;\n                    double defunc_1_op_res_214145 = x_214139 + x_214142;\n                    double defunc_1_op_res_214146 = x_214140 + x_214143;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_233558 = defunc_1_op_res_214144;\n                        x_acc_233559 = defunc_1_op_res_214145;\n                        x_acc_233560 = defunc_1_op_res_214146;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_",
            "214138 = x_acc_233558;\n            x_214139 = x_acc_233559;\n            x_214140 = x_acc_233560;\n            ((__local\n              double *) red_arr_mem_233539)[sext_i32_i64(local_tid_233535)] =\n                x_214138;\n            ((__local\n              double *) red_arr_mem_233541)[sext_i32_i64(local_tid_233535)] =\n                x_214139;\n            ((__local\n              double *) red_arr_mem_233543)[sext_i32_i64(local_tid_233535)] =\n                x_214140;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_233572;\n        int32_t skip_waves_233573 = 1;\n        double x_233562;\n        double x_233563;\n        double x_233564;\n        double x_233565;\n        double x_233566;\n        double x_233567;\n        \n        offset_233572 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_233535,\n                      sext_i64_i32(segred_group_sizze_214127))) {\n                x_233562 = ((__local\n                             double *) red_arr_mem_233539)[sext_i32_i64(local_tid_233535 +\n                                                           offset_233572)];\n                x_233563 = ((__local\n                             double *) red_arr_mem_233541)[sext_i32_i64(local_tid_233535 +\n                                                           offset_233572)];\n                x_233564 = ((__local\n                             double *) red_arr_mem_233543)[sext_i32_i64(local_tid_233535 +\n                                                           offset_233572)];\n            }\n        }\n        offset_233572 = 1;\n        while (slt32(offset_233572, wave_sizze_233537)) {\n            if (slt32(local_tid_233535 + offset_233572,\n                      sext_i64_i32(segred_group_sizze_214127)) &&\n                ((local_tid_233535 - squot32(local_tid_233535,\n                                             wave_sizze_233537) *\n                  wave_sizze_233537) & (2 * offset_233572 - 1)) ==",
            " 0) {\n                // read array element\n                {\n                    x_233565 = ((volatile __local\n                                 double *) red_arr_mem_233539)[sext_i32_i64(local_tid_233535 +\n                                                               offset_233572)];\n                    x_233566 = ((volatile __local\n                                 double *) red_arr_mem_233541)[sext_i32_i64(local_tid_233535 +\n                                                               offset_233572)];\n                    x_233567 = ((volatile __local\n                                 double *) red_arr_mem_233543)[sext_i32_i64(local_tid_233535 +\n                                                               offset_233572)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_233568 = x_233562 + x_233565;\n                    double defunc_1_op_res_233569 = x_233563 + x_233566;\n                    double defunc_1_op_res_233570 = x_233564 + x_233567;\n                    \n                    x_233562 = defunc_1_op_res_233568;\n                    x_233563 = defunc_1_op_res_233569;\n                    x_233564 = defunc_1_op_res_233570;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_233539)[sext_i32_i64(local_tid_233535)] =\n                        x_233562;\n                    ((volatile __local\n                      double *) red_arr_mem_233541)[sext_i32_i64(local_tid_233535)] =\n                        x_233563;\n                    ((volatile __local\n                      double *) red_arr_mem_233543)[sext_i32_i64(local_tid_233535)] =\n                        x_233564;\n                }\n            }\n            offset_233572 *= 2;\n        }\n        while (slt32(skip_waves_233573,\n                     squot32(sext_i64_i32(segred_group_sizze_214127) +\n                             wave_",
            "sizze_233537 - 1, wave_sizze_233537))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_233572 = skip_waves_233573 * wave_sizze_233537;\n            if (slt32(local_tid_233535 + offset_233572,\n                      sext_i64_i32(segred_group_sizze_214127)) &&\n                ((local_tid_233535 - squot32(local_tid_233535,\n                                             wave_sizze_233537) *\n                  wave_sizze_233537) == 0 && (squot32(local_tid_233535,\n                                                      wave_sizze_233537) & (2 *\n                                                                            skip_waves_233573 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_233565 = ((__local\n                                 double *) red_arr_mem_233539)[sext_i32_i64(local_tid_233535 +\n                                                               offset_233572)];\n                    x_233566 = ((__local\n                                 double *) red_arr_mem_233541)[sext_i32_i64(local_tid_233535 +\n                                                               offset_233572)];\n                    x_233567 = ((__local\n                                 double *) red_arr_mem_233543)[sext_i32_i64(local_tid_233535 +\n                                                               offset_233572)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_233568 = x_233562 + x_233565;\n                    double defunc_1_op_res_233569 = x_233563 + x_233566;\n                    double defunc_1_op_res_233570 = x_233564 + x_233567;\n                    \n                    x_233562 = defunc_1_op_res_233568;\n                    x_233563 = defunc_1_op_res_233569;\n                    x_233564 = defunc_1_op_res_233570;\n                }\n                // write result of op",
            "eration\n                {\n                    ((__local\n                      double *) red_arr_mem_233539)[sext_i32_i64(local_tid_233535)] =\n                        x_233562;\n                    ((__local\n                      double *) red_arr_mem_233541)[sext_i32_i64(local_tid_233535)] =\n                        x_233563;\n                    ((__local\n                      double *) red_arr_mem_233543)[sext_i32_i64(local_tid_233535)] =\n                        x_233564;\n                }\n            }\n            skip_waves_233573 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_233535) == (int64_t) 0) {\n                x_acc_233558 = x_233562;\n                x_acc_233559 = x_233563;\n                x_acc_233560 = x_233564;\n            }\n        }\n        if (groups_per_segment_233521 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_233535 == 0) {\n                    ((__global double *) mem_229983)[gtid_214133 *\n                                                     (s_n_m_203636 *\n                                                      n_p_203492) +\n                                                     gtid_214134 *\n                                                     s_n_m_203636 +\n                                                     gtid_214135] =\n                        x_acc_233558;\n                    ((__global double *) mem_229988)[gtid_214133 *\n                                                     (s_n_m_203636 *\n                                                      n_p_203492) +\n                                                     gtid_214134 *\n                                                     s_n_m_203636 +\n                                                     gtid_214135] =\n                        x_acc_233559;\n                    ((__global double *) mem_229993)[gtid_2",
            "14133 *\n                                                     (s_n_m_203636 *\n                                                      n_p_203492) +\n                                                     gtid_214134 *\n                                                     s_n_m_203636 +\n                                                     gtid_214135] =\n                        x_acc_233560;\n                }\n            }\n        } else {\n            int32_t old_counter_233574;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_233535 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_233526)[sext_i32_i64(virt_group_id_233549)] =\n                        x_acc_233558;\n                    ((__global\n                      double *) segred_tmp_mem_233528)[sext_i32_i64(virt_group_id_233549)] =\n                        x_acc_233559;\n                    ((__global\n                      double *) segred_tmp_mem_233530)[sext_i32_i64(virt_group_id_233549)] =\n                        x_acc_233560;\n                    mem_fence_global();\n                    old_counter_233574 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_233532)[sext_i32_i64(srem32(flat_segment_id_233550,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_233545)[(int64_t) 0] =\n                        old_counter_233574 == groups_per_segment_233521 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_233575;\n            \n            is_last_group_233575 = ((__local\n                                     bool *) sync_arr_mem_23",
            "3545)[(int64_t) 0];\n            if (is_last_group_233575) {\n                if (local_tid_233535 == 0) {\n                    old_counter_233574 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_233532)[sext_i32_i64(srem32(flat_segment_id_233550,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_233521));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_233576 =\n                            sdiv_up64(groups_per_segment_233521,\n                                      segred_group_sizze_214127);\n                    \n                    x_214138 = 0.0;\n                    x_214139 = 0.0;\n                    x_214140 = 0.0;\n                    for (int64_t i_233577 = 0; i_233577 <\n                         read_per_thread_233576; i_233577++) {\n                        int64_t group_res_id_233578 =\n                                sext_i32_i64(local_tid_233535) *\n                                read_per_thread_233576 + i_233577;\n                        int64_t index_of_group_res_233579 =\n                                sext_i32_i64(flat_segment_id_233550) *\n                                groups_per_segment_233521 + group_res_id_233578;\n                        \n                        if (slt64(group_res_id_233578,\n                                  groups_per_segment_233521)) {\n                            x_214141 = ((__global\n                                         double *) segred_tmp_mem_233526)[index_of_group_res_233579];\n                            x_214142 = ((__global\n                                         double *) segred_tmp_mem_233528)[index_of_group_res_233579];\n                            x_21414",
            "3 = ((__global\n                                         double *) segred_tmp_mem_233530)[index_of_group_res_233579];\n                            \n                            double defunc_1_op_res_214144 = x_214138 + x_214141;\n                            double defunc_1_op_res_214145 = x_214139 + x_214142;\n                            double defunc_1_op_res_214146 = x_214140 + x_214143;\n                            \n                            x_214138 = defunc_1_op_res_214144;\n                            x_214139 = defunc_1_op_res_214145;\n                            x_214140 = defunc_1_op_res_214146;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_233539)[sext_i32_i64(local_tid_233535)] =\n                    x_214138;\n                ((__local\n                  double *) red_arr_mem_233541)[sext_i32_i64(local_tid_233535)] =\n                    x_214139;\n                ((__local\n                  double *) red_arr_mem_233543)[sext_i32_i64(local_tid_233535)] =\n                    x_214140;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_233580;\n                    int32_t skip_waves_233581 = 1;\n                    double x_233562;\n                    double x_233563;\n                    double x_233564;\n                    double x_233565;\n                    double x_233566;\n                    double x_233567;\n                    \n                    offset_233580 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_233535,\n                                  sext_i64_i32(segred_group_sizze_214127))) {\n                            x_233562 = ((__local\n                                         double *) red_arr_mem_233539)[sext_i32_i64(local_tid_233535 +\n                                                   ",
            "                    offset_233580)];\n                            x_233563 = ((__local\n                                         double *) red_arr_mem_233541)[sext_i32_i64(local_tid_233535 +\n                                                                       offset_233580)];\n                            x_233564 = ((__local\n                                         double *) red_arr_mem_233543)[sext_i32_i64(local_tid_233535 +\n                                                                       offset_233580)];\n                        }\n                    }\n                    offset_233580 = 1;\n                    while (slt32(offset_233580, wave_sizze_233537)) {\n                        if (slt32(local_tid_233535 + offset_233580,\n                                  sext_i64_i32(segred_group_sizze_214127)) &&\n                            ((local_tid_233535 - squot32(local_tid_233535,\n                                                         wave_sizze_233537) *\n                              wave_sizze_233537) & (2 * offset_233580 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_233565 = ((volatile __local\n                                             double *) red_arr_mem_233539)[sext_i32_i64(local_tid_233535 +\n                                                                           offset_233580)];\n                                x_233566 = ((volatile __local\n                                             double *) red_arr_mem_233541)[sext_i32_i64(local_tid_233535 +\n                                                                           offset_233580)];\n                                x_233567 = ((volatile __local\n                                             double *) red_arr_mem_233543)[sext_i32_i64(local_tid_233535 +\n                                                                           offset_233580)];\n                            }\n                      ",
            "      // apply reduction operation\n                            {\n                                double defunc_1_op_res_233568 = x_233562 +\n                                       x_233565;\n                                double defunc_1_op_res_233569 = x_233563 +\n                                       x_233566;\n                                double defunc_1_op_res_233570 = x_233564 +\n                                       x_233567;\n                                \n                                x_233562 = defunc_1_op_res_233568;\n                                x_233563 = defunc_1_op_res_233569;\n                                x_233564 = defunc_1_op_res_233570;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_233539)[sext_i32_i64(local_tid_233535)] =\n                                    x_233562;\n                                ((volatile __local\n                                  double *) red_arr_mem_233541)[sext_i32_i64(local_tid_233535)] =\n                                    x_233563;\n                                ((volatile __local\n                                  double *) red_arr_mem_233543)[sext_i32_i64(local_tid_233535)] =\n                                    x_233564;\n                            }\n                        }\n                        offset_233580 *= 2;\n                    }\n                    while (slt32(skip_waves_233581,\n                                 squot32(sext_i64_i32(segred_group_sizze_214127) +\n                                         wave_sizze_233537 - 1,\n                                         wave_sizze_233537))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_233580 = skip_waves_233581 * wave_sizze_233537;\n                        if (slt32(local_tid_233535 + offset_233580,\n                                  sext_i6",
            "4_i32(segred_group_sizze_214127)) &&\n                            ((local_tid_233535 - squot32(local_tid_233535,\n                                                         wave_sizze_233537) *\n                              wave_sizze_233537) == 0 &&\n                             (squot32(local_tid_233535, wave_sizze_233537) &\n                              (2 * skip_waves_233581 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_233565 = ((__local\n                                             double *) red_arr_mem_233539)[sext_i32_i64(local_tid_233535 +\n                                                                           offset_233580)];\n                                x_233566 = ((__local\n                                             double *) red_arr_mem_233541)[sext_i32_i64(local_tid_233535 +\n                                                                           offset_233580)];\n                                x_233567 = ((__local\n                                             double *) red_arr_mem_233543)[sext_i32_i64(local_tid_233535 +\n                                                                           offset_233580)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_233568 = x_233562 +\n                                       x_233565;\n                                double defunc_1_op_res_233569 = x_233563 +\n                                       x_233566;\n                                double defunc_1_op_res_233570 = x_233564 +\n                                       x_233567;\n                                \n                                x_233562 = defunc_1_op_res_233568;\n                                x_233563 = defunc_1_op_res_233569;\n                                x_233564 = defunc_1_op_res_233570;\n                            }\n                   ",
            "         // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_233539)[sext_i32_i64(local_tid_233535)] =\n                                    x_233562;\n                                ((__local\n                                  double *) red_arr_mem_233541)[sext_i32_i64(local_tid_233535)] =\n                                    x_233563;\n                                ((__local\n                                  double *) red_arr_mem_233543)[sext_i32_i64(local_tid_233535)] =\n                                    x_233564;\n                            }\n                        }\n                        skip_waves_233581 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_233535 == 0) {\n                            ((__global double *) mem_229983)[gtid_214133 *\n                                                             (s_n_m_203636 *\n                                                              n_p_203492) +\n                                                             gtid_214134 *\n                                                             s_n_m_203636 +\n                                                             gtid_214135] =\n                                x_233562;\n                            ((__global double *) mem_229988)[gtid_214133 *\n                                                             (s_n_m_203636 *\n                                                              n_p_203492) +\n                                                             gtid_214134 *\n                                                             s_n_m_203636 +\n                                                             gtid_214135] =\n                                x_233563;\n                            ((__global double *) mem_229993)[gtid_214133 *\n                                        ",
            "                     (s_n_m_203636 *\n                                                              n_p_203492) +\n                                                             gtid_214134 *\n                                                             s_n_m_203636 +\n                                                             gtid_214135] =\n                                x_233564;\n                        }\n                    }\n                }\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_214127\n}\n__kernel void mainzisegred_large_214231(__global int *global_failure,\n                                        uint sync_arr_mem_233651_backing_offset_0,\n                                        uint red_arr_mem_233649_backing_offset_1,\n                                        uint red_arr_mem_233647_backing_offset_2,\n                                        int64_t n_p_203492, int64_t q_s_203493,\n                                        int64_t partition_sizze_203577,\n                                        int64_t defunc_0_f_res_203631,\n                                        int64_t s_n_m_203636,\n                                        int64_t num_groups_214223,\n                                        int64_t groups_per_segment_233631,\n                                        int64_t elements_per_thread_233632,\n                                        int64_t virt_num_groups_233633,\n                                        int64_t threads_per_segment_233635,\n                                        __global unsigned char *ext_mem_229264,\n                                        __global unsigned char *ext_mem_229265,\n                                        __global unsigned char *ext_mem_229362,\n                                        __global unsigned char *ext_mem_229363,\n                                        __global unsigned char *mem_229526,\n                              ",
            "          __global unsigned char *mem_229531,\n                                        __global unsigned char *mem_229999,\n                                        __global unsigned char *mem_230004,\n                                        __global unsigned char *mem_230009,\n                                        __global unsigned char *mem_230014,\n                                        __global unsigned char *mem_230020,\n                                        __global unsigned char *mem_230025,\n                                        __global\n                                        unsigned char *segred_tmp_mem_233636,\n                                        __global\n                                        unsigned char *segred_tmp_mem_233638,\n                                        __global\n                                        unsigned char *mainzicounter_mem_233640)\n{\n    #define segred_group_sizze_214222 (mainzisegred_group_sizze_212960)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *sync_arr_mem_233651_backing_2 =\n                           &shared_mem[sync_arr_mem_233651_backing_offset_0];\n    volatile unsigned char *red_arr_mem_233649_backing_1 =\n                           &shared_mem[red_arr_mem_233649_backing_offset_1];\n    volatile unsigned char *red_arr_mem_233647_backing_0 =\n                           &shared_mem[red_arr_mem_233647_backing_offset_2];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233642;\n    int32_t local_tid_233643;\n    int64_t group_sizze_233646;\n    int32_t wave_sizze_233645;\n    int32_t group_tid_233644;\n    \n    global_tid_233642 = get_global_id(0);\n    local_tid_233643 = get_local_id(0);\n    group_sizze_233646 = get_local_size(0);\n    wave_sizze_233645 = LOCKSTEP_WIDTH;\n    group_tid_233644 = get_group_id(0);\n    \n    int32_t phys_tid_214231 = global_tid_233642;\n    __local unsigned char *red_arr_mem_233647;\n    \n    red_",
            "arr_mem_233647 = (__local unsigned char *) red_arr_mem_233647_backing_0;\n    \n    __local unsigned char *red_arr_mem_233649;\n    \n    red_arr_mem_233649 = (__local unsigned char *) red_arr_mem_233649_backing_1;\n    \n    __local unsigned char *sync_arr_mem_233651;\n    \n    sync_arr_mem_233651 = (__local\n                           unsigned char *) sync_arr_mem_233651_backing_2;\n    \n    int32_t phys_group_id_233653;\n    \n    phys_group_id_233653 = get_group_id(0);\n    for (int32_t i_233654 = 0; i_233654 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_233633) - phys_group_id_233653,\n                   sext_i64_i32(num_groups_214223)); i_233654++) {\n        int32_t virt_group_id_233655 = phys_group_id_233653 + i_233654 *\n                sext_i64_i32(num_groups_214223);\n        int32_t flat_segment_id_233656 = squot32(virt_group_id_233655,\n                                                 sext_i64_i32(groups_per_segment_233631));\n        int64_t global_tid_233657 = srem64(sext_i32_i64(virt_group_id_233655) *\n                                           segred_group_sizze_214222 +\n                                           sext_i32_i64(local_tid_233643),\n                                           segred_group_sizze_214222 *\n                                           groups_per_segment_233631);\n        int64_t slice_233658 = s_n_m_203636;\n        int64_t slice_233659 = n_p_203492 * slice_233658;\n        int64_t slice_233660 = partition_sizze_203577 * slice_233659;\n        int64_t gtid_214227 = squot64(sext_i32_i64(flat_segment_id_233656),\n                                      slice_233659);\n        int64_t remnant_233661 = sext_i32_i64(flat_segment_id_233656) -\n                gtid_214227 * slice_233659;\n        int64_t gtid_214228 = squot64(remnant_233661, slice_233658);\n        int64_t remnant_233662 = remnant_233661 - gtid_214228 * slice_233658;\n        int64_t gtid_214229 = remnant_233662;\n        int64_t remnant_233663 = remnant_233662 - gtid_214229;\n        int64_t gt",
            "id_214230;\n        double x_acc_233664;\n        double x_acc_233665;\n        int64_t chunk_sizze_233666 = smin64(elements_per_thread_233632,\n                                            sdiv_up64(q_s_203493 -\n                                                      global_tid_233657,\n                                                      threads_per_segment_233635));\n        double x_214232;\n        double x_214233;\n        double x_214234;\n        double x_214235;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_233664 = 0.0;\n            x_acc_233665 = 0.0;\n        }\n        for (int64_t i_233673 = 0; i_233673 < chunk_sizze_233666; i_233673++) {\n            gtid_214230 = global_tid_233657 + threads_per_segment_233635 *\n                i_233673;\n            // apply map function\n            {\n                int64_t x_214251;\n                \n                x_214251 = ((__global int64_t *) ext_mem_229264)[gtid_214227 *\n                                                                 n_p_203492 +\n                                                                 gtid_214228];\n                \n                int64_t x_214258;\n                \n                x_214258 = ((__global int64_t *) ext_mem_229363)[gtid_214227 *\n                                                                 (s_n_m_203636 *\n                                                                  n_p_203492) +\n                                                                 gtid_214228 *\n                                                                 s_n_m_203636 +\n                                                                 gtid_214229];\n                \n                double x_214259;\n                \n                x_214259 = ((__global double *) ext_mem_229362)[gtid_214227 *\n                                                                (s_n_m_203636 *\n                                                                 n_p_203492) +\n                             ",
            "                                   gtid_214228 *\n                                                                s_n_m_203636 +\n                                                                gtid_214229];\n                \n                double a11_214260;\n                \n                a11_214260 = ((__global double *) mem_229999)[gtid_214227 *\n                                                              (s_n_m_203636 *\n                                                               n_p_203492) +\n                                                              gtid_214228 *\n                                                              s_n_m_203636 +\n                                                              gtid_214229];\n                \n                double b11_214261;\n                \n                b11_214261 = ((__global double *) mem_230004)[gtid_214227 *\n                                                              (s_n_m_203636 *\n                                                               n_p_203492) +\n                                                              gtid_214228 *\n                                                              s_n_m_203636 +\n                                                              gtid_214229];\n                \n                double c11_214262;\n                \n                c11_214262 = ((__global double *) mem_230009)[gtid_214227 *\n                                                              (s_n_m_203636 *\n                                                               n_p_203492) +\n                                                              gtid_214228 *\n                                                              s_n_m_203636 +\n                                                              gtid_214229];\n                \n                int64_t defunc_0_m_fun_res_214263;\n                \n                defunc_0_m_fun_res_214263 = ((__global\n                                              int64_t *) mem_230014",
            ")[gtid_214227 *\n                                                                     (s_n_m_203636 *\n                                                                      n_p_203492) +\n                                                                     gtid_214228 *\n                                                                     s_n_m_203636 +\n                                                                     gtid_214229];\n                \n                bool cond_214265 = sle64(x_214251, gtid_214230);\n                int64_t defunc_0_f_res_214266;\n                \n                if (cond_214265) {\n                    defunc_0_f_res_214266 = (int64_t) 0;\n                } else {\n                    int64_t i_214267 = add64(gtid_214230, x_214258);\n                    int64_t defunc_0_add_arg_214268;\n                    \n                    defunc_0_add_arg_214268 = ((__global\n                                                int64_t *) ext_mem_229265)[gtid_214227 *\n                                                                           (defunc_0_f_res_203631 *\n                                                                            n_p_203492) +\n                                                                           gtid_214228 *\n                                                                           defunc_0_f_res_203631 +\n                                                                           i_214267];\n                    \n                    int64_t defunc_1_add_res_214269 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_214268);\n                    \n                    defunc_0_f_res_214266 = defunc_1_add_res_214269;\n                }\n                \n                double defunc_0_f_res_214270;\n                \n                if (cond_214265) {\n                    defunc_0_f_res_214270 = 0.0;\n                } else {\n                    int64_t i_214271 = add64(gtid_214230, x_214258);\n   ",
            "                 double defunc_0_add_arg_214272;\n                    \n                    defunc_0_add_arg_214272 = ((__global\n                                                double *) mem_229531)[gtid_214227 *\n                                                                      (defunc_0_f_res_203631 *\n                                                                       n_p_203492) +\n                                                                      gtid_214228 *\n                                                                      defunc_0_f_res_203631 +\n                                                                      i_214271];\n                    defunc_0_f_res_214270 = defunc_0_add_arg_214272;\n                }\n                \n                int64_t binop_p_214273 = sub64(defunc_0_f_res_214266,\n                                               defunc_0_m_fun_res_214263);\n                double defunc_0_f_res_214274 = sitofp_i64_f64(binop_p_214273);\n                double abs_res_214275 = fabs(defunc_0_f_res_214274);\n                double tmp1_214276 = abs_res_214275 / x_214259;\n                double x_214277 = tmp1_214276 * tmp1_214276;\n                double y_214278 = tmp1_214276 * x_214277;\n                double tmp2_214279 = 1.0 - y_214278;\n                double x_214280 = tmp2_214279 * tmp2_214279;\n                double tmp3_214281 = tmp2_214279 * x_214280;\n                double tmp4_214282 = defunc_0_f_res_214270 * tmp3_214281;\n                double defunc_1_f_res_214283 = defunc_0_f_res_214274 *\n                       tmp4_214282;\n                double defunc_0_f_res_214284;\n                \n                if (cond_214265) {\n                    defunc_0_f_res_214284 = 0.0;\n                } else {\n                    int64_t i_214285 = add64(gtid_214230, x_214258);\n                    double defunc_0_add_arg_214286;\n                    \n                    defunc_0_add_arg_214286 = ((__global\n                                           ",
            "     double *) mem_229526)[gtid_214227 *\n                                                                      (defunc_0_f_res_203631 *\n                                                                       n_p_203492) +\n                                                                      gtid_214228 *\n                                                                      defunc_0_f_res_203631 +\n                                                                      i_214285];\n                    defunc_0_f_res_214284 = defunc_0_add_arg_214286;\n                }\n                \n                double x_214287 = a11_214260 * tmp4_214282;\n                double y_214288 = b11_214261 * defunc_1_f_res_214283;\n                double x_214289 = x_214287 + y_214288;\n                double defunc_9_fit_fun_res_214290 = defunc_0_f_res_214284 *\n                       x_214289;\n                double x_214291 = b11_214261 * tmp4_214282;\n                double y_214292 = c11_214262 * defunc_1_f_res_214283;\n                double x_214293 = x_214291 + y_214292;\n                double defunc_9_slope_fun_res_214294 = defunc_0_f_res_214284 *\n                       x_214293;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_214232 = x_acc_233664;\n                    x_214233 = x_acc_233665;\n                }\n                // load new values\n                {\n                    x_214234 = defunc_9_fit_fun_res_214290;\n                    x_214235 = defunc_9_slope_fun_res_214294;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_214236 = x_214232 + x_214234;\n                    double defunc_1_op_res_214237 = x_214233 + x_214235;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_233664 = defunc_1_op_res_214236;\n                        x_acc_2336",
            "65 = defunc_1_op_res_214237;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_214232 = x_acc_233664;\n            x_214233 = x_acc_233665;\n            ((__local\n              double *) red_arr_mem_233647)[sext_i32_i64(local_tid_233643)] =\n                x_214232;\n            ((__local\n              double *) red_arr_mem_233649)[sext_i32_i64(local_tid_233643)] =\n                x_214233;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_233674;\n        int32_t skip_waves_233675 = 1;\n        double x_233667;\n        double x_233668;\n        double x_233669;\n        double x_233670;\n        \n        offset_233674 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_233643,\n                      sext_i64_i32(segred_group_sizze_214222))) {\n                x_233667 = ((__local\n                             double *) red_arr_mem_233647)[sext_i32_i64(local_tid_233643 +\n                                                           offset_233674)];\n                x_233668 = ((__local\n                             double *) red_arr_mem_233649)[sext_i32_i64(local_tid_233643 +\n                                                           offset_233674)];\n            }\n        }\n        offset_233674 = 1;\n        while (slt32(offset_233674, wave_sizze_233645)) {\n            if (slt32(local_tid_233643 + offset_233674,\n                      sext_i64_i32(segred_group_sizze_214222)) &&\n                ((local_tid_233643 - squot32(local_tid_233643,\n                                             wave_sizze_233645) *\n                  wave_sizze_233645) & (2 * offset_233674 - 1)) == 0) {\n                // read array element\n                {\n                    x_233669 = ((volatile __local\n                                 double *) red_arr_mem_233647)[sext_i32_i64(local_tid_233643 +\n                        ",
            "                                       offset_233674)];\n                    x_233670 = ((volatile __local\n                                 double *) red_arr_mem_233649)[sext_i32_i64(local_tid_233643 +\n                                                               offset_233674)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_233671 = x_233667 + x_233669;\n                    double defunc_1_op_res_233672 = x_233668 + x_233670;\n                    \n                    x_233667 = defunc_1_op_res_233671;\n                    x_233668 = defunc_1_op_res_233672;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_233647)[sext_i32_i64(local_tid_233643)] =\n                        x_233667;\n                    ((volatile __local\n                      double *) red_arr_mem_233649)[sext_i32_i64(local_tid_233643)] =\n                        x_233668;\n                }\n            }\n            offset_233674 *= 2;\n        }\n        while (slt32(skip_waves_233675,\n                     squot32(sext_i64_i32(segred_group_sizze_214222) +\n                             wave_sizze_233645 - 1, wave_sizze_233645))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_233674 = skip_waves_233675 * wave_sizze_233645;\n            if (slt32(local_tid_233643 + offset_233674,\n                      sext_i64_i32(segred_group_sizze_214222)) &&\n                ((local_tid_233643 - squot32(local_tid_233643,\n                                             wave_sizze_233645) *\n                  wave_sizze_233645) == 0 && (squot32(local_tid_233643,\n                                                      wave_sizze_233645) & (2 *\n                                                                            skip_waves_233675 -\n                                                                            1)) ==\n           ",
            "      0)) {\n                // read array element\n                {\n                    x_233669 = ((__local\n                                 double *) red_arr_mem_233647)[sext_i32_i64(local_tid_233643 +\n                                                               offset_233674)];\n                    x_233670 = ((__local\n                                 double *) red_arr_mem_233649)[sext_i32_i64(local_tid_233643 +\n                                                               offset_233674)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_233671 = x_233667 + x_233669;\n                    double defunc_1_op_res_233672 = x_233668 + x_233670;\n                    \n                    x_233667 = defunc_1_op_res_233671;\n                    x_233668 = defunc_1_op_res_233672;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_233647)[sext_i32_i64(local_tid_233643)] =\n                        x_233667;\n                    ((__local\n                      double *) red_arr_mem_233649)[sext_i32_i64(local_tid_233643)] =\n                        x_233668;\n                }\n            }\n            skip_waves_233675 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_233643) == (int64_t) 0) {\n                x_acc_233664 = x_233667;\n                x_acc_233665 = x_233668;\n            }\n        }\n        if (groups_per_segment_233631 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_233643 == 0) {\n                    ((__global double *) mem_230020)[gtid_214227 *\n                                                     (s_n_m_203636 *\n                                                      n_p_203492) +\n                       ",
            "                              gtid_214228 *\n                                                     s_n_m_203636 +\n                                                     gtid_214229] =\n                        x_acc_233664;\n                    ((__global double *) mem_230025)[gtid_214227 *\n                                                     (s_n_m_203636 *\n                                                      n_p_203492) +\n                                                     gtid_214228 *\n                                                     s_n_m_203636 +\n                                                     gtid_214229] =\n                        x_acc_233665;\n                }\n            }\n        } else {\n            int32_t old_counter_233676;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_233643 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_233636)[sext_i32_i64(virt_group_id_233655)] =\n                        x_acc_233664;\n                    ((__global\n                      double *) segred_tmp_mem_233638)[sext_i32_i64(virt_group_id_233655)] =\n                        x_acc_233665;\n                    mem_fence_global();\n                    old_counter_233676 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_233640)[sext_i32_i64(srem32(flat_segment_id_233656,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_233651)[(int64_t) 0] =\n                        old_counter_233676 == groups_per_segment_233631 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_233677;\n   ",
            "         \n            is_last_group_233677 = ((__local\n                                     bool *) sync_arr_mem_233651)[(int64_t) 0];\n            if (is_last_group_233677) {\n                if (local_tid_233643 == 0) {\n                    old_counter_233676 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_233640)[sext_i32_i64(srem32(flat_segment_id_233656,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_233631));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_233678 =\n                            sdiv_up64(groups_per_segment_233631,\n                                      segred_group_sizze_214222);\n                    \n                    x_214232 = 0.0;\n                    x_214233 = 0.0;\n                    for (int64_t i_233679 = 0; i_233679 <\n                         read_per_thread_233678; i_233679++) {\n                        int64_t group_res_id_233680 =\n                                sext_i32_i64(local_tid_233643) *\n                                read_per_thread_233678 + i_233679;\n                        int64_t index_of_group_res_233681 =\n                                sext_i32_i64(flat_segment_id_233656) *\n                                groups_per_segment_233631 + group_res_id_233680;\n                        \n                        if (slt64(group_res_id_233680,\n                                  groups_per_segment_233631)) {\n                            x_214234 = ((__global\n                                         double *) segred_tmp_mem_233636)[index_of_group_res_233681];\n                            x_214235 = ((__global\n                                         double *) segred_",
            "tmp_mem_233638)[index_of_group_res_233681];\n                            \n                            double defunc_1_op_res_214236 = x_214232 + x_214234;\n                            double defunc_1_op_res_214237 = x_214233 + x_214235;\n                            \n                            x_214232 = defunc_1_op_res_214236;\n                            x_214233 = defunc_1_op_res_214237;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_233647)[sext_i32_i64(local_tid_233643)] =\n                    x_214232;\n                ((__local\n                  double *) red_arr_mem_233649)[sext_i32_i64(local_tid_233643)] =\n                    x_214233;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_233682;\n                    int32_t skip_waves_233683 = 1;\n                    double x_233667;\n                    double x_233668;\n                    double x_233669;\n                    double x_233670;\n                    \n                    offset_233682 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_233643,\n                                  sext_i64_i32(segred_group_sizze_214222))) {\n                            x_233667 = ((__local\n                                         double *) red_arr_mem_233647)[sext_i32_i64(local_tid_233643 +\n                                                                       offset_233682)];\n                            x_233668 = ((__local\n                                         double *) red_arr_mem_233649)[sext_i32_i64(local_tid_233643 +\n                                                                       offset_233682)];\n                        }\n                    }\n                    offset_233682 = 1;\n                    while (slt32(offset_233682, wave_sizze_233645",
            ")) {\n                        if (slt32(local_tid_233643 + offset_233682,\n                                  sext_i64_i32(segred_group_sizze_214222)) &&\n                            ((local_tid_233643 - squot32(local_tid_233643,\n                                                         wave_sizze_233645) *\n                              wave_sizze_233645) & (2 * offset_233682 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_233669 = ((volatile __local\n                                             double *) red_arr_mem_233647)[sext_i32_i64(local_tid_233643 +\n                                                                           offset_233682)];\n                                x_233670 = ((volatile __local\n                                             double *) red_arr_mem_233649)[sext_i32_i64(local_tid_233643 +\n                                                                           offset_233682)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_233671 = x_233667 +\n                                       x_233669;\n                                double defunc_1_op_res_233672 = x_233668 +\n                                       x_233670;\n                                \n                                x_233667 = defunc_1_op_res_233671;\n                                x_233668 = defunc_1_op_res_233672;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_233647)[sext_i32_i64(local_tid_233643)] =\n                                    x_233667;\n                                ((volatile __local\n                                  double *) red_arr_mem_233649)[sext_i32_i64(local_tid_",
            "233643)] =\n                                    x_233668;\n                            }\n                        }\n                        offset_233682 *= 2;\n                    }\n                    while (slt32(skip_waves_233683,\n                                 squot32(sext_i64_i32(segred_group_sizze_214222) +\n                                         wave_sizze_233645 - 1,\n                                         wave_sizze_233645))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_233682 = skip_waves_233683 * wave_sizze_233645;\n                        if (slt32(local_tid_233643 + offset_233682,\n                                  sext_i64_i32(segred_group_sizze_214222)) &&\n                            ((local_tid_233643 - squot32(local_tid_233643,\n                                                         wave_sizze_233645) *\n                              wave_sizze_233645) == 0 &&\n                             (squot32(local_tid_233643, wave_sizze_233645) &\n                              (2 * skip_waves_233683 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_233669 = ((__local\n                                             double *) red_arr_mem_233647)[sext_i32_i64(local_tid_233643 +\n                                                                           offset_233682)];\n                                x_233670 = ((__local\n                                             double *) red_arr_mem_233649)[sext_i32_i64(local_tid_233643 +\n                                                                           offset_233682)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_233671 = x_233667 +\n                                       x_233669;\n                                double defunc_1_op_res_233672 = x_233668 +\n                        ",
            "               x_233670;\n                                \n                                x_233667 = defunc_1_op_res_233671;\n                                x_233668 = defunc_1_op_res_233672;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_233647)[sext_i32_i64(local_tid_233643)] =\n                                    x_233667;\n                                ((__local\n                                  double *) red_arr_mem_233649)[sext_i32_i64(local_tid_233643)] =\n                                    x_233668;\n                            }\n                        }\n                        skip_waves_233683 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_233643 == 0) {\n                            ((__global double *) mem_230020)[gtid_214227 *\n                                                             (s_n_m_203636 *\n                                                              n_p_203492) +\n                                                             gtid_214228 *\n                                                             s_n_m_203636 +\n                                                             gtid_214229] =\n                                x_233667;\n                            ((__global double *) mem_230025)[gtid_214227 *\n                                                             (s_n_m_203636 *\n                                                              n_p_203492) +\n                                                             gtid_214228 *\n                                                             s_n_m_203636 +\n                                                             gtid_214229] =\n                                x_233668;\n                        }\n                    }\n            ",
            "    }\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_214222\n}\n__kernel void mainzisegred_large_216784(__global int *global_failure,\n                                        uint sync_arr_mem_233962_backing_offset_0,\n                                        uint red_arr_mem_233960_backing_offset_1,\n                                        uint red_arr_mem_233958_backing_offset_2,\n                                        uint red_arr_mem_233956_backing_offset_3,\n                                        uint red_arr_mem_233954_backing_offset_4,\n                                        uint red_arr_mem_233952_backing_offset_5,\n                                        int64_t n_p_203492, int64_t q_s_203493,\n                                        int64_t partition_sizze_203577,\n                                        int64_t defunc_0_f_res_203631,\n                                        int64_t s_n_m_203636,\n                                        int64_t num_groups_216773,\n                                        int64_t groups_per_segment_233930,\n                                        int64_t elements_per_thread_233931,\n                                        int64_t virt_num_groups_233932,\n                                        int64_t threads_per_segment_233934,\n                                        __global unsigned char *ext_mem_229264,\n                                        __global unsigned char *ext_mem_229265,\n                                        __global unsigned char *ext_mem_229362,\n                                        __global unsigned char *ext_mem_229363,\n                                        __global unsigned char *mem_229531,\n                                        __global unsigned char *mem_230312,\n                                        __global unsigned char *mem_230322,\n                                        __global unsigned char *mem_230327",
            ",\n                                        __global unsigned char *mem_230332,\n                                        __global unsigned char *mem_230337,\n                                        __global unsigned char *mem_230342,\n                                        __global\n                                        unsigned char *segred_tmp_mem_233935,\n                                        __global\n                                        unsigned char *segred_tmp_mem_233937,\n                                        __global\n                                        unsigned char *segred_tmp_mem_233939,\n                                        __global\n                                        unsigned char *segred_tmp_mem_233941,\n                                        __global\n                                        unsigned char *segred_tmp_mem_233943,\n                                        __global\n                                        unsigned char *mainzicounter_mem_233945)\n{\n    #define segred_group_sizze_216772 (mainzisegred_group_sizze_215512)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *sync_arr_mem_233962_backing_5 =\n                           &shared_mem[sync_arr_mem_233962_backing_offset_0];\n    volatile unsigned char *red_arr_mem_233960_backing_4 =\n                           &shared_mem[red_arr_mem_233960_backing_offset_1];\n    volatile unsigned char *red_arr_mem_233958_backing_3 =\n                           &shared_mem[red_arr_mem_233958_backing_offset_2];\n    volatile unsigned char *red_arr_mem_233956_backing_2 =\n                           &shared_mem[red_arr_mem_233956_backing_offset_3];\n    volatile unsigned char *red_arr_mem_233954_backing_1 =\n                           &shared_mem[red_arr_mem_233954_backing_offset_4];\n    volatile unsigned char *red_arr_mem_233952_backing_0 =\n                           &shared_mem[red_arr_mem_233952_backing_offset_5];\n    \n    if (*glob",
            "al_failure >= 0)\n        return;\n    \n    int32_t global_tid_233947;\n    int32_t local_tid_233948;\n    int64_t group_sizze_233951;\n    int32_t wave_sizze_233950;\n    int32_t group_tid_233949;\n    \n    global_tid_233947 = get_global_id(0);\n    local_tid_233948 = get_local_id(0);\n    group_sizze_233951 = get_local_size(0);\n    wave_sizze_233950 = LOCKSTEP_WIDTH;\n    group_tid_233949 = get_group_id(0);\n    \n    int32_t phys_tid_216784 = global_tid_233947;\n    __local unsigned char *red_arr_mem_233952;\n    \n    red_arr_mem_233952 = (__local unsigned char *) red_arr_mem_233952_backing_0;\n    \n    __local unsigned char *red_arr_mem_233954;\n    \n    red_arr_mem_233954 = (__local unsigned char *) red_arr_mem_233954_backing_1;\n    \n    __local unsigned char *red_arr_mem_233956;\n    \n    red_arr_mem_233956 = (__local unsigned char *) red_arr_mem_233956_backing_2;\n    \n    __local unsigned char *red_arr_mem_233958;\n    \n    red_arr_mem_233958 = (__local unsigned char *) red_arr_mem_233958_backing_3;\n    \n    __local unsigned char *red_arr_mem_233960;\n    \n    red_arr_mem_233960 = (__local unsigned char *) red_arr_mem_233960_backing_4;\n    \n    __local unsigned char *sync_arr_mem_233962;\n    \n    sync_arr_mem_233962 = (__local\n                           unsigned char *) sync_arr_mem_233962_backing_5;\n    \n    int32_t phys_group_id_233964;\n    \n    phys_group_id_233964 = get_group_id(0);\n    for (int32_t i_233965 = 0; i_233965 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_233932) - phys_group_id_233964,\n                   sext_i64_i32(num_groups_216773)); i_233965++) {\n        int32_t virt_group_id_233966 = phys_group_id_233964 + i_233965 *\n                sext_i64_i32(num_groups_216773);\n        int32_t flat_segment_id_233967 = squot32(virt_group_id_233966,\n                                                 sext_i64_i32(groups_per_segment_233930));\n        int64_t global_tid_233968 = srem64(sext_i32_i64(virt_group_id_233966) *\n                                           segred",
            "_group_sizze_216772 +\n                                           sext_i32_i64(local_tid_233948),\n                                           segred_group_sizze_216772 *\n                                           groups_per_segment_233930);\n        int64_t slice_233969 = s_n_m_203636;\n        int64_t slice_233970 = n_p_203492 * slice_233969;\n        int64_t slice_233971 = partition_sizze_203577 * slice_233970;\n        int64_t gtid_216780 = squot64(sext_i32_i64(flat_segment_id_233967),\n                                      slice_233970);\n        int64_t remnant_233972 = sext_i32_i64(flat_segment_id_233967) -\n                gtid_216780 * slice_233970;\n        int64_t gtid_216781 = squot64(remnant_233972, slice_233969);\n        int64_t remnant_233973 = remnant_233972 - gtid_216781 * slice_233969;\n        int64_t gtid_216782 = remnant_233973;\n        int64_t remnant_233974 = remnant_233973 - gtid_216782;\n        int64_t gtid_216783;\n        double x_acc_233975;\n        double x_acc_233976;\n        double x_acc_233977;\n        double x_acc_233978;\n        double x_acc_233979;\n        int64_t chunk_sizze_233980 = smin64(elements_per_thread_233931,\n                                            sdiv_up64(q_s_203493 -\n                                                      global_tid_233968,\n                                                      threads_per_segment_233934));\n        double x_216785;\n        double x_216786;\n        double x_216787;\n        double x_216788;\n        double x_216789;\n        double x_216790;\n        double x_216791;\n        double x_216792;\n        double x_216793;\n        double x_216794;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_233975 = 0.0;\n            x_acc_233976 = 0.0;\n            x_acc_233977 = 0.0;\n            x_acc_233978 = 0.0;\n            x_acc_233979 = 0.0;\n        }\n        for (int64_t i_233996 = 0; i_233996 < chunk_sizze_233980; i_233996++) {\n            gtid_216783 = global_tid_233968 + threa",
            "ds_per_segment_233934 *\n                i_233996;\n            // apply map function\n            {\n                int64_t x_216808;\n                \n                x_216808 = ((__global int64_t *) ext_mem_229264)[gtid_216780 *\n                                                                 n_p_203492 +\n                                                                 gtid_216781];\n                \n                int64_t x_216812;\n                \n                x_216812 = ((__global int64_t *) ext_mem_229363)[gtid_216780 *\n                                                                 (s_n_m_203636 *\n                                                                  n_p_203492) +\n                                                                 gtid_216781 *\n                                                                 s_n_m_203636 +\n                                                                 gtid_216782];\n                \n                double x_216813;\n                \n                x_216813 = ((__global double *) ext_mem_229362)[gtid_216780 *\n                                                                (s_n_m_203636 *\n                                                                 n_p_203492) +\n                                                                gtid_216781 *\n                                                                s_n_m_203636 +\n                                                                gtid_216782];\n                \n                int64_t defunc_0_m_fun_res_216814;\n                \n                defunc_0_m_fun_res_216814 = ((__global\n                                              int64_t *) mem_230312)[gtid_216780 *\n                                                                     (s_n_m_203636 *\n                                                                      n_p_203492) +\n                                                                     gtid_216781 *\n                                                       ",
            "              s_n_m_203636 +\n                                                                     gtid_216782];\n                \n                bool cond_216816 = sle64(x_216808, gtid_216783);\n                int64_t defunc_0_f_res_216817;\n                \n                if (cond_216816) {\n                    defunc_0_f_res_216817 = (int64_t) 0;\n                } else {\n                    int64_t i_216818 = add64(gtid_216783, x_216812);\n                    int64_t defunc_0_add_arg_216819;\n                    \n                    defunc_0_add_arg_216819 = ((__global\n                                                int64_t *) ext_mem_229265)[gtid_216780 *\n                                                                           (defunc_0_f_res_203631 *\n                                                                            n_p_203492) +\n                                                                           gtid_216781 *\n                                                                           defunc_0_f_res_203631 +\n                                                                           i_216818];\n                    \n                    int64_t defunc_1_add_res_216820 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_216819);\n                    \n                    defunc_0_f_res_216817 = defunc_1_add_res_216820;\n                }\n                \n                double defunc_0_f_res_216821;\n                \n                if (cond_216816) {\n                    defunc_0_f_res_216821 = 0.0;\n                } else {\n                    int64_t i_216822 = add64(gtid_216783, x_216812);\n                    double defunc_0_add_arg_216823;\n                    \n                    defunc_0_add_arg_216823 = ((__global\n                                                double *) mem_229531)[gtid_216780 *\n                                                                      (defunc_0_f_res_203631 *\n                 ",
            "                                                      n_p_203492) +\n                                                                      gtid_216781 *\n                                                                      defunc_0_f_res_203631 +\n                                                                      i_216822];\n                    defunc_0_f_res_216821 = defunc_0_add_arg_216823;\n                }\n                \n                int64_t binop_p_216824 = sub64(defunc_0_f_res_216817,\n                                               defunc_0_m_fun_res_216814);\n                double defunc_0_f_res_216825 = sitofp_i64_f64(binop_p_216824);\n                double abs_res_216826 = fabs(defunc_0_f_res_216825);\n                double tmp1_216827 = abs_res_216826 / x_216813;\n                double x_216828 = tmp1_216827 * tmp1_216827;\n                double y_216829 = tmp1_216827 * x_216828;\n                double tmp2_216830 = 1.0 - y_216829;\n                double x_216831 = tmp2_216830 * tmp2_216830;\n                double tmp3_216832 = tmp2_216830 * x_216831;\n                double w_j_216833 = defunc_0_f_res_216821 * tmp3_216832;\n                double xw_j_216834 = defunc_0_f_res_216825 * w_j_216833;\n                double x2w_j_216835 = defunc_0_f_res_216825 * xw_j_216834;\n                double x3w_j_216836 = defunc_0_f_res_216825 * x2w_j_216835;\n                double x4w_j_216837 = defunc_0_f_res_216825 * x3w_j_216836;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_216785 = x_acc_233975;\n                    x_216786 = x_acc_233976;\n                    x_216787 = x_acc_233977;\n                    x_216788 = x_acc_233978;\n                    x_216789 = x_acc_233979;\n                }\n                // load new values\n                {\n                    x_216790 = w_j_216833;\n                    x_216791 = xw_j_216834;\n                    x_216792 = ",
            "x2w_j_216835;\n                    x_216793 = x3w_j_216836;\n                    x_216794 = x4w_j_216837;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_216795 = x_216785 + x_216790;\n                    double defunc_1_op_res_216796 = x_216786 + x_216791;\n                    double defunc_1_op_res_216797 = x_216787 + x_216792;\n                    double defunc_1_op_res_216798 = x_216788 + x_216793;\n                    double defunc_1_op_res_216799 = x_216789 + x_216794;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_233975 = defunc_1_op_res_216795;\n                        x_acc_233976 = defunc_1_op_res_216796;\n                        x_acc_233977 = defunc_1_op_res_216797;\n                        x_acc_233978 = defunc_1_op_res_216798;\n                        x_acc_233979 = defunc_1_op_res_216799;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_216785 = x_acc_233975;\n            x_216786 = x_acc_233976;\n            x_216787 = x_acc_233977;\n            x_216788 = x_acc_233978;\n            x_216789 = x_acc_233979;\n            ((__local\n              double *) red_arr_mem_233952)[sext_i32_i64(local_tid_233948)] =\n                x_216785;\n            ((__local\n              double *) red_arr_mem_233954)[sext_i32_i64(local_tid_233948)] =\n                x_216786;\n            ((__local\n              double *) red_arr_mem_233956)[sext_i32_i64(local_tid_233948)] =\n                x_216787;\n            ((__local\n              double *) red_arr_mem_233958)[sext_i32_i64(local_tid_233948)] =\n                x_216788;\n            ((__local\n              double *) red_arr_mem_233960)[sext_i32_i64(local_tid_233948)] =\n                x_216789;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_233997;\n   ",
            "     int32_t skip_waves_233998 = 1;\n        double x_233981;\n        double x_233982;\n        double x_233983;\n        double x_233984;\n        double x_233985;\n        double x_233986;\n        double x_233987;\n        double x_233988;\n        double x_233989;\n        double x_233990;\n        \n        offset_233997 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_233948,\n                      sext_i64_i32(segred_group_sizze_216772))) {\n                x_233981 = ((__local\n                             double *) red_arr_mem_233952)[sext_i32_i64(local_tid_233948 +\n                                                           offset_233997)];\n                x_233982 = ((__local\n                             double *) red_arr_mem_233954)[sext_i32_i64(local_tid_233948 +\n                                                           offset_233997)];\n                x_233983 = ((__local\n                             double *) red_arr_mem_233956)[sext_i32_i64(local_tid_233948 +\n                                                           offset_233997)];\n                x_233984 = ((__local\n                             double *) red_arr_mem_233958)[sext_i32_i64(local_tid_233948 +\n                                                           offset_233997)];\n                x_233985 = ((__local\n                             double *) red_arr_mem_233960)[sext_i32_i64(local_tid_233948 +\n                                                           offset_233997)];\n            }\n        }\n        offset_233997 = 1;\n        while (slt32(offset_233997, wave_sizze_233950)) {\n            if (slt32(local_tid_233948 + offset_233997,\n                      sext_i64_i32(segred_group_sizze_216772)) &&\n                ((local_tid_233948 - squot32(local_tid_233948,\n                                             wave_sizze_233950) *\n                  wave_sizze_233950) & (2 * offset_233997 - 1)) == 0) {\n                // read array element\n              ",
            "  {\n                    x_233986 = ((volatile __local\n                                 double *) red_arr_mem_233952)[sext_i32_i64(local_tid_233948 +\n                                                               offset_233997)];\n                    x_233987 = ((volatile __local\n                                 double *) red_arr_mem_233954)[sext_i32_i64(local_tid_233948 +\n                                                               offset_233997)];\n                    x_233988 = ((volatile __local\n                                 double *) red_arr_mem_233956)[sext_i32_i64(local_tid_233948 +\n                                                               offset_233997)];\n                    x_233989 = ((volatile __local\n                                 double *) red_arr_mem_233958)[sext_i32_i64(local_tid_233948 +\n                                                               offset_233997)];\n                    x_233990 = ((volatile __local\n                                 double *) red_arr_mem_233960)[sext_i32_i64(local_tid_233948 +\n                                                               offset_233997)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_233991 = x_233981 + x_233986;\n                    double defunc_1_op_res_233992 = x_233982 + x_233987;\n                    double defunc_1_op_res_233993 = x_233983 + x_233988;\n                    double defunc_1_op_res_233994 = x_233984 + x_233989;\n                    double defunc_1_op_res_233995 = x_233985 + x_233990;\n                    \n                    x_233981 = defunc_1_op_res_233991;\n                    x_233982 = defunc_1_op_res_233992;\n                    x_233983 = defunc_1_op_res_233993;\n                    x_233984 = defunc_1_op_res_233994;\n                    x_233985 = defunc_1_op_res_233995;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n         ",
            "             double *) red_arr_mem_233952)[sext_i32_i64(local_tid_233948)] =\n                        x_233981;\n                    ((volatile __local\n                      double *) red_arr_mem_233954)[sext_i32_i64(local_tid_233948)] =\n                        x_233982;\n                    ((volatile __local\n                      double *) red_arr_mem_233956)[sext_i32_i64(local_tid_233948)] =\n                        x_233983;\n                    ((volatile __local\n                      double *) red_arr_mem_233958)[sext_i32_i64(local_tid_233948)] =\n                        x_233984;\n                    ((volatile __local\n                      double *) red_arr_mem_233960)[sext_i32_i64(local_tid_233948)] =\n                        x_233985;\n                }\n            }\n            offset_233997 *= 2;\n        }\n        while (slt32(skip_waves_233998,\n                     squot32(sext_i64_i32(segred_group_sizze_216772) +\n                             wave_sizze_233950 - 1, wave_sizze_233950))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_233997 = skip_waves_233998 * wave_sizze_233950;\n            if (slt32(local_tid_233948 + offset_233997,\n                      sext_i64_i32(segred_group_sizze_216772)) &&\n                ((local_tid_233948 - squot32(local_tid_233948,\n                                             wave_sizze_233950) *\n                  wave_sizze_233950) == 0 && (squot32(local_tid_233948,\n                                                      wave_sizze_233950) & (2 *\n                                                                            skip_waves_233998 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_233986 = ((__local\n                                 double *) red_arr_mem_233952)[sext_i32_i64(local_tid_233948 +\n                                                               offset_233997)];\n       ",
            "             x_233987 = ((__local\n                                 double *) red_arr_mem_233954)[sext_i32_i64(local_tid_233948 +\n                                                               offset_233997)];\n                    x_233988 = ((__local\n                                 double *) red_arr_mem_233956)[sext_i32_i64(local_tid_233948 +\n                                                               offset_233997)];\n                    x_233989 = ((__local\n                                 double *) red_arr_mem_233958)[sext_i32_i64(local_tid_233948 +\n                                                               offset_233997)];\n                    x_233990 = ((__local\n                                 double *) red_arr_mem_233960)[sext_i32_i64(local_tid_233948 +\n                                                               offset_233997)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_233991 = x_233981 + x_233986;\n                    double defunc_1_op_res_233992 = x_233982 + x_233987;\n                    double defunc_1_op_res_233993 = x_233983 + x_233988;\n                    double defunc_1_op_res_233994 = x_233984 + x_233989;\n                    double defunc_1_op_res_233995 = x_233985 + x_233990;\n                    \n                    x_233981 = defunc_1_op_res_233991;\n                    x_233982 = defunc_1_op_res_233992;\n                    x_233983 = defunc_1_op_res_233993;\n                    x_233984 = defunc_1_op_res_233994;\n                    x_233985 = defunc_1_op_res_233995;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_233952)[sext_i32_i64(local_tid_233948)] =\n                        x_233981;\n                    ((__local\n                      double *) red_arr_mem_233954)[sext_i32_i64(local_tid_233948)] =\n                        x_233982;\n                    ",
            "((__local\n                      double *) red_arr_mem_233956)[sext_i32_i64(local_tid_233948)] =\n                        x_233983;\n                    ((__local\n                      double *) red_arr_mem_233958)[sext_i32_i64(local_tid_233948)] =\n                        x_233984;\n                    ((__local\n                      double *) red_arr_mem_233960)[sext_i32_i64(local_tid_233948)] =\n                        x_233985;\n                }\n            }\n            skip_waves_233998 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_233948) == (int64_t) 0) {\n                x_acc_233975 = x_233981;\n                x_acc_233976 = x_233982;\n                x_acc_233977 = x_233983;\n                x_acc_233978 = x_233984;\n                x_acc_233979 = x_233985;\n            }\n        }\n        if (groups_per_segment_233930 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_233948 == 0) {\n                    ((__global double *) mem_230322)[gtid_216780 *\n                                                     (s_n_m_203636 *\n                                                      n_p_203492) +\n                                                     gtid_216781 *\n                                                     s_n_m_203636 +\n                                                     gtid_216782] =\n                        x_acc_233975;\n                    ((__global double *) mem_230327)[gtid_216780 *\n                                                     (s_n_m_203636 *\n                                                      n_p_203492) +\n                                                     gtid_216781 *\n                                                     s_n_m_203636 +\n                                                     gtid_216782] =\n                        x_acc_233976;\n                    ((_",
            "_global double *) mem_230332)[gtid_216780 *\n                                                     (s_n_m_203636 *\n                                                      n_p_203492) +\n                                                     gtid_216781 *\n                                                     s_n_m_203636 +\n                                                     gtid_216782] =\n                        x_acc_233977;\n                    ((__global double *) mem_230337)[gtid_216780 *\n                                                     (s_n_m_203636 *\n                                                      n_p_203492) +\n                                                     gtid_216781 *\n                                                     s_n_m_203636 +\n                                                     gtid_216782] =\n                        x_acc_233978;\n                    ((__global double *) mem_230342)[gtid_216780 *\n                                                     (s_n_m_203636 *\n                                                      n_p_203492) +\n                                                     gtid_216781 *\n                                                     s_n_m_203636 +\n                                                     gtid_216782] =\n                        x_acc_233979;\n                }\n            }\n        } else {\n            int32_t old_counter_233999;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_233948 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_233935)[sext_i32_i64(virt_group_id_233966)] =\n                        x_acc_233975;\n                    ((__global\n                      double *) segred_tmp_mem_233937)[sext_i32_i64(virt_group_id_233966)] =\n                        x_acc_233976;\n                    ((__global\n                      double *) segred_tmp_mem_233939)[sext_i32_i64(virt_group_id_233966)] =\n      ",
            "                  x_acc_233977;\n                    ((__global\n                      double *) segred_tmp_mem_233941)[sext_i32_i64(virt_group_id_233966)] =\n                        x_acc_233978;\n                    ((__global\n                      double *) segred_tmp_mem_233943)[sext_i32_i64(virt_group_id_233966)] =\n                        x_acc_233979;\n                    mem_fence_global();\n                    old_counter_233999 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_233945)[sext_i32_i64(srem32(flat_segment_id_233967,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_233962)[(int64_t) 0] =\n                        old_counter_233999 == groups_per_segment_233930 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_234000;\n            \n            is_last_group_234000 = ((__local\n                                     bool *) sync_arr_mem_233962)[(int64_t) 0];\n            if (is_last_group_234000) {\n                if (local_tid_233948 == 0) {\n                    old_counter_233999 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_233945)[sext_i32_i64(srem32(flat_segment_id_233967,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_233930));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_234001 =\n            ",
            "                sdiv_up64(groups_per_segment_233930,\n                                      segred_group_sizze_216772);\n                    \n                    x_216785 = 0.0;\n                    x_216786 = 0.0;\n                    x_216787 = 0.0;\n                    x_216788 = 0.0;\n                    x_216789 = 0.0;\n                    for (int64_t i_234002 = 0; i_234002 <\n                         read_per_thread_234001; i_234002++) {\n                        int64_t group_res_id_234003 =\n                                sext_i32_i64(local_tid_233948) *\n                                read_per_thread_234001 + i_234002;\n                        int64_t index_of_group_res_234004 =\n                                sext_i32_i64(flat_segment_id_233967) *\n                                groups_per_segment_233930 + group_res_id_234003;\n                        \n                        if (slt64(group_res_id_234003,\n                                  groups_per_segment_233930)) {\n                            x_216790 = ((__global\n                                         double *) segred_tmp_mem_233935)[index_of_group_res_234004];\n                            x_216791 = ((__global\n                                         double *) segred_tmp_mem_233937)[index_of_group_res_234004];\n                            x_216792 = ((__global\n                                         double *) segred_tmp_mem_233939)[index_of_group_res_234004];\n                            x_216793 = ((__global\n                                         double *) segred_tmp_mem_233941)[index_of_group_res_234004];\n                            x_216794 = ((__global\n                                         double *) segred_tmp_mem_233943)[index_of_group_res_234004];\n                            \n                            double defunc_1_op_res_216795 = x_216785 + x_216790;\n                            double defunc_1_op_res_216796 = x_216786 + x_216791;\n                            double defunc_1_op_res_216797 = x_2167",
            "87 + x_216792;\n                            double defunc_1_op_res_216798 = x_216788 + x_216793;\n                            double defunc_1_op_res_216799 = x_216789 + x_216794;\n                            \n                            x_216785 = defunc_1_op_res_216795;\n                            x_216786 = defunc_1_op_res_216796;\n                            x_216787 = defunc_1_op_res_216797;\n                            x_216788 = defunc_1_op_res_216798;\n                            x_216789 = defunc_1_op_res_216799;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_233952)[sext_i32_i64(local_tid_233948)] =\n                    x_216785;\n                ((__local\n                  double *) red_arr_mem_233954)[sext_i32_i64(local_tid_233948)] =\n                    x_216786;\n                ((__local\n                  double *) red_arr_mem_233956)[sext_i32_i64(local_tid_233948)] =\n                    x_216787;\n                ((__local\n                  double *) red_arr_mem_233958)[sext_i32_i64(local_tid_233948)] =\n                    x_216788;\n                ((__local\n                  double *) red_arr_mem_233960)[sext_i32_i64(local_tid_233948)] =\n                    x_216789;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_234005;\n                    int32_t skip_waves_234006 = 1;\n                    double x_233981;\n                    double x_233982;\n                    double x_233983;\n                    double x_233984;\n                    double x_233985;\n                    double x_233986;\n                    double x_233987;\n                    double x_233988;\n                    double x_233989;\n                    double x_233990;\n                    \n                    offset_234005 = 0;\n                    // participating threads read initial accumulator\n                 ",
            "   {\n                        if (slt32(local_tid_233948,\n                                  sext_i64_i32(segred_group_sizze_216772))) {\n                            x_233981 = ((__local\n                                         double *) red_arr_mem_233952)[sext_i32_i64(local_tid_233948 +\n                                                                       offset_234005)];\n                            x_233982 = ((__local\n                                         double *) red_arr_mem_233954)[sext_i32_i64(local_tid_233948 +\n                                                                       offset_234005)];\n                            x_233983 = ((__local\n                                         double *) red_arr_mem_233956)[sext_i32_i64(local_tid_233948 +\n                                                                       offset_234005)];\n                            x_233984 = ((__local\n                                         double *) red_arr_mem_233958)[sext_i32_i64(local_tid_233948 +\n                                                                       offset_234005)];\n                            x_233985 = ((__local\n                                         double *) red_arr_mem_233960)[sext_i32_i64(local_tid_233948 +\n                                                                       offset_234005)];\n                        }\n                    }\n                    offset_234005 = 1;\n                    while (slt32(offset_234005, wave_sizze_233950)) {\n                        if (slt32(local_tid_233948 + offset_234005,\n                                  sext_i64_i32(segred_group_sizze_216772)) &&\n                            ((local_tid_233948 - squot32(local_tid_233948,\n                                                         wave_sizze_233950) *\n                              wave_sizze_233950) & (2 * offset_234005 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                 ",
            "               x_233986 = ((volatile __local\n                                             double *) red_arr_mem_233952)[sext_i32_i64(local_tid_233948 +\n                                                                           offset_234005)];\n                                x_233987 = ((volatile __local\n                                             double *) red_arr_mem_233954)[sext_i32_i64(local_tid_233948 +\n                                                                           offset_234005)];\n                                x_233988 = ((volatile __local\n                                             double *) red_arr_mem_233956)[sext_i32_i64(local_tid_233948 +\n                                                                           offset_234005)];\n                                x_233989 = ((volatile __local\n                                             double *) red_arr_mem_233958)[sext_i32_i64(local_tid_233948 +\n                                                                           offset_234005)];\n                                x_233990 = ((volatile __local\n                                             double *) red_arr_mem_233960)[sext_i32_i64(local_tid_233948 +\n                                                                           offset_234005)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_233991 = x_233981 +\n                                       x_233986;\n                                double defunc_1_op_res_233992 = x_233982 +\n                                       x_233987;\n                                double defunc_1_op_res_233993 = x_233983 +\n                                       x_233988;\n                                double defunc_1_op_res_233994 = x_233984 +\n                                       x_233989;\n                                double defunc_1_op_res_233995 = x_233985 +\n                        ",
            "               x_233990;\n                                \n                                x_233981 = defunc_1_op_res_233991;\n                                x_233982 = defunc_1_op_res_233992;\n                                x_233983 = defunc_1_op_res_233993;\n                                x_233984 = defunc_1_op_res_233994;\n                                x_233985 = defunc_1_op_res_233995;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_233952)[sext_i32_i64(local_tid_233948)] =\n                                    x_233981;\n                                ((volatile __local\n                                  double *) red_arr_mem_233954)[sext_i32_i64(local_tid_233948)] =\n                                    x_233982;\n                                ((volatile __local\n                                  double *) red_arr_mem_233956)[sext_i32_i64(local_tid_233948)] =\n                                    x_233983;\n                                ((volatile __local\n                                  double *) red_arr_mem_233958)[sext_i32_i64(local_tid_233948)] =\n                                    x_233984;\n                                ((volatile __local\n                                  double *) red_arr_mem_233960)[sext_i32_i64(local_tid_233948)] =\n                                    x_233985;\n                            }\n                        }\n                        offset_234005 *= 2;\n                    }\n                    while (slt32(skip_waves_234006,\n                                 squot32(sext_i64_i32(segred_group_sizze_216772) +\n                                         wave_sizze_233950 - 1,\n                                         wave_sizze_233950))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_234005 = skip_waves_234006 * wave_sizze_23395",
            "0;\n                        if (slt32(local_tid_233948 + offset_234005,\n                                  sext_i64_i32(segred_group_sizze_216772)) &&\n                            ((local_tid_233948 - squot32(local_tid_233948,\n                                                         wave_sizze_233950) *\n                              wave_sizze_233950) == 0 &&\n                             (squot32(local_tid_233948, wave_sizze_233950) &\n                              (2 * skip_waves_234006 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_233986 = ((__local\n                                             double *) red_arr_mem_233952)[sext_i32_i64(local_tid_233948 +\n                                                                           offset_234005)];\n                                x_233987 = ((__local\n                                             double *) red_arr_mem_233954)[sext_i32_i64(local_tid_233948 +\n                                                                           offset_234005)];\n                                x_233988 = ((__local\n                                             double *) red_arr_mem_233956)[sext_i32_i64(local_tid_233948 +\n                                                                           offset_234005)];\n                                x_233989 = ((__local\n                                             double *) red_arr_mem_233958)[sext_i32_i64(local_tid_233948 +\n                                                                           offset_234005)];\n                                x_233990 = ((__local\n                                             double *) red_arr_mem_233960)[sext_i32_i64(local_tid_233948 +\n                                                                           offset_234005)];\n                            }\n                            // apply reduction operation\n                            {\n                                double ",
            "defunc_1_op_res_233991 = x_233981 +\n                                       x_233986;\n                                double defunc_1_op_res_233992 = x_233982 +\n                                       x_233987;\n                                double defunc_1_op_res_233993 = x_233983 +\n                                       x_233988;\n                                double defunc_1_op_res_233994 = x_233984 +\n                                       x_233989;\n                                double defunc_1_op_res_233995 = x_233985 +\n                                       x_233990;\n                                \n                                x_233981 = defunc_1_op_res_233991;\n                                x_233982 = defunc_1_op_res_233992;\n                                x_233983 = defunc_1_op_res_233993;\n                                x_233984 = defunc_1_op_res_233994;\n                                x_233985 = defunc_1_op_res_233995;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_233952)[sext_i32_i64(local_tid_233948)] =\n                                    x_233981;\n                                ((__local\n                                  double *) red_arr_mem_233954)[sext_i32_i64(local_tid_233948)] =\n                                    x_233982;\n                                ((__local\n                                  double *) red_arr_mem_233956)[sext_i32_i64(local_tid_233948)] =\n                                    x_233983;\n                                ((__local\n                                  double *) red_arr_mem_233958)[sext_i32_i64(local_tid_233948)] =\n                                    x_233984;\n                                ((__local\n                                  double *) red_arr_mem_233960)[sext_i32_i64(local_tid_233948)] =\n                                    x_233985;\n    ",
            "                        }\n                        }\n                        skip_waves_234006 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_233948 == 0) {\n                            ((__global double *) mem_230322)[gtid_216780 *\n                                                             (s_n_m_203636 *\n                                                              n_p_203492) +\n                                                             gtid_216781 *\n                                                             s_n_m_203636 +\n                                                             gtid_216782] =\n                                x_233981;\n                            ((__global double *) mem_230327)[gtid_216780 *\n                                                             (s_n_m_203636 *\n                                                              n_p_203492) +\n                                                             gtid_216781 *\n                                                             s_n_m_203636 +\n                                                             gtid_216782] =\n                                x_233982;\n                            ((__global double *) mem_230332)[gtid_216780 *\n                                                             (s_n_m_203636 *\n                                                              n_p_203492) +\n                                                             gtid_216781 *\n                                                             s_n_m_203636 +\n                                                             gtid_216782] =\n                                x_233983;\n                            ((__global double *) mem_230337)[gtid_216780 *\n                                                             (s_n_m_203636 *\n                                                              n_p_203492) +\n                    ",
            "                                         gtid_216781 *\n                                                             s_n_m_203636 +\n                                                             gtid_216782] =\n                                x_233984;\n                            ((__global double *) mem_230342)[gtid_216780 *\n                                                             (s_n_m_203636 *\n                                                              n_p_203492) +\n                                                             gtid_216781 *\n                                                             s_n_m_203636 +\n                                                             gtid_216782] =\n                                x_233985;\n                        }\n                    }\n                }\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_216772\n}\n__kernel void mainzisegred_large_216907(__global int *global_failure,\n                                        uint sync_arr_mem_234076_backing_offset_0,\n                                        uint red_arr_mem_234074_backing_offset_1,\n                                        uint red_arr_mem_234072_backing_offset_2,\n                                        int64_t n_p_203492, int64_t q_s_203493,\n                                        int64_t partition_sizze_203577,\n                                        int64_t defunc_0_f_res_203631,\n                                        int64_t s_n_m_203636,\n                                        int64_t num_groups_216899,\n                                        int64_t groups_per_segment_234056,\n                                        int64_t elements_per_thread_234057,\n                                        int64_t virt_num_groups_234058,\n                                        int64_t threads_per_segment_234060,\n                                        __global unsigned char",
            " *ext_mem_229264,\n                                        __global unsigned char *ext_mem_229265,\n                                        __global unsigned char *ext_mem_229362,\n                                        __global unsigned char *ext_mem_229363,\n                                        __global unsigned char *mem_229526,\n                                        __global unsigned char *mem_229531,\n                                        __global unsigned char *mem_230348,\n                                        __global unsigned char *mem_230353,\n                                        __global unsigned char *mem_230358,\n                                        __global unsigned char *mem_230363,\n                                        __global unsigned char *mem_230368,\n                                        __global unsigned char *mem_230373,\n                                        __global unsigned char *mem_230379,\n                                        __global unsigned char *mem_230384,\n                                        __global\n                                        unsigned char *segred_tmp_mem_234061,\n                                        __global\n                                        unsigned char *segred_tmp_mem_234063,\n                                        __global\n                                        unsigned char *mainzicounter_mem_234065)\n{\n    #define segred_group_sizze_216898 (mainzisegred_group_sizze_215343)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *sync_arr_mem_234076_backing_2 =\n                           &shared_mem[sync_arr_mem_234076_backing_offset_0];\n    volatile unsigned char *red_arr_mem_234074_backing_1 =\n                           &shared_mem[red_arr_mem_234074_backing_offset_1];\n    volatile unsigned char *red_arr_mem_234072_backing_0 =\n                           &shared_mem[red_arr_mem_234072_backing_offset_2];\n    \n    if (*globa",
            "l_failure >= 0)\n        return;\n    \n    int32_t global_tid_234067;\n    int32_t local_tid_234068;\n    int64_t group_sizze_234071;\n    int32_t wave_sizze_234070;\n    int32_t group_tid_234069;\n    \n    global_tid_234067 = get_global_id(0);\n    local_tid_234068 = get_local_id(0);\n    group_sizze_234071 = get_local_size(0);\n    wave_sizze_234070 = LOCKSTEP_WIDTH;\n    group_tid_234069 = get_group_id(0);\n    \n    int32_t phys_tid_216907 = global_tid_234067;\n    __local unsigned char *red_arr_mem_234072;\n    \n    red_arr_mem_234072 = (__local unsigned char *) red_arr_mem_234072_backing_0;\n    \n    __local unsigned char *red_arr_mem_234074;\n    \n    red_arr_mem_234074 = (__local unsigned char *) red_arr_mem_234074_backing_1;\n    \n    __local unsigned char *sync_arr_mem_234076;\n    \n    sync_arr_mem_234076 = (__local\n                           unsigned char *) sync_arr_mem_234076_backing_2;\n    \n    int32_t phys_group_id_234078;\n    \n    phys_group_id_234078 = get_group_id(0);\n    for (int32_t i_234079 = 0; i_234079 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_234058) - phys_group_id_234078,\n                   sext_i64_i32(num_groups_216899)); i_234079++) {\n        int32_t virt_group_id_234080 = phys_group_id_234078 + i_234079 *\n                sext_i64_i32(num_groups_216899);\n        int32_t flat_segment_id_234081 = squot32(virt_group_id_234080,\n                                                 sext_i64_i32(groups_per_segment_234056));\n        int64_t global_tid_234082 = srem64(sext_i32_i64(virt_group_id_234080) *\n                                           segred_group_sizze_216898 +\n                                           sext_i32_i64(local_tid_234068),\n                                           segred_group_sizze_216898 *\n                                           groups_per_segment_234056);\n        int64_t slice_234083 = s_n_m_203636;\n        int64_t slice_234084 = n_p_203492 * slice_234083;\n        int64_t slice_234085 = partition_sizze_203577 * slice_234084;\n   ",
            "     int64_t gtid_216903 = squot64(sext_i32_i64(flat_segment_id_234081),\n                                      slice_234084);\n        int64_t remnant_234086 = sext_i32_i64(flat_segment_id_234081) -\n                gtid_216903 * slice_234084;\n        int64_t gtid_216904 = squot64(remnant_234086, slice_234083);\n        int64_t remnant_234087 = remnant_234086 - gtid_216904 * slice_234083;\n        int64_t gtid_216905 = remnant_234087;\n        int64_t remnant_234088 = remnant_234087 - gtid_216905;\n        int64_t gtid_216906;\n        double x_acc_234089;\n        double x_acc_234090;\n        int64_t chunk_sizze_234091 = smin64(elements_per_thread_234057,\n                                            sdiv_up64(q_s_203493 -\n                                                      global_tid_234082,\n                                                      threads_per_segment_234060));\n        double x_216908;\n        double x_216909;\n        double x_216910;\n        double x_216911;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_234089 = 0.0;\n            x_acc_234090 = 0.0;\n        }\n        for (int64_t i_234098 = 0; i_234098 < chunk_sizze_234091; i_234098++) {\n            gtid_216906 = global_tid_234082 + threads_per_segment_234060 *\n                i_234098;\n            // apply map function\n            {\n                int64_t x_216929;\n                \n                x_216929 = ((__global int64_t *) ext_mem_229264)[gtid_216903 *\n                                                                 n_p_203492 +\n                                                                 gtid_216904];\n                \n                int64_t x_216938;\n                \n                x_216938 = ((__global int64_t *) ext_mem_229363)[gtid_216903 *\n                                                                 (s_n_m_203636 *\n                                                                  n_p_203492) +\n                                                       ",
            "          gtid_216904 *\n                                                                 s_n_m_203636 +\n                                                                 gtid_216905];\n                \n                double x_216939;\n                \n                x_216939 = ((__global double *) ext_mem_229362)[gtid_216903 *\n                                                                (s_n_m_203636 *\n                                                                 n_p_203492) +\n                                                                gtid_216904 *\n                                                                s_n_m_203636 +\n                                                                gtid_216905];\n                \n                double a12_216940;\n                \n                a12_216940 = ((__global double *) mem_230348)[gtid_216903 *\n                                                              (s_n_m_203636 *\n                                                               n_p_203492) +\n                                                              gtid_216904 *\n                                                              s_n_m_203636 +\n                                                              gtid_216905];\n                \n                double b12_216941;\n                \n                b12_216941 = ((__global double *) mem_230353)[gtid_216903 *\n                                                              (s_n_m_203636 *\n                                                               n_p_203492) +\n                                                              gtid_216904 *\n                                                              s_n_m_203636 +\n                                                              gtid_216905];\n                \n                double c12_216942;\n                \n                c12_216942 = ((__global double *) mem_230358)[gtid_216903 *\n                                                              (s_n_m_203636",
            " *\n                                                               n_p_203492) +\n                                                              gtid_216904 *\n                                                              s_n_m_203636 +\n                                                              gtid_216905];\n                \n                double b2_216943;\n                \n                b2_216943 = ((__global double *) mem_230363)[gtid_216903 *\n                                                             (s_n_m_203636 *\n                                                              n_p_203492) +\n                                                             gtid_216904 *\n                                                             s_n_m_203636 +\n                                                             gtid_216905];\n                \n                double c2_216944;\n                \n                c2_216944 = ((__global double *) mem_230368)[gtid_216903 *\n                                                             (s_n_m_203636 *\n                                                              n_p_203492) +\n                                                             gtid_216904 *\n                                                             s_n_m_203636 +\n                                                             gtid_216905];\n                \n                int64_t defunc_0_m_fun_res_216945;\n                \n                defunc_0_m_fun_res_216945 = ((__global\n                                              int64_t *) mem_230373)[gtid_216903 *\n                                                                     (s_n_m_203636 *\n                                                                      n_p_203492) +\n                                                                     gtid_216904 *\n                                                                     s_n_m_203636 +\n                                                                     gtid_216905];\n     ",
            "           \n                bool cond_216947 = sle64(x_216929, gtid_216906);\n                int64_t defunc_0_f_res_216948;\n                \n                if (cond_216947) {\n                    defunc_0_f_res_216948 = (int64_t) 0;\n                } else {\n                    int64_t i_216949 = add64(gtid_216906, x_216938);\n                    int64_t defunc_0_add_arg_216950;\n                    \n                    defunc_0_add_arg_216950 = ((__global\n                                                int64_t *) ext_mem_229265)[gtid_216903 *\n                                                                           (defunc_0_f_res_203631 *\n                                                                            n_p_203492) +\n                                                                           gtid_216904 *\n                                                                           defunc_0_f_res_203631 +\n                                                                           i_216949];\n                    \n                    int64_t defunc_1_add_res_216951 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_216950);\n                    \n                    defunc_0_f_res_216948 = defunc_1_add_res_216951;\n                }\n                \n                double defunc_0_f_res_216952;\n                \n                if (cond_216947) {\n                    defunc_0_f_res_216952 = 0.0;\n                } else {\n                    int64_t i_216953 = add64(gtid_216906, x_216938);\n                    double defunc_0_add_arg_216954;\n                    \n                    defunc_0_add_arg_216954 = ((__global\n                                                double *) mem_229531)[gtid_216903 *\n                                                                      (defunc_0_f_res_203631 *\n                                                                       n_p_203492) +\n                                                 ",
            "                     gtid_216904 *\n                                                                      defunc_0_f_res_203631 +\n                                                                      i_216953];\n                    defunc_0_f_res_216952 = defunc_0_add_arg_216954;\n                }\n                \n                int64_t binop_p_216955 = sub64(defunc_0_f_res_216948,\n                                               defunc_0_m_fun_res_216945);\n                double defunc_0_f_res_216956 = sitofp_i64_f64(binop_p_216955);\n                double abs_res_216957 = fabs(defunc_0_f_res_216956);\n                double tmp1_216958 = abs_res_216957 / x_216939;\n                double x_216959 = tmp1_216958 * tmp1_216958;\n                double y_216960 = tmp1_216958 * x_216959;\n                double tmp2_216961 = 1.0 - y_216960;\n                double x_216962 = tmp2_216961 * tmp2_216961;\n                double tmp3_216963 = tmp2_216961 * x_216962;\n                double tmp4_216964 = defunc_0_f_res_216952 * tmp3_216963;\n                double defunc_1_f_res_216965 = defunc_0_f_res_216956 *\n                       tmp4_216964;\n                double defunc_1_f_res_216966 = defunc_0_f_res_216956 *\n                       defunc_1_f_res_216965;\n                double defunc_0_f_res_216967;\n                \n                if (cond_216947) {\n                    defunc_0_f_res_216967 = 0.0;\n                } else {\n                    int64_t i_216968 = add64(gtid_216906, x_216938);\n                    double defunc_0_add_arg_216969;\n                    \n                    defunc_0_add_arg_216969 = ((__global\n                                                double *) mem_229526)[gtid_216903 *\n                                                                      (defunc_0_f_res_203631 *\n                                                                       n_p_203492) +\n                                                                      gtid_216904 *\n                  ",
            "                                                    defunc_0_f_res_203631 +\n                                                                      i_216968];\n                    defunc_0_f_res_216967 = defunc_0_add_arg_216969;\n                }\n                \n                double x_216970 = a12_216940 * tmp4_216964;\n                double y_216971 = b12_216941 * defunc_1_f_res_216965;\n                double x_216972 = x_216970 + y_216971;\n                double y_216973 = c12_216942 * defunc_1_f_res_216966;\n                double x_216974 = x_216972 + y_216973;\n                double defunc_9_fit_fun_res_216975 = defunc_0_f_res_216967 *\n                       x_216974;\n                double x_216976 = b12_216941 * tmp4_216964;\n                double y_216977 = b2_216943 * defunc_1_f_res_216965;\n                double x_216978 = x_216976 + y_216977;\n                double y_216979 = c2_216944 * defunc_1_f_res_216966;\n                double x_216980 = x_216978 + y_216979;\n                double defunc_9_slope_fun_res_216981 = defunc_0_f_res_216967 *\n                       x_216980;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_216908 = x_acc_234089;\n                    x_216909 = x_acc_234090;\n                }\n                // load new values\n                {\n                    x_216910 = defunc_9_fit_fun_res_216975;\n                    x_216911 = defunc_9_slope_fun_res_216981;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_216912 = x_216908 + x_216910;\n                    double defunc_1_op_res_216913 = x_216909 + x_216911;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_234089 = defunc_1_op_res_216912;\n                        x_acc_234090 = defunc_1_op_res_216913;\n                    }\n                }\n      ",
            "      }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_216908 = x_acc_234089;\n            x_216909 = x_acc_234090;\n            ((__local\n              double *) red_arr_mem_234072)[sext_i32_i64(local_tid_234068)] =\n                x_216908;\n            ((__local\n              double *) red_arr_mem_234074)[sext_i32_i64(local_tid_234068)] =\n                x_216909;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_234099;\n        int32_t skip_waves_234100 = 1;\n        double x_234092;\n        double x_234093;\n        double x_234094;\n        double x_234095;\n        \n        offset_234099 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_234068,\n                      sext_i64_i32(segred_group_sizze_216898))) {\n                x_234092 = ((__local\n                             double *) red_arr_mem_234072)[sext_i32_i64(local_tid_234068 +\n                                                           offset_234099)];\n                x_234093 = ((__local\n                             double *) red_arr_mem_234074)[sext_i32_i64(local_tid_234068 +\n                                                           offset_234099)];\n            }\n        }\n        offset_234099 = 1;\n        while (slt32(offset_234099, wave_sizze_234070)) {\n            if (slt32(local_tid_234068 + offset_234099,\n                      sext_i64_i32(segred_group_sizze_216898)) &&\n                ((local_tid_234068 - squot32(local_tid_234068,\n                                             wave_sizze_234070) *\n                  wave_sizze_234070) & (2 * offset_234099 - 1)) == 0) {\n                // read array element\n                {\n                    x_234094 = ((volatile __local\n                                 double *) red_arr_mem_234072)[sext_i32_i64(local_tid_234068 +\n                                                               offset_234099)];\n                   ",
            " x_234095 = ((volatile __local\n                                 double *) red_arr_mem_234074)[sext_i32_i64(local_tid_234068 +\n                                                               offset_234099)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_234096 = x_234092 + x_234094;\n                    double defunc_1_op_res_234097 = x_234093 + x_234095;\n                    \n                    x_234092 = defunc_1_op_res_234096;\n                    x_234093 = defunc_1_op_res_234097;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_234072)[sext_i32_i64(local_tid_234068)] =\n                        x_234092;\n                    ((volatile __local\n                      double *) red_arr_mem_234074)[sext_i32_i64(local_tid_234068)] =\n                        x_234093;\n                }\n            }\n            offset_234099 *= 2;\n        }\n        while (slt32(skip_waves_234100,\n                     squot32(sext_i64_i32(segred_group_sizze_216898) +\n                             wave_sizze_234070 - 1, wave_sizze_234070))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_234099 = skip_waves_234100 * wave_sizze_234070;\n            if (slt32(local_tid_234068 + offset_234099,\n                      sext_i64_i32(segred_group_sizze_216898)) &&\n                ((local_tid_234068 - squot32(local_tid_234068,\n                                             wave_sizze_234070) *\n                  wave_sizze_234070) == 0 && (squot32(local_tid_234068,\n                                                      wave_sizze_234070) & (2 *\n                                                                            skip_waves_234100 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n       ",
            "             x_234094 = ((__local\n                                 double *) red_arr_mem_234072)[sext_i32_i64(local_tid_234068 +\n                                                               offset_234099)];\n                    x_234095 = ((__local\n                                 double *) red_arr_mem_234074)[sext_i32_i64(local_tid_234068 +\n                                                               offset_234099)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_234096 = x_234092 + x_234094;\n                    double defunc_1_op_res_234097 = x_234093 + x_234095;\n                    \n                    x_234092 = defunc_1_op_res_234096;\n                    x_234093 = defunc_1_op_res_234097;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_234072)[sext_i32_i64(local_tid_234068)] =\n                        x_234092;\n                    ((__local\n                      double *) red_arr_mem_234074)[sext_i32_i64(local_tid_234068)] =\n                        x_234093;\n                }\n            }\n            skip_waves_234100 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_234068) == (int64_t) 0) {\n                x_acc_234089 = x_234092;\n                x_acc_234090 = x_234093;\n            }\n        }\n        if (groups_per_segment_234056 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_234068 == 0) {\n                    ((__global double *) mem_230379)[gtid_216903 *\n                                                     (s_n_m_203636 *\n                                                      n_p_203492) +\n                                                     gtid_216904 *\n                               ",
            "                      s_n_m_203636 +\n                                                     gtid_216905] =\n                        x_acc_234089;\n                    ((__global double *) mem_230384)[gtid_216903 *\n                                                     (s_n_m_203636 *\n                                                      n_p_203492) +\n                                                     gtid_216904 *\n                                                     s_n_m_203636 +\n                                                     gtid_216905] =\n                        x_acc_234090;\n                }\n            }\n        } else {\n            int32_t old_counter_234101;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_234068 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_234061)[sext_i32_i64(virt_group_id_234080)] =\n                        x_acc_234089;\n                    ((__global\n                      double *) segred_tmp_mem_234063)[sext_i32_i64(virt_group_id_234080)] =\n                        x_acc_234090;\n                    mem_fence_global();\n                    old_counter_234101 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_234065)[sext_i32_i64(srem32(flat_segment_id_234081,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_234076)[(int64_t) 0] =\n                        old_counter_234101 == groups_per_segment_234056 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_234102;\n            \n            is_last_group_234102 = ((__local\n                    ",
            "                 bool *) sync_arr_mem_234076)[(int64_t) 0];\n            if (is_last_group_234102) {\n                if (local_tid_234068 == 0) {\n                    old_counter_234101 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_234065)[sext_i32_i64(srem32(flat_segment_id_234081,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_234056));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_234103 =\n                            sdiv_up64(groups_per_segment_234056,\n                                      segred_group_sizze_216898);\n                    \n                    x_216908 = 0.0;\n                    x_216909 = 0.0;\n                    for (int64_t i_234104 = 0; i_234104 <\n                         read_per_thread_234103; i_234104++) {\n                        int64_t group_res_id_234105 =\n                                sext_i32_i64(local_tid_234068) *\n                                read_per_thread_234103 + i_234104;\n                        int64_t index_of_group_res_234106 =\n                                sext_i32_i64(flat_segment_id_234081) *\n                                groups_per_segment_234056 + group_res_id_234105;\n                        \n                        if (slt64(group_res_id_234105,\n                                  groups_per_segment_234056)) {\n                            x_216910 = ((__global\n                                         double *) segred_tmp_mem_234061)[index_of_group_res_234106];\n                            x_216911 = ((__global\n                                         double *) segred_tmp_mem_234063)[index_of_group_res_234106];\n                            \n  ",
            "                          double defunc_1_op_res_216912 = x_216908 + x_216910;\n                            double defunc_1_op_res_216913 = x_216909 + x_216911;\n                            \n                            x_216908 = defunc_1_op_res_216912;\n                            x_216909 = defunc_1_op_res_216913;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_234072)[sext_i32_i64(local_tid_234068)] =\n                    x_216908;\n                ((__local\n                  double *) red_arr_mem_234074)[sext_i32_i64(local_tid_234068)] =\n                    x_216909;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_234107;\n                    int32_t skip_waves_234108 = 1;\n                    double x_234092;\n                    double x_234093;\n                    double x_234094;\n                    double x_234095;\n                    \n                    offset_234107 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_234068,\n                                  sext_i64_i32(segred_group_sizze_216898))) {\n                            x_234092 = ((__local\n                                         double *) red_arr_mem_234072)[sext_i32_i64(local_tid_234068 +\n                                                                       offset_234107)];\n                            x_234093 = ((__local\n                                         double *) red_arr_mem_234074)[sext_i32_i64(local_tid_234068 +\n                                                                       offset_234107)];\n                        }\n                    }\n                    offset_234107 = 1;\n                    while (slt32(offset_234107, wave_sizze_234070)) {\n                        if (slt32(local_tid_234068 + offset_234107,\n  ",
            "                                sext_i64_i32(segred_group_sizze_216898)) &&\n                            ((local_tid_234068 - squot32(local_tid_234068,\n                                                         wave_sizze_234070) *\n                              wave_sizze_234070) & (2 * offset_234107 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_234094 = ((volatile __local\n                                             double *) red_arr_mem_234072)[sext_i32_i64(local_tid_234068 +\n                                                                           offset_234107)];\n                                x_234095 = ((volatile __local\n                                             double *) red_arr_mem_234074)[sext_i32_i64(local_tid_234068 +\n                                                                           offset_234107)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_234096 = x_234092 +\n                                       x_234094;\n                                double defunc_1_op_res_234097 = x_234093 +\n                                       x_234095;\n                                \n                                x_234092 = defunc_1_op_res_234096;\n                                x_234093 = defunc_1_op_res_234097;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_234072)[sext_i32_i64(local_tid_234068)] =\n                                    x_234092;\n                                ((volatile __local\n                                  double *) red_arr_mem_234074)[sext_i32_i64(local_tid_234068)] =\n                                    x_234093;\n                  ",
            "          }\n                        }\n                        offset_234107 *= 2;\n                    }\n                    while (slt32(skip_waves_234108,\n                                 squot32(sext_i64_i32(segred_group_sizze_216898) +\n                                         wave_sizze_234070 - 1,\n                                         wave_sizze_234070))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_234107 = skip_waves_234108 * wave_sizze_234070;\n                        if (slt32(local_tid_234068 + offset_234107,\n                                  sext_i64_i32(segred_group_sizze_216898)) &&\n                            ((local_tid_234068 - squot32(local_tid_234068,\n                                                         wave_sizze_234070) *\n                              wave_sizze_234070) == 0 &&\n                             (squot32(local_tid_234068, wave_sizze_234070) &\n                              (2 * skip_waves_234108 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_234094 = ((__local\n                                             double *) red_arr_mem_234072)[sext_i32_i64(local_tid_234068 +\n                                                                           offset_234107)];\n                                x_234095 = ((__local\n                                             double *) red_arr_mem_234074)[sext_i32_i64(local_tid_234068 +\n                                                                           offset_234107)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_234096 = x_234092 +\n                                       x_234094;\n                                double defunc_1_op_res_234097 = x_234093 +\n                                       x_234095;\n                                \n                 ",
            "               x_234092 = defunc_1_op_res_234096;\n                                x_234093 = defunc_1_op_res_234097;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_234072)[sext_i32_i64(local_tid_234068)] =\n                                    x_234092;\n                                ((__local\n                                  double *) red_arr_mem_234074)[sext_i32_i64(local_tid_234068)] =\n                                    x_234093;\n                            }\n                        }\n                        skip_waves_234108 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_234068 == 0) {\n                            ((__global double *) mem_230379)[gtid_216903 *\n                                                             (s_n_m_203636 *\n                                                              n_p_203492) +\n                                                             gtid_216904 *\n                                                             s_n_m_203636 +\n                                                             gtid_216905] =\n                                x_234092;\n                            ((__global double *) mem_230384)[gtid_216903 *\n                                                             (s_n_m_203636 *\n                                                              n_p_203492) +\n                                                             gtid_216904 *\n                                                             s_n_m_203636 +\n                                                             gtid_216905] =\n                                x_234093;\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_216898\n}\n__kernel void mainzisegred_large_218631(__global int *global_failure,\n                                        uint sync_arr_mem_234269_backing_offset_0,\n                                        uint red_arr_mem_234267_backing_offset_1,\n                                        int64_t n_p_203492,\n                                        int64_t partition_sizze_203577,\n                                        int64_t C_len_203634,\n                                        int64_t num_groups_218626,\n                                        int64_t groups_per_segment_234253,\n                                        int64_t elements_per_thread_234254,\n                                        int64_t virt_num_groups_234255,\n                                        int64_t threads_per_segment_234257,\n                                        __global unsigned char *mem_230500,\n                                        __global unsigned char *mem_230511,\n                                        __global\n                                        unsigned char *segred_tmp_mem_234258,\n                                        __global\n                                        unsigned char *mainzicounter_mem_234260)\n{\n    #define segred_group_sizze_218625 (mainzisegred_group_sizze_218608)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *sync_arr_mem_234269_backing_1 =\n                           &shared_mem[sync_arr_mem_234269_backing_offset_0];\n    volatile unsigned char *red_arr_mem_234267_backing_0 =\n                           &shared_mem[red_arr_mem_234267_backing_offset_1];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234262;\n    int32_t local_tid_234263;\n    int64_t group_sizze_234266;\n    int32_t wave_sizze_234265;\n    int32_t group_tid_234264;\n    \n    global_tid_234262 = get_global_id(0);\n    loc",
            "al_tid_234263 = get_local_id(0);\n    group_sizze_234266 = get_local_size(0);\n    wave_sizze_234265 = LOCKSTEP_WIDTH;\n    group_tid_234264 = get_group_id(0);\n    \n    int32_t phys_tid_218631 = global_tid_234262;\n    __local unsigned char *red_arr_mem_234267;\n    \n    red_arr_mem_234267 = (__local unsigned char *) red_arr_mem_234267_backing_0;\n    \n    __local unsigned char *sync_arr_mem_234269;\n    \n    sync_arr_mem_234269 = (__local\n                           unsigned char *) sync_arr_mem_234269_backing_1;\n    \n    int32_t phys_group_id_234271;\n    \n    phys_group_id_234271 = get_group_id(0);\n    for (int32_t i_234272 = 0; i_234272 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_234255) - phys_group_id_234271,\n                   sext_i64_i32(num_groups_218626)); i_234272++) {\n        int32_t virt_group_id_234273 = phys_group_id_234271 + i_234272 *\n                sext_i64_i32(num_groups_218626);\n        int32_t flat_segment_id_234274 = squot32(virt_group_id_234273,\n                                                 sext_i64_i32(groups_per_segment_234253));\n        int64_t global_tid_234275 = srem64(sext_i32_i64(virt_group_id_234273) *\n                                           segred_group_sizze_218625 +\n                                           sext_i32_i64(local_tid_234263),\n                                           segred_group_sizze_218625 *\n                                           groups_per_segment_234253);\n        int64_t slice_234276 = partition_sizze_203577;\n        int64_t gtid_218629 = sext_i32_i64(flat_segment_id_234274);\n        int64_t remnant_234277 = sext_i32_i64(flat_segment_id_234274) -\n                gtid_218629;\n        int64_t gtid_218630;\n        double x_acc_234278;\n        int64_t chunk_sizze_234279 = smin64(elements_per_thread_234254,\n                                            sdiv_up64(n_p_203492 -\n                                                      global_tid_234275,\n                                                      threads_per",
            "_segment_234257));\n        double x_218632;\n        double x_218633;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_234278 = 0.0;\n        }\n        for (int64_t i_234283 = 0; i_234283 < chunk_sizze_234279; i_234283++) {\n            gtid_218630 = global_tid_234275 + threads_per_segment_234257 *\n                i_234283;\n            // apply map function\n            {\n                double x_218636;\n                \n                x_218636 = ((__global double *) mem_230500)[gtid_218629 *\n                                                            C_len_203634 +\n                                                            gtid_218630];\n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_218632 = x_acc_234278;\n                }\n                // load new values\n                {\n                    x_218633 = x_218636;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_218634 = x_218632 + x_218633;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_234278 = defunc_1_op_res_218634;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_218632 = x_acc_234278;\n            ((__local\n              double *) red_arr_mem_234267)[sext_i32_i64(local_tid_234263)] =\n                x_218632;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_234284;\n        int32_t skip_waves_234285 = 1;\n        double x_234280;\n        double x_234281;\n        \n        offset_234284 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_234263,\n                      sext_i64_i32(segred_group_sizze_218625))) {\n                x_234280 = ((__local\n                 ",
            "            double *) red_arr_mem_234267)[sext_i32_i64(local_tid_234263 +\n                                                           offset_234284)];\n            }\n        }\n        offset_234284 = 1;\n        while (slt32(offset_234284, wave_sizze_234265)) {\n            if (slt32(local_tid_234263 + offset_234284,\n                      sext_i64_i32(segred_group_sizze_218625)) &&\n                ((local_tid_234263 - squot32(local_tid_234263,\n                                             wave_sizze_234265) *\n                  wave_sizze_234265) & (2 * offset_234284 - 1)) == 0) {\n                // read array element\n                {\n                    x_234281 = ((volatile __local\n                                 double *) red_arr_mem_234267)[sext_i32_i64(local_tid_234263 +\n                                                               offset_234284)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_234282 = x_234280 + x_234281;\n                    \n                    x_234280 = defunc_1_op_res_234282;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_234267)[sext_i32_i64(local_tid_234263)] =\n                        x_234280;\n                }\n            }\n            offset_234284 *= 2;\n        }\n        while (slt32(skip_waves_234285,\n                     squot32(sext_i64_i32(segred_group_sizze_218625) +\n                             wave_sizze_234265 - 1, wave_sizze_234265))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_234284 = skip_waves_234285 * wave_sizze_234265;\n            if (slt32(local_tid_234263 + offset_234284,\n                      sext_i64_i32(segred_group_sizze_218625)) &&\n                ((local_tid_234263 - squot32(local_tid_234263,\n                                             wave_sizze_234265) *\n                  wave_sizze_234265) == 0 && (s",
            "quot32(local_tid_234263,\n                                                      wave_sizze_234265) & (2 *\n                                                                            skip_waves_234285 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_234281 = ((__local\n                                 double *) red_arr_mem_234267)[sext_i32_i64(local_tid_234263 +\n                                                               offset_234284)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_234282 = x_234280 + x_234281;\n                    \n                    x_234280 = defunc_1_op_res_234282;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_234267)[sext_i32_i64(local_tid_234263)] =\n                        x_234280;\n                }\n            }\n            skip_waves_234285 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_234263) == (int64_t) 0) {\n                x_acc_234278 = x_234280;\n            }\n        }\n        if (groups_per_segment_234253 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_234263 == 0) {\n                    ((__global double *) mem_230511)[gtid_218629] =\n                        x_acc_234278;\n                }\n            }\n        } else {\n            int32_t old_counter_234286;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_234263 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_234258)[sext_i32_i64(virt_group_id_234273)] =\n   ",
            "                     x_acc_234278;\n                    mem_fence_global();\n                    old_counter_234286 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_234260)[sext_i32_i64(srem32(flat_segment_id_234274,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_234269)[(int64_t) 0] =\n                        old_counter_234286 == groups_per_segment_234253 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_234287;\n            \n            is_last_group_234287 = ((__local\n                                     bool *) sync_arr_mem_234269)[(int64_t) 0];\n            if (is_last_group_234287) {\n                if (local_tid_234263 == 0) {\n                    old_counter_234286 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_234260)[sext_i32_i64(srem32(flat_segment_id_234274,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_234253));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_234288 =\n                            sdiv_up64(groups_per_segment_234253,\n                                      segred_group_sizze_218625);\n                    \n                    x_218632 = 0.0;\n                    for (int64_t i_234289 = 0; i_234289 <\n                         read_per_thread_234288; i_234289++) {\n                        ",
            "int64_t group_res_id_234290 =\n                                sext_i32_i64(local_tid_234263) *\n                                read_per_thread_234288 + i_234289;\n                        int64_t index_of_group_res_234291 =\n                                sext_i32_i64(flat_segment_id_234274) *\n                                groups_per_segment_234253 + group_res_id_234290;\n                        \n                        if (slt64(group_res_id_234290,\n                                  groups_per_segment_234253)) {\n                            x_218633 = ((__global\n                                         double *) segred_tmp_mem_234258)[index_of_group_res_234291];\n                            \n                            double defunc_1_op_res_218634 = x_218632 + x_218633;\n                            \n                            x_218632 = defunc_1_op_res_218634;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_234267)[sext_i32_i64(local_tid_234263)] =\n                    x_218632;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_234292;\n                    int32_t skip_waves_234293 = 1;\n                    double x_234280;\n                    double x_234281;\n                    \n                    offset_234292 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_234263,\n                                  sext_i64_i32(segred_group_sizze_218625))) {\n                            x_234280 = ((__local\n                                         double *) red_arr_mem_234267)[sext_i32_i64(local_tid_234263 +\n                                                                       offset_234292)];\n                        }\n                    }\n                    offset_234292 = 1;\n                    while (slt32(of",
            "fset_234292, wave_sizze_234265)) {\n                        if (slt32(local_tid_234263 + offset_234292,\n                                  sext_i64_i32(segred_group_sizze_218625)) &&\n                            ((local_tid_234263 - squot32(local_tid_234263,\n                                                         wave_sizze_234265) *\n                              wave_sizze_234265) & (2 * offset_234292 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_234281 = ((volatile __local\n                                             double *) red_arr_mem_234267)[sext_i32_i64(local_tid_234263 +\n                                                                           offset_234292)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_234282 = x_234280 +\n                                       x_234281;\n                                \n                                x_234280 = defunc_1_op_res_234282;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_234267)[sext_i32_i64(local_tid_234263)] =\n                                    x_234280;\n                            }\n                        }\n                        offset_234292 *= 2;\n                    }\n                    while (slt32(skip_waves_234293,\n                                 squot32(sext_i64_i32(segred_group_sizze_218625) +\n                                         wave_sizze_234265 - 1,\n                                         wave_sizze_234265))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_234292 = skip_waves_234293 * wave_sizze_234265;\n                        if (slt32(local_ti",
            "d_234263 + offset_234292,\n                                  sext_i64_i32(segred_group_sizze_218625)) &&\n                            ((local_tid_234263 - squot32(local_tid_234263,\n                                                         wave_sizze_234265) *\n                              wave_sizze_234265) == 0 &&\n                             (squot32(local_tid_234263, wave_sizze_234265) &\n                              (2 * skip_waves_234293 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_234281 = ((__local\n                                             double *) red_arr_mem_234267)[sext_i32_i64(local_tid_234263 +\n                                                                           offset_234292)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_234282 = x_234280 +\n                                       x_234281;\n                                \n                                x_234280 = defunc_1_op_res_234282;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_234267)[sext_i32_i64(local_tid_234263)] =\n                                    x_234280;\n                            }\n                        }\n                        skip_waves_234293 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_234263 == 0) {\n                            ((__global double *) mem_230511)[gtid_218629] =\n                                x_234280;\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_218625\n}\n__kernel void mainzisegred_large_218762(__global int *global_failure,\n                                        uint sync_arr_mem_234450_backing_offset_0,\n                                        uint red_arr_mem_234448_backing_offset_1,\n                                        int64_t n_p_203492,\n                                        int64_t partition_sizze_203577,\n                                        int64_t lifted_single_ma_l_arg_204134,\n                                        int64_t num_groups_218757,\n                                        int64_t groups_per_segment_234434,\n                                        int64_t elements_per_thread_234435,\n                                        int64_t virt_num_groups_234436,\n                                        int64_t threads_per_segment_234438,\n                                        __global unsigned char *mem_230517,\n                                        __global unsigned char *mem_230528,\n                                        __global\n                                        unsigned char *segred_tmp_mem_234439,\n                                        __global\n                                        unsigned char *mainzicounter_mem_234441)\n{\n    #define segred_group_sizze_218756 (mainzisegred_group_sizze_218739)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *sync_arr_mem_234450_backing_1 =\n                           &shared_mem[sync_arr_mem_234450_backing_offset_0];\n    volatile unsigned char *red_arr_mem_234448_backing_0 =\n                           &shared_mem[red_arr_mem_234448_backing_offset_1];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234443;\n    int32_t local_tid_234444;\n    int64_t group_sizze_234447;\n    int32_t wave_sizze_234446;\n    int32_t group_tid_234445;\n    \n    global_tid_234443 = get_global_id(0);\n    local_tid_234444 = get_local_id(0",
            ");\n    group_sizze_234447 = get_local_size(0);\n    wave_sizze_234446 = LOCKSTEP_WIDTH;\n    group_tid_234445 = get_group_id(0);\n    \n    int32_t phys_tid_218762 = global_tid_234443;\n    __local unsigned char *red_arr_mem_234448;\n    \n    red_arr_mem_234448 = (__local unsigned char *) red_arr_mem_234448_backing_0;\n    \n    __local unsigned char *sync_arr_mem_234450;\n    \n    sync_arr_mem_234450 = (__local\n                           unsigned char *) sync_arr_mem_234450_backing_1;\n    \n    int32_t phys_group_id_234452;\n    \n    phys_group_id_234452 = get_group_id(0);\n    for (int32_t i_234453 = 0; i_234453 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_234436) - phys_group_id_234452,\n                   sext_i64_i32(num_groups_218757)); i_234453++) {\n        int32_t virt_group_id_234454 = phys_group_id_234452 + i_234453 *\n                sext_i64_i32(num_groups_218757);\n        int32_t flat_segment_id_234455 = squot32(virt_group_id_234454,\n                                                 sext_i64_i32(groups_per_segment_234434));\n        int64_t global_tid_234456 = srem64(sext_i32_i64(virt_group_id_234454) *\n                                           segred_group_sizze_218756 +\n                                           sext_i32_i64(local_tid_234444),\n                                           segred_group_sizze_218756 *\n                                           groups_per_segment_234434);\n        int64_t slice_234457 = partition_sizze_203577;\n        int64_t gtid_218760 = sext_i32_i64(flat_segment_id_234455);\n        int64_t remnant_234458 = sext_i32_i64(flat_segment_id_234455) -\n                gtid_218760;\n        int64_t gtid_218761;\n        double x_acc_234459;\n        int64_t chunk_sizze_234460 = smin64(elements_per_thread_234435,\n                                            sdiv_up64(n_p_203492 -\n                                                      global_tid_234456,\n                                                      threads_per_segment_234438));\n        dou",
            "ble x_218763;\n        double x_218764;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_234459 = 0.0;\n        }\n        for (int64_t i_234464 = 0; i_234464 < chunk_sizze_234460; i_234464++) {\n            gtid_218761 = global_tid_234456 + threads_per_segment_234438 *\n                i_234464;\n            // apply map function\n            {\n                double x_218767;\n                \n                x_218767 = ((__global double *) mem_230517)[gtid_218760 *\n                                                            lifted_single_ma_l_arg_204134 +\n                                                            gtid_218761];\n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_218763 = x_acc_234459;\n                }\n                // load new values\n                {\n                    x_218764 = x_218767;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_218765 = x_218763 + x_218764;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_234459 = defunc_1_op_res_218765;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_218763 = x_acc_234459;\n            ((__local\n              double *) red_arr_mem_234448)[sext_i32_i64(local_tid_234444)] =\n                x_218763;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_234465;\n        int32_t skip_waves_234466 = 1;\n        double x_234461;\n        double x_234462;\n        \n        offset_234465 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_234444,\n                      sext_i64_i32(segred_group_sizze_218756))) {\n                x_234461 = ((__local\n                             d",
            "ouble *) red_arr_mem_234448)[sext_i32_i64(local_tid_234444 +\n                                                           offset_234465)];\n            }\n        }\n        offset_234465 = 1;\n        while (slt32(offset_234465, wave_sizze_234446)) {\n            if (slt32(local_tid_234444 + offset_234465,\n                      sext_i64_i32(segred_group_sizze_218756)) &&\n                ((local_tid_234444 - squot32(local_tid_234444,\n                                             wave_sizze_234446) *\n                  wave_sizze_234446) & (2 * offset_234465 - 1)) == 0) {\n                // read array element\n                {\n                    x_234462 = ((volatile __local\n                                 double *) red_arr_mem_234448)[sext_i32_i64(local_tid_234444 +\n                                                               offset_234465)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_234463 = x_234461 + x_234462;\n                    \n                    x_234461 = defunc_1_op_res_234463;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_234448)[sext_i32_i64(local_tid_234444)] =\n                        x_234461;\n                }\n            }\n            offset_234465 *= 2;\n        }\n        while (slt32(skip_waves_234466,\n                     squot32(sext_i64_i32(segred_group_sizze_218756) +\n                             wave_sizze_234446 - 1, wave_sizze_234446))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_234465 = skip_waves_234466 * wave_sizze_234446;\n            if (slt32(local_tid_234444 + offset_234465,\n                      sext_i64_i32(segred_group_sizze_218756)) &&\n                ((local_tid_234444 - squot32(local_tid_234444,\n                                             wave_sizze_234446) *\n                  wave_sizze_234446) == 0 && (squot32(local_",
            "tid_234444,\n                                                      wave_sizze_234446) & (2 *\n                                                                            skip_waves_234466 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_234462 = ((__local\n                                 double *) red_arr_mem_234448)[sext_i32_i64(local_tid_234444 +\n                                                               offset_234465)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_234463 = x_234461 + x_234462;\n                    \n                    x_234461 = defunc_1_op_res_234463;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_234448)[sext_i32_i64(local_tid_234444)] =\n                        x_234461;\n                }\n            }\n            skip_waves_234466 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_234444) == (int64_t) 0) {\n                x_acc_234459 = x_234461;\n            }\n        }\n        if (groups_per_segment_234434 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_234444 == 0) {\n                    ((__global double *) mem_230528)[gtid_218760] =\n                        x_acc_234459;\n                }\n            }\n        } else {\n            int32_t old_counter_234467;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_234444 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_234439)[sext_i32_i64(virt_group_id_234454)] =\n                ",
            "        x_acc_234459;\n                    mem_fence_global();\n                    old_counter_234467 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_234441)[sext_i32_i64(srem32(flat_segment_id_234455,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_234450)[(int64_t) 0] =\n                        old_counter_234467 == groups_per_segment_234434 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_234468;\n            \n            is_last_group_234468 = ((__local\n                                     bool *) sync_arr_mem_234450)[(int64_t) 0];\n            if (is_last_group_234468) {\n                if (local_tid_234444 == 0) {\n                    old_counter_234467 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_234441)[sext_i32_i64(srem32(flat_segment_id_234455,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_234434));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_234469 =\n                            sdiv_up64(groups_per_segment_234434,\n                                      segred_group_sizze_218756);\n                    \n                    x_218763 = 0.0;\n                    for (int64_t i_234470 = 0; i_234470 <\n                         read_per_thread_234469; i_234470++) {\n                        int64_t group",
            "_res_id_234471 =\n                                sext_i32_i64(local_tid_234444) *\n                                read_per_thread_234469 + i_234470;\n                        int64_t index_of_group_res_234472 =\n                                sext_i32_i64(flat_segment_id_234455) *\n                                groups_per_segment_234434 + group_res_id_234471;\n                        \n                        if (slt64(group_res_id_234471,\n                                  groups_per_segment_234434)) {\n                            x_218764 = ((__global\n                                         double *) segred_tmp_mem_234439)[index_of_group_res_234472];\n                            \n                            double defunc_1_op_res_218765 = x_218763 + x_218764;\n                            \n                            x_218763 = defunc_1_op_res_218765;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_234448)[sext_i32_i64(local_tid_234444)] =\n                    x_218763;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_234473;\n                    int32_t skip_waves_234474 = 1;\n                    double x_234461;\n                    double x_234462;\n                    \n                    offset_234473 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_234444,\n                                  sext_i64_i32(segred_group_sizze_218756))) {\n                            x_234461 = ((__local\n                                         double *) red_arr_mem_234448)[sext_i32_i64(local_tid_234444 +\n                                                                       offset_234473)];\n                        }\n                    }\n                    offset_234473 = 1;\n                    while (slt32(offset_234473, ",
            "wave_sizze_234446)) {\n                        if (slt32(local_tid_234444 + offset_234473,\n                                  sext_i64_i32(segred_group_sizze_218756)) &&\n                            ((local_tid_234444 - squot32(local_tid_234444,\n                                                         wave_sizze_234446) *\n                              wave_sizze_234446) & (2 * offset_234473 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_234462 = ((volatile __local\n                                             double *) red_arr_mem_234448)[sext_i32_i64(local_tid_234444 +\n                                                                           offset_234473)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_234463 = x_234461 +\n                                       x_234462;\n                                \n                                x_234461 = defunc_1_op_res_234463;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_234448)[sext_i32_i64(local_tid_234444)] =\n                                    x_234461;\n                            }\n                        }\n                        offset_234473 *= 2;\n                    }\n                    while (slt32(skip_waves_234474,\n                                 squot32(sext_i64_i32(segred_group_sizze_218756) +\n                                         wave_sizze_234446 - 1,\n                                         wave_sizze_234446))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_234473 = skip_waves_234474 * wave_sizze_234446;\n                        if (slt32(local_tid_234444 + of",
            "fset_234473,\n                                  sext_i64_i32(segred_group_sizze_218756)) &&\n                            ((local_tid_234444 - squot32(local_tid_234444,\n                                                         wave_sizze_234446) *\n                              wave_sizze_234446) == 0 &&\n                             (squot32(local_tid_234444, wave_sizze_234446) &\n                              (2 * skip_waves_234474 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_234462 = ((__local\n                                             double *) red_arr_mem_234448)[sext_i32_i64(local_tid_234444 +\n                                                                           offset_234473)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_234463 = x_234461 +\n                                       x_234462;\n                                \n                                x_234461 = defunc_1_op_res_234463;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_234448)[sext_i32_i64(local_tid_234444)] =\n                                    x_234461;\n                            }\n                        }\n                        skip_waves_234474 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_234444 == 0) {\n                            ((__global double *) mem_230528)[gtid_218760] =\n                                x_234461;\n                        }\n                    }\n                }\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef",
            " segred_group_sizze_218756\n}\n__kernel void mainzisegred_large_218893(__global int *global_failure,\n                                        uint sync_arr_mem_234631_backing_offset_0,\n                                        uint red_arr_mem_234629_backing_offset_1,\n                                        int64_t partition_sizze_203577,\n                                        int64_t dyn_lifted_single_ma_l_arg_204144,\n                                        int64_t num_groups_218888,\n                                        int64_t groups_per_segment_234615,\n                                        int64_t elements_per_thread_234616,\n                                        int64_t virt_num_groups_234617,\n                                        int64_t threads_per_segment_234619,\n                                        __global unsigned char *mem_230534,\n                                        __global unsigned char *mem_230545,\n                                        __global\n                                        unsigned char *segred_tmp_mem_234620,\n                                        __global\n                                        unsigned char *mainzicounter_mem_234622)\n{\n    #define segred_group_sizze_218887 (mainzisegred_group_sizze_218870)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *sync_arr_mem_234631_backing_1 =\n                           &shared_mem[sync_arr_mem_234631_backing_offset_0];\n    volatile unsigned char *red_arr_mem_234629_backing_0 =\n                           &shared_mem[red_arr_mem_234629_backing_offset_1];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234624;\n    int32_t local_tid_234625;\n    int64_t group_sizze_234628;\n    int32_t wave_sizze_234627;\n    int32_t group_tid_234626;\n    \n    global_tid_234624 = get_global_id(0);\n    local_tid_234625 = get_local_id(0);\n    group_sizze_234628 = get_local_size(0);\n    wave_sizze_234627 ",
            "= LOCKSTEP_WIDTH;\n    group_tid_234626 = get_group_id(0);\n    \n    int32_t phys_tid_218893 = global_tid_234624;\n    __local unsigned char *red_arr_mem_234629;\n    \n    red_arr_mem_234629 = (__local unsigned char *) red_arr_mem_234629_backing_0;\n    \n    __local unsigned char *sync_arr_mem_234631;\n    \n    sync_arr_mem_234631 = (__local\n                           unsigned char *) sync_arr_mem_234631_backing_1;\n    \n    int32_t phys_group_id_234633;\n    \n    phys_group_id_234633 = get_group_id(0);\n    for (int32_t i_234634 = 0; i_234634 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_234617) - phys_group_id_234633,\n                   sext_i64_i32(num_groups_218888)); i_234634++) {\n        int32_t virt_group_id_234635 = phys_group_id_234633 + i_234634 *\n                sext_i64_i32(num_groups_218888);\n        int32_t flat_segment_id_234636 = squot32(virt_group_id_234635,\n                                                 sext_i64_i32(groups_per_segment_234615));\n        int64_t global_tid_234637 = srem64(sext_i32_i64(virt_group_id_234635) *\n                                           segred_group_sizze_218887 +\n                                           sext_i32_i64(local_tid_234625),\n                                           segred_group_sizze_218887 *\n                                           groups_per_segment_234615);\n        int64_t slice_234638 = partition_sizze_203577;\n        int64_t gtid_218891 = sext_i32_i64(flat_segment_id_234636);\n        int64_t remnant_234639 = sext_i32_i64(flat_segment_id_234636) -\n                gtid_218891;\n        int64_t gtid_218892;\n        double x_acc_234640;\n        int64_t chunk_sizze_234641 = smin64(elements_per_thread_234616,\n                                            sdiv_up64((int64_t) 3 -\n                                                      global_tid_234637,\n                                                      threads_per_segment_234619));\n        double x_218894;\n        double x_218895;\n        \n        // neutral-i",
            "nitialise the accumulators\n        {\n            x_acc_234640 = 0.0;\n        }\n        for (int64_t i_234645 = 0; i_234645 < chunk_sizze_234641; i_234645++) {\n            gtid_218892 = global_tid_234637 + threads_per_segment_234619 *\n                i_234645;\n            // apply map function\n            {\n                double x_218898;\n                \n                x_218898 = ((__global double *) mem_230534)[gtid_218891 *\n                                                            dyn_lifted_single_ma_l_arg_204144 +\n                                                            gtid_218892];\n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_218894 = x_acc_234640;\n                }\n                // load new values\n                {\n                    x_218895 = x_218898;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_218896 = x_218894 + x_218895;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_234640 = defunc_1_op_res_218896;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_218894 = x_acc_234640;\n            ((__local\n              double *) red_arr_mem_234629)[sext_i32_i64(local_tid_234625)] =\n                x_218894;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_234646;\n        int32_t skip_waves_234647 = 1;\n        double x_234642;\n        double x_234643;\n        \n        offset_234646 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_234625,\n                      sext_i64_i32(segred_group_sizze_218887))) {\n                x_234642 = ((__local\n                             double *) red_arr_mem_234629)[sext_i32_i64(local_tid_234625 +\n   ",
            "                                                        offset_234646)];\n            }\n        }\n        offset_234646 = 1;\n        while (slt32(offset_234646, wave_sizze_234627)) {\n            if (slt32(local_tid_234625 + offset_234646,\n                      sext_i64_i32(segred_group_sizze_218887)) &&\n                ((local_tid_234625 - squot32(local_tid_234625,\n                                             wave_sizze_234627) *\n                  wave_sizze_234627) & (2 * offset_234646 - 1)) == 0) {\n                // read array element\n                {\n                    x_234643 = ((volatile __local\n                                 double *) red_arr_mem_234629)[sext_i32_i64(local_tid_234625 +\n                                                               offset_234646)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_234644 = x_234642 + x_234643;\n                    \n                    x_234642 = defunc_1_op_res_234644;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_234629)[sext_i32_i64(local_tid_234625)] =\n                        x_234642;\n                }\n            }\n            offset_234646 *= 2;\n        }\n        while (slt32(skip_waves_234647,\n                     squot32(sext_i64_i32(segred_group_sizze_218887) +\n                             wave_sizze_234627 - 1, wave_sizze_234627))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_234646 = skip_waves_234647 * wave_sizze_234627;\n            if (slt32(local_tid_234625 + offset_234646,\n                      sext_i64_i32(segred_group_sizze_218887)) &&\n                ((local_tid_234625 - squot32(local_tid_234625,\n                                             wave_sizze_234627) *\n                  wave_sizze_234627) == 0 && (squot32(local_tid_234625,\n                                                    ",
            "  wave_sizze_234627) & (2 *\n                                                                            skip_waves_234647 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_234643 = ((__local\n                                 double *) red_arr_mem_234629)[sext_i32_i64(local_tid_234625 +\n                                                               offset_234646)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_234644 = x_234642 + x_234643;\n                    \n                    x_234642 = defunc_1_op_res_234644;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_234629)[sext_i32_i64(local_tid_234625)] =\n                        x_234642;\n                }\n            }\n            skip_waves_234647 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_234625) == (int64_t) 0) {\n                x_acc_234640 = x_234642;\n            }\n        }\n        if (groups_per_segment_234615 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_234625 == 0) {\n                    ((__global double *) mem_230545)[gtid_218891] =\n                        x_acc_234640;\n                }\n            }\n        } else {\n            int32_t old_counter_234648;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_234625 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_234620)[sext_i32_i64(virt_group_id_234635)] =\n                        x_acc_234640;\n                    mem_fence_global();\n  ",
            "                  old_counter_234648 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_234622)[sext_i32_i64(srem32(flat_segment_id_234636,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_234631)[(int64_t) 0] =\n                        old_counter_234648 == groups_per_segment_234615 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_234649;\n            \n            is_last_group_234649 = ((__local\n                                     bool *) sync_arr_mem_234631)[(int64_t) 0];\n            if (is_last_group_234649) {\n                if (local_tid_234625 == 0) {\n                    old_counter_234648 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_234622)[sext_i32_i64(srem32(flat_segment_id_234636,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_234615));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_234650 =\n                            sdiv_up64(groups_per_segment_234615,\n                                      segred_group_sizze_218887);\n                    \n                    x_218894 = 0.0;\n                    for (int64_t i_234651 = 0; i_234651 <\n                         read_per_thread_234650; i_234651++) {\n                        int64_t group_res_id_234652 =\n                                sext_i32_i64(lo",
            "cal_tid_234625) *\n                                read_per_thread_234650 + i_234651;\n                        int64_t index_of_group_res_234653 =\n                                sext_i32_i64(flat_segment_id_234636) *\n                                groups_per_segment_234615 + group_res_id_234652;\n                        \n                        if (slt64(group_res_id_234652,\n                                  groups_per_segment_234615)) {\n                            x_218895 = ((__global\n                                         double *) segred_tmp_mem_234620)[index_of_group_res_234653];\n                            \n                            double defunc_1_op_res_218896 = x_218894 + x_218895;\n                            \n                            x_218894 = defunc_1_op_res_218896;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_234629)[sext_i32_i64(local_tid_234625)] =\n                    x_218894;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_234654;\n                    int32_t skip_waves_234655 = 1;\n                    double x_234642;\n                    double x_234643;\n                    \n                    offset_234654 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_234625,\n                                  sext_i64_i32(segred_group_sizze_218887))) {\n                            x_234642 = ((__local\n                                         double *) red_arr_mem_234629)[sext_i32_i64(local_tid_234625 +\n                                                                       offset_234654)];\n                        }\n                    }\n                    offset_234654 = 1;\n                    while (slt32(offset_234654, wave_sizze_234627)) {\n                        if (slt32(local_ti",
            "d_234625 + offset_234654,\n                                  sext_i64_i32(segred_group_sizze_218887)) &&\n                            ((local_tid_234625 - squot32(local_tid_234625,\n                                                         wave_sizze_234627) *\n                              wave_sizze_234627) & (2 * offset_234654 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_234643 = ((volatile __local\n                                             double *) red_arr_mem_234629)[sext_i32_i64(local_tid_234625 +\n                                                                           offset_234654)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_234644 = x_234642 +\n                                       x_234643;\n                                \n                                x_234642 = defunc_1_op_res_234644;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_234629)[sext_i32_i64(local_tid_234625)] =\n                                    x_234642;\n                            }\n                        }\n                        offset_234654 *= 2;\n                    }\n                    while (slt32(skip_waves_234655,\n                                 squot32(sext_i64_i32(segred_group_sizze_218887) +\n                                         wave_sizze_234627 - 1,\n                                         wave_sizze_234627))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_234654 = skip_waves_234655 * wave_sizze_234627;\n                        if (slt32(local_tid_234625 + offset_234654,\n                                  sext_i64_i32(segr",
            "ed_group_sizze_218887)) &&\n                            ((local_tid_234625 - squot32(local_tid_234625,\n                                                         wave_sizze_234627) *\n                              wave_sizze_234627) == 0 &&\n                             (squot32(local_tid_234625, wave_sizze_234627) &\n                              (2 * skip_waves_234655 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_234643 = ((__local\n                                             double *) red_arr_mem_234629)[sext_i32_i64(local_tid_234625 +\n                                                                           offset_234654)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_234644 = x_234642 +\n                                       x_234643;\n                                \n                                x_234642 = defunc_1_op_res_234644;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_234629)[sext_i32_i64(local_tid_234625)] =\n                                    x_234642;\n                            }\n                        }\n                        skip_waves_234655 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_234625 == 0) {\n                            ((__global double *) mem_230545)[gtid_218891] =\n                                x_234642;\n                        }\n                    }\n                }\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_218887\n}\n__kernel void mainzisegred_large_21",
            "9515(__global int *global_failure,\n                                        uint sync_arr_mem_234848_backing_offset_0,\n                                        uint red_arr_mem_234846_backing_offset_1,\n                                        int64_t n_203490, int64_t q_l_203495,\n                                        int64_t jump_t_203500,\n                                        int64_t partition_sizze_203577,\n                                        int64_t l_n_m_203643, int64_t i_203670,\n                                        int64_t num_groups_219509,\n                                        int64_t ctx_param_ext_229488,\n                                        int64_t ctx_param_ext_229489,\n                                        int64_t ctx_param_ext_229491,\n                                        int64_t groups_per_segment_234832,\n                                        int64_t elements_per_thread_234833,\n                                        int64_t virt_num_groups_234834,\n                                        int64_t threads_per_segment_234836,\n                                        __global unsigned char *ext_mem_229411,\n                                        __global unsigned char *ext_mem_229412,\n                                        __global\n                                        unsigned char *mem_param_229493,\n                                        __global unsigned char *mem_230596,\n                                        __global\n                                        unsigned char *segred_tmp_mem_234837,\n                                        __global\n                                        unsigned char *mainzicounter_mem_234839)\n{\n    #define segred_group_sizze_219508 (mainzisegred_group_sizze_219260)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *sync_arr_mem_234848_backing_1 =\n                           &shared_mem[sync_arr_mem_234848_backing_offset_0];\n    volat",
            "ile unsigned char *red_arr_mem_234846_backing_0 =\n                           &shared_mem[red_arr_mem_234846_backing_offset_1];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234841;\n    int32_t local_tid_234842;\n    int64_t group_sizze_234845;\n    int32_t wave_sizze_234844;\n    int32_t group_tid_234843;\n    \n    global_tid_234841 = get_global_id(0);\n    local_tid_234842 = get_local_id(0);\n    group_sizze_234845 = get_local_size(0);\n    wave_sizze_234844 = LOCKSTEP_WIDTH;\n    group_tid_234843 = get_group_id(0);\n    \n    int32_t phys_tid_219515 = global_tid_234841;\n    __local unsigned char *red_arr_mem_234846;\n    \n    red_arr_mem_234846 = (__local unsigned char *) red_arr_mem_234846_backing_0;\n    \n    __local unsigned char *sync_arr_mem_234848;\n    \n    sync_arr_mem_234848 = (__local\n                           unsigned char *) sync_arr_mem_234848_backing_1;\n    \n    int32_t phys_group_id_234850;\n    \n    phys_group_id_234850 = get_group_id(0);\n    for (int32_t i_234851 = 0; i_234851 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_234834) - phys_group_id_234850,\n                   sext_i64_i32(num_groups_219509)); i_234851++) {\n        int32_t virt_group_id_234852 = phys_group_id_234850 + i_234851 *\n                sext_i64_i32(num_groups_219509);\n        int32_t flat_segment_id_234853 = squot32(virt_group_id_234852,\n                                                 sext_i64_i32(groups_per_segment_234832));\n        int64_t global_tid_234854 = srem64(sext_i32_i64(virt_group_id_234852) *\n                                           segred_group_sizze_219508 +\n                                           sext_i32_i64(local_tid_234842),\n                                           segred_group_sizze_219508 *\n                                           groups_per_segment_234832);\n        int64_t slice_234855 = l_n_m_203643;\n        int64_t slice_234856 = partition_sizze_203577 * slice_234855;\n        int64_t gtid_219512 = squot64(sext_i32_i64(fl",
            "at_segment_id_234853),\n                                      slice_234855);\n        int64_t remnant_234857 = sext_i32_i64(flat_segment_id_234853) -\n                gtid_219512 * slice_234855;\n        int64_t gtid_219513 = remnant_234857;\n        int64_t remnant_234858 = remnant_234857 - gtid_219513;\n        int64_t gtid_219514;\n        double x_acc_234859;\n        int64_t chunk_sizze_234860 = smin64(elements_per_thread_234833,\n                                            sdiv_up64(q_l_203495 -\n                                                      global_tid_234854,\n                                                      threads_per_segment_234836));\n        double x_219516;\n        double x_219517;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_234859 = 0.0;\n        }\n        for (int64_t i_234864 = 0; i_234864 < chunk_sizze_234860; i_234864++) {\n            gtid_219514 = global_tid_234854 + threads_per_segment_234836 *\n                i_234864;\n            // apply map function\n            {\n                int64_t x_219523;\n                \n                x_219523 = ((__global int64_t *) ext_mem_229412)[gtid_219512 *\n                                                                 l_n_m_203643 +\n                                                                 gtid_219513];\n                \n                double x_219524;\n                \n                x_219524 = ((__global double *) ext_mem_229411)[gtid_219512 *\n                                                                l_n_m_203643 +\n                                                                gtid_219513];\n                \n                int64_t binop_y_228694 = mul64(jump_t_203500, gtid_219513);\n                int64_t binop_y_228695 = smin64(i_203670, binop_y_228694);\n                int64_t index_primexp_228696 = add64((int64_t) 1,\n                                                     binop_y_228695);\n                bool cond_219527 = sle64(n_203490, gtid_219514)",
            ";\n                int64_t defunc_0_f_res_219528;\n                \n                if (cond_219527) {\n                    defunc_0_f_res_219528 = (int64_t) 0;\n                } else {\n                    int64_t i_219529 = add64(gtid_219514, x_219523);\n                    int64_t defunc_1_add_res_219530 = add64((int64_t) 1,\n                                                            i_219529);\n                    \n                    defunc_0_f_res_219528 = defunc_1_add_res_219530;\n                }\n                \n                double defunc_0_f_res_219531;\n                \n                if (cond_219527) {\n                    defunc_0_f_res_219531 = 0.0;\n                } else {\n                    int64_t i_219532 = add64(gtid_219514, x_219523);\n                    double defunc_0_add_arg_219533;\n                    \n                    defunc_0_add_arg_219533 = ((__global\n                                                double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                                            (gtid_219512 *\n                                                                             ctx_param_ext_229489 +\n                                                                             i_219532 *\n                                                                             ctx_param_ext_229491)];\n                    defunc_0_f_res_219531 = defunc_0_add_arg_219533;\n                }\n                \n                int64_t binop_p_219534 = sub64(defunc_0_f_res_219528,\n                                               index_primexp_228696);\n                double defunc_0_f_res_219535 = sitofp_i64_f64(binop_p_219534);\n                double abs_res_219536 = fabs(defunc_0_f_res_219535);\n                double tmp1_219537 = abs_res_219536 / x_219524;\n                double x_219538 = tmp1_219537 * tmp1_219537;\n                double y_219539 = tmp1_219537 * x_219538;\n                double tmp2_219540 = 1.0 - y_219539;\n ",
            "               double x_219541 = tmp2_219540 * tmp2_219540;\n                double tmp3_219542 = tmp2_219540 * x_219541;\n                double w_j_219543 = defunc_0_f_res_219531 * tmp3_219542;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_219516 = x_acc_234859;\n                }\n                // load new values\n                {\n                    x_219517 = w_j_219543;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_219518 = x_219516 + x_219517;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_234859 = defunc_1_op_res_219518;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_219516 = x_acc_234859;\n            ((__local\n              double *) red_arr_mem_234846)[sext_i32_i64(local_tid_234842)] =\n                x_219516;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_234865;\n        int32_t skip_waves_234866 = 1;\n        double x_234861;\n        double x_234862;\n        \n        offset_234865 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_234842,\n                      sext_i64_i32(segred_group_sizze_219508))) {\n                x_234861 = ((__local\n                             double *) red_arr_mem_234846)[sext_i32_i64(local_tid_234842 +\n                                                           offset_234865)];\n            }\n        }\n        offset_234865 = 1;\n        while (slt32(offset_234865, wave_sizze_234844)) {\n            if (slt32(local_tid_234842 + offset_234865,\n                      sext_i64_i32(segred_group_sizze_219508)) &&\n                ((local_tid_234842 - squot32(local_tid_234842,\n                      ",
            "                       wave_sizze_234844) *\n                  wave_sizze_234844) & (2 * offset_234865 - 1)) == 0) {\n                // read array element\n                {\n                    x_234862 = ((volatile __local\n                                 double *) red_arr_mem_234846)[sext_i32_i64(local_tid_234842 +\n                                                               offset_234865)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_234863 = x_234861 + x_234862;\n                    \n                    x_234861 = defunc_1_op_res_234863;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_234846)[sext_i32_i64(local_tid_234842)] =\n                        x_234861;\n                }\n            }\n            offset_234865 *= 2;\n        }\n        while (slt32(skip_waves_234866,\n                     squot32(sext_i64_i32(segred_group_sizze_219508) +\n                             wave_sizze_234844 - 1, wave_sizze_234844))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_234865 = skip_waves_234866 * wave_sizze_234844;\n            if (slt32(local_tid_234842 + offset_234865,\n                      sext_i64_i32(segred_group_sizze_219508)) &&\n                ((local_tid_234842 - squot32(local_tid_234842,\n                                             wave_sizze_234844) *\n                  wave_sizze_234844) == 0 && (squot32(local_tid_234842,\n                                                      wave_sizze_234844) & (2 *\n                                                                            skip_waves_234866 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_234862 = ((__local\n                                 double *) red_arr_mem_234846)",
            "[sext_i32_i64(local_tid_234842 +\n                                                               offset_234865)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_234863 = x_234861 + x_234862;\n                    \n                    x_234861 = defunc_1_op_res_234863;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_234846)[sext_i32_i64(local_tid_234842)] =\n                        x_234861;\n                }\n            }\n            skip_waves_234866 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_234842) == (int64_t) 0) {\n                x_acc_234859 = x_234861;\n            }\n        }\n        if (groups_per_segment_234832 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_234842 == 0) {\n                    ((__global double *) mem_230596)[gtid_219512 *\n                                                     l_n_m_203643 +\n                                                     gtid_219513] =\n                        x_acc_234859;\n                }\n            }\n        } else {\n            int32_t old_counter_234867;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_234842 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_234837)[sext_i32_i64(virt_group_id_234852)] =\n                        x_acc_234859;\n                    mem_fence_global();\n                    old_counter_234867 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_234839)[sext_i32_i64(srem32(flat_segment_id_234853,\n                      ",
            "                                                                                10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_234848)[(int64_t) 0] =\n                        old_counter_234867 == groups_per_segment_234832 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_234868;\n            \n            is_last_group_234868 = ((__local\n                                     bool *) sync_arr_mem_234848)[(int64_t) 0];\n            if (is_last_group_234868) {\n                if (local_tid_234842 == 0) {\n                    old_counter_234867 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_234839)[sext_i32_i64(srem32(flat_segment_id_234853,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_234832));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_234869 =\n                            sdiv_up64(groups_per_segment_234832,\n                                      segred_group_sizze_219508);\n                    \n                    x_219516 = 0.0;\n                    for (int64_t i_234870 = 0; i_234870 <\n                         read_per_thread_234869; i_234870++) {\n                        int64_t group_res_id_234871 =\n                                sext_i32_i64(local_tid_234842) *\n                                read_per_thread_234869 + i_234870;\n                        int64_t index_of_group_res_234872 =\n                                sext_i32_i64(flat_segment_id_234853) *\n                                groups",
            "_per_segment_234832 + group_res_id_234871;\n                        \n                        if (slt64(group_res_id_234871,\n                                  groups_per_segment_234832)) {\n                            x_219517 = ((__global\n                                         double *) segred_tmp_mem_234837)[index_of_group_res_234872];\n                            \n                            double defunc_1_op_res_219518 = x_219516 + x_219517;\n                            \n                            x_219516 = defunc_1_op_res_219518;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_234846)[sext_i32_i64(local_tid_234842)] =\n                    x_219516;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_234873;\n                    int32_t skip_waves_234874 = 1;\n                    double x_234861;\n                    double x_234862;\n                    \n                    offset_234873 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_234842,\n                                  sext_i64_i32(segred_group_sizze_219508))) {\n                            x_234861 = ((__local\n                                         double *) red_arr_mem_234846)[sext_i32_i64(local_tid_234842 +\n                                                                       offset_234873)];\n                        }\n                    }\n                    offset_234873 = 1;\n                    while (slt32(offset_234873, wave_sizze_234844)) {\n                        if (slt32(local_tid_234842 + offset_234873,\n                                  sext_i64_i32(segred_group_sizze_219508)) &&\n                            ((local_tid_234842 - squot32(local_tid_234842,\n                                                         wave_sizze_234844)",
            " *\n                              wave_sizze_234844) & (2 * offset_234873 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_234862 = ((volatile __local\n                                             double *) red_arr_mem_234846)[sext_i32_i64(local_tid_234842 +\n                                                                           offset_234873)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_234863 = x_234861 +\n                                       x_234862;\n                                \n                                x_234861 = defunc_1_op_res_234863;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_234846)[sext_i32_i64(local_tid_234842)] =\n                                    x_234861;\n                            }\n                        }\n                        offset_234873 *= 2;\n                    }\n                    while (slt32(skip_waves_234874,\n                                 squot32(sext_i64_i32(segred_group_sizze_219508) +\n                                         wave_sizze_234844 - 1,\n                                         wave_sizze_234844))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_234873 = skip_waves_234874 * wave_sizze_234844;\n                        if (slt32(local_tid_234842 + offset_234873,\n                                  sext_i64_i32(segred_group_sizze_219508)) &&\n                            ((local_tid_234842 - squot32(local_tid_234842,\n                                                         wave_sizze_234844) *\n                              wave_sizze_234844) == 0 &&\n                 ",
            "            (squot32(local_tid_234842, wave_sizze_234844) &\n                              (2 * skip_waves_234874 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_234862 = ((__local\n                                             double *) red_arr_mem_234846)[sext_i32_i64(local_tid_234842 +\n                                                                           offset_234873)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_234863 = x_234861 +\n                                       x_234862;\n                                \n                                x_234861 = defunc_1_op_res_234863;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_234846)[sext_i32_i64(local_tid_234842)] =\n                                    x_234861;\n                            }\n                        }\n                        skip_waves_234874 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_234842 == 0) {\n                            ((__global double *) mem_230596)[gtid_219512 *\n                                                             l_n_m_203643 +\n                                                             gtid_219513] =\n                                x_234861;\n                        }\n                    }\n                }\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_219508\n}\n__kernel void mainzisegred_large_219564(__global int *global_failure,\n                                        uint sync_arr_mem_234930_bac",
            "king_offset_0,\n                                        uint red_arr_mem_234928_backing_offset_1,\n                                        int64_t n_203490, int64_t q_l_203495,\n                                        int64_t jump_t_203500,\n                                        int64_t partition_sizze_203577,\n                                        int64_t l_n_m_203643, int64_t i_203670,\n                                        int64_t num_groups_219558,\n                                        int64_t ctx_param_ext_229488,\n                                        int64_t ctx_param_ext_229489,\n                                        int64_t ctx_param_ext_229491,\n                                        int64_t groups_per_segment_234914,\n                                        int64_t elements_per_thread_234915,\n                                        int64_t virt_num_groups_234916,\n                                        int64_t threads_per_segment_234918,\n                                        __global unsigned char *ext_mem_229411,\n                                        __global unsigned char *ext_mem_229412,\n                                        __global\n                                        unsigned char *mem_param_229493,\n                                        __global unsigned char *mem_230551,\n                                        __global unsigned char *mem_230601,\n                                        __global unsigned char *mem_230606,\n                                        __global\n                                        unsigned char *segred_tmp_mem_234919,\n                                        __global\n                                        unsigned char *mainzicounter_mem_234921)\n{\n    #define segred_group_sizze_219557 (mainzisegred_group_sizze_219193)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *sync_arr_mem_234930_backing_1 =\n                           &shared_mem",
            "[sync_arr_mem_234930_backing_offset_0];\n    volatile unsigned char *red_arr_mem_234928_backing_0 =\n                           &shared_mem[red_arr_mem_234928_backing_offset_1];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234923;\n    int32_t local_tid_234924;\n    int64_t group_sizze_234927;\n    int32_t wave_sizze_234926;\n    int32_t group_tid_234925;\n    \n    global_tid_234923 = get_global_id(0);\n    local_tid_234924 = get_local_id(0);\n    group_sizze_234927 = get_local_size(0);\n    wave_sizze_234926 = LOCKSTEP_WIDTH;\n    group_tid_234925 = get_group_id(0);\n    \n    int32_t phys_tid_219564 = global_tid_234923;\n    __local unsigned char *red_arr_mem_234928;\n    \n    red_arr_mem_234928 = (__local unsigned char *) red_arr_mem_234928_backing_0;\n    \n    __local unsigned char *sync_arr_mem_234930;\n    \n    sync_arr_mem_234930 = (__local\n                           unsigned char *) sync_arr_mem_234930_backing_1;\n    \n    int32_t phys_group_id_234932;\n    \n    phys_group_id_234932 = get_group_id(0);\n    for (int32_t i_234933 = 0; i_234933 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_234916) - phys_group_id_234932,\n                   sext_i64_i32(num_groups_219558)); i_234933++) {\n        int32_t virt_group_id_234934 = phys_group_id_234932 + i_234933 *\n                sext_i64_i32(num_groups_219558);\n        int32_t flat_segment_id_234935 = squot32(virt_group_id_234934,\n                                                 sext_i64_i32(groups_per_segment_234914));\n        int64_t global_tid_234936 = srem64(sext_i32_i64(virt_group_id_234934) *\n                                           segred_group_sizze_219557 +\n                                           sext_i32_i64(local_tid_234924),\n                                           segred_group_sizze_219557 *\n                                           groups_per_segment_234914);\n        int64_t slice_234937 = l_n_m_203643;\n        int64_t slice_234938 = partition_sizze_203577 * slice_234937;\n    ",
            "    int64_t gtid_219561 = squot64(sext_i32_i64(flat_segment_id_234935),\n                                      slice_234937);\n        int64_t remnant_234939 = sext_i32_i64(flat_segment_id_234935) -\n                gtid_219561 * slice_234937;\n        int64_t gtid_219562 = remnant_234939;\n        int64_t remnant_234940 = remnant_234939 - gtid_219562;\n        int64_t gtid_219563;\n        double x_acc_234941;\n        int64_t chunk_sizze_234942 = smin64(elements_per_thread_234915,\n                                            sdiv_up64(q_l_203495 -\n                                                      global_tid_234936,\n                                                      threads_per_segment_234918));\n        double x_219565;\n        double x_219566;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_234941 = 0.0;\n        }\n        for (int64_t i_234946 = 0; i_234946 < chunk_sizze_234942; i_234946++) {\n            gtid_219563 = global_tid_234936 + threads_per_segment_234918 *\n                i_234946;\n            // apply map function\n            {\n                int64_t x_219574;\n                \n                x_219574 = ((__global int64_t *) ext_mem_229412)[gtid_219561 *\n                                                                 l_n_m_203643 +\n                                                                 gtid_219562];\n                \n                double x_219575;\n                \n                x_219575 = ((__global double *) ext_mem_229411)[gtid_219561 *\n                                                                l_n_m_203643 +\n                                                                gtid_219562];\n                \n                int64_t binop_y_228689 = mul64(jump_t_203500, gtid_219562);\n                int64_t binop_y_228690 = smin64(i_203670, binop_y_228689);\n                int64_t index_primexp_228691 = add64((int64_t) 1,\n                                                     binop_y_228690);\n              ",
            "  double a0_219577;\n                \n                a0_219577 = ((__global double *) mem_230601)[gtid_219561 *\n                                                             l_n_m_203643 +\n                                                             gtid_219562];\n                \n                bool cond_219579 = sle64(n_203490, gtid_219563);\n                int64_t defunc_0_f_res_219580;\n                \n                if (cond_219579) {\n                    defunc_0_f_res_219580 = (int64_t) 0;\n                } else {\n                    int64_t i_219581 = add64(gtid_219563, x_219574);\n                    int64_t defunc_1_add_res_219582 = add64((int64_t) 1,\n                                                            i_219581);\n                    \n                    defunc_0_f_res_219580 = defunc_1_add_res_219582;\n                }\n                \n                double defunc_0_f_res_219583;\n                \n                if (cond_219579) {\n                    defunc_0_f_res_219583 = 0.0;\n                } else {\n                    int64_t i_219584 = add64(gtid_219563, x_219574);\n                    double defunc_0_add_arg_219585;\n                    \n                    defunc_0_add_arg_219585 = ((__global\n                                                double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                                            (gtid_219561 *\n                                                                             ctx_param_ext_229489 +\n                                                                             i_219584 *\n                                                                             ctx_param_ext_229491)];\n                    defunc_0_f_res_219583 = defunc_0_add_arg_219585;\n                }\n                \n                int64_t binop_p_219586 = sub64(defunc_0_f_res_219580,\n                                               index_primexp_228691);\n                double defunc_0_f_res_2195",
            "87 = sitofp_i64_f64(binop_p_219586);\n                double abs_res_219588 = fabs(defunc_0_f_res_219587);\n                double tmp1_219589 = abs_res_219588 / x_219575;\n                double x_219590 = tmp1_219589 * tmp1_219589;\n                double y_219591 = tmp1_219589 * x_219590;\n                double tmp2_219592 = 1.0 - y_219591;\n                double x_219593 = tmp2_219592 * tmp2_219592;\n                double tmp3_219594 = tmp2_219592 * x_219593;\n                double tmp4_219595 = defunc_0_f_res_219583 * tmp3_219594;\n                double defunc_0_f_res_219596;\n                \n                if (cond_219579) {\n                    defunc_0_f_res_219596 = 0.0;\n                } else {\n                    int64_t i_219597 = add64(gtid_219563, x_219574);\n                    double defunc_0_add_arg_219598;\n                    \n                    defunc_0_add_arg_219598 = ((__global\n                                                double *) mem_230551)[gtid_219561 *\n                                                                      n_203490 +\n                                                                      i_219597];\n                    defunc_0_f_res_219596 = defunc_0_add_arg_219598;\n                }\n                \n                double x_219599 = a0_219577 * tmp4_219595;\n                double defunc_9_fit_fun_res_219600 = defunc_0_f_res_219596 *\n                       x_219599;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_219565 = x_acc_234941;\n                }\n                // load new values\n                {\n                    x_219566 = defunc_9_fit_fun_res_219600;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_219567 = x_219565 + x_219566;\n                    \n                    // store in accumulator\n                    {\n                        x",
            "_acc_234941 = defunc_1_op_res_219567;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_219565 = x_acc_234941;\n            ((__local\n              double *) red_arr_mem_234928)[sext_i32_i64(local_tid_234924)] =\n                x_219565;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_234947;\n        int32_t skip_waves_234948 = 1;\n        double x_234943;\n        double x_234944;\n        \n        offset_234947 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_234924,\n                      sext_i64_i32(segred_group_sizze_219557))) {\n                x_234943 = ((__local\n                             double *) red_arr_mem_234928)[sext_i32_i64(local_tid_234924 +\n                                                           offset_234947)];\n            }\n        }\n        offset_234947 = 1;\n        while (slt32(offset_234947, wave_sizze_234926)) {\n            if (slt32(local_tid_234924 + offset_234947,\n                      sext_i64_i32(segred_group_sizze_219557)) &&\n                ((local_tid_234924 - squot32(local_tid_234924,\n                                             wave_sizze_234926) *\n                  wave_sizze_234926) & (2 * offset_234947 - 1)) == 0) {\n                // read array element\n                {\n                    x_234944 = ((volatile __local\n                                 double *) red_arr_mem_234928)[sext_i32_i64(local_tid_234924 +\n                                                               offset_234947)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_234945 = x_234943 + x_234944;\n                    \n                    x_234943 = defunc_1_op_res_234945;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n  ",
            "                    double *) red_arr_mem_234928)[sext_i32_i64(local_tid_234924)] =\n                        x_234943;\n                }\n            }\n            offset_234947 *= 2;\n        }\n        while (slt32(skip_waves_234948,\n                     squot32(sext_i64_i32(segred_group_sizze_219557) +\n                             wave_sizze_234926 - 1, wave_sizze_234926))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_234947 = skip_waves_234948 * wave_sizze_234926;\n            if (slt32(local_tid_234924 + offset_234947,\n                      sext_i64_i32(segred_group_sizze_219557)) &&\n                ((local_tid_234924 - squot32(local_tid_234924,\n                                             wave_sizze_234926) *\n                  wave_sizze_234926) == 0 && (squot32(local_tid_234924,\n                                                      wave_sizze_234926) & (2 *\n                                                                            skip_waves_234948 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_234944 = ((__local\n                                 double *) red_arr_mem_234928)[sext_i32_i64(local_tid_234924 +\n                                                               offset_234947)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_234945 = x_234943 + x_234944;\n                    \n                    x_234943 = defunc_1_op_res_234945;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_234928)[sext_i32_i64(local_tid_234924)] =\n                        x_234943;\n                }\n            }\n            skip_waves_234948 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n   ",
            "     {\n            if (sext_i32_i64(local_tid_234924) == (int64_t) 0) {\n                x_acc_234941 = x_234943;\n            }\n        }\n        if (groups_per_segment_234914 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_234924 == 0) {\n                    ((__global double *) mem_230606)[gtid_219561 *\n                                                     l_n_m_203643 +\n                                                     gtid_219562] =\n                        x_acc_234941;\n                }\n            }\n        } else {\n            int32_t old_counter_234949;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_234924 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_234919)[sext_i32_i64(virt_group_id_234934)] =\n                        x_acc_234941;\n                    mem_fence_global();\n                    old_counter_234949 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_234921)[sext_i32_i64(srem32(flat_segment_id_234935,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_234930)[(int64_t) 0] =\n                        old_counter_234949 == groups_per_segment_234914 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_234950;\n            \n            is_last_group_234950 = ((__local\n                                     bool *) sync_arr_mem_234930)[(int64_t) 0];\n            if (is_last_group_234950) {\n                if (local_tid_234924 == 0) {\n                    old_counter_234949 =\n     ",
            "                   atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_234921)[sext_i32_i64(srem32(flat_segment_id_234935,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_234914));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_234951 =\n                            sdiv_up64(groups_per_segment_234914,\n                                      segred_group_sizze_219557);\n                    \n                    x_219565 = 0.0;\n                    for (int64_t i_234952 = 0; i_234952 <\n                         read_per_thread_234951; i_234952++) {\n                        int64_t group_res_id_234953 =\n                                sext_i32_i64(local_tid_234924) *\n                                read_per_thread_234951 + i_234952;\n                        int64_t index_of_group_res_234954 =\n                                sext_i32_i64(flat_segment_id_234935) *\n                                groups_per_segment_234914 + group_res_id_234953;\n                        \n                        if (slt64(group_res_id_234953,\n                                  groups_per_segment_234914)) {\n                            x_219566 = ((__global\n                                         double *) segred_tmp_mem_234919)[index_of_group_res_234954];\n                            \n                            double defunc_1_op_res_219567 = x_219565 + x_219566;\n                            \n                            x_219565 = defunc_1_op_res_219567;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_234928)[sext_i32_i64(local_tid_234924)] =\n                    x_219565;\n    ",
            "            barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_234955;\n                    int32_t skip_waves_234956 = 1;\n                    double x_234943;\n                    double x_234944;\n                    \n                    offset_234955 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_234924,\n                                  sext_i64_i32(segred_group_sizze_219557))) {\n                            x_234943 = ((__local\n                                         double *) red_arr_mem_234928)[sext_i32_i64(local_tid_234924 +\n                                                                       offset_234955)];\n                        }\n                    }\n                    offset_234955 = 1;\n                    while (slt32(offset_234955, wave_sizze_234926)) {\n                        if (slt32(local_tid_234924 + offset_234955,\n                                  sext_i64_i32(segred_group_sizze_219557)) &&\n                            ((local_tid_234924 - squot32(local_tid_234924,\n                                                         wave_sizze_234926) *\n                              wave_sizze_234926) & (2 * offset_234955 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_234944 = ((volatile __local\n                                             double *) red_arr_mem_234928)[sext_i32_i64(local_tid_234924 +\n                                                                           offset_234955)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_234945 = x_234943 +\n                                       x_234944;\n                                \n                   ",
            "             x_234943 = defunc_1_op_res_234945;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_234928)[sext_i32_i64(local_tid_234924)] =\n                                    x_234943;\n                            }\n                        }\n                        offset_234955 *= 2;\n                    }\n                    while (slt32(skip_waves_234956,\n                                 squot32(sext_i64_i32(segred_group_sizze_219557) +\n                                         wave_sizze_234926 - 1,\n                                         wave_sizze_234926))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_234955 = skip_waves_234956 * wave_sizze_234926;\n                        if (slt32(local_tid_234924 + offset_234955,\n                                  sext_i64_i32(segred_group_sizze_219557)) &&\n                            ((local_tid_234924 - squot32(local_tid_234924,\n                                                         wave_sizze_234926) *\n                              wave_sizze_234926) == 0 &&\n                             (squot32(local_tid_234924, wave_sizze_234926) &\n                              (2 * skip_waves_234956 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_234944 = ((__local\n                                             double *) red_arr_mem_234928)[sext_i32_i64(local_tid_234924 +\n                                                                           offset_234955)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_234945 = x_234943 +\n                                       x_234944;\n                                \n               ",
            "                 x_234943 = defunc_1_op_res_234945;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_234928)[sext_i32_i64(local_tid_234924)] =\n                                    x_234943;\n                            }\n                        }\n                        skip_waves_234956 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_234924 == 0) {\n                            ((__global double *) mem_230606)[gtid_219561 *\n                                                             l_n_m_203643 +\n                                                             gtid_219562] =\n                                x_234943;\n                        }\n                    }\n                }\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_219557\n}\n__kernel void mainzisegred_large_220344(__global int *global_failure,\n                                        uint sync_arr_mem_235076_backing_offset_0,\n                                        uint red_arr_mem_235074_backing_offset_1,\n                                        uint red_arr_mem_235072_backing_offset_2,\n                                        uint red_arr_mem_235070_backing_offset_3,\n                                        int64_t n_203490, int64_t q_l_203495,\n                                        int64_t jump_t_203500,\n                                        int64_t partition_sizze_203577,\n                                        int64_t l_n_m_203643, int64_t i_203670,\n                                        int64_t num_groups_220336,\n                                        int64_t ctx_param_ext_229488,\n                                        int64_t ctx_param_",
            "ext_229489,\n                                        int64_t ctx_param_ext_229491,\n                                        int64_t groups_per_segment_235052,\n                                        int64_t elements_per_thread_235053,\n                                        int64_t virt_num_groups_235054,\n                                        int64_t threads_per_segment_235056,\n                                        __global unsigned char *ext_mem_229411,\n                                        __global unsigned char *ext_mem_229412,\n                                        __global\n                                        unsigned char *mem_param_229493,\n                                        __global unsigned char *mem_230676,\n                                        __global unsigned char *mem_230680,\n                                        __global unsigned char *mem_230684,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235057,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235059,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235061,\n                                        __global\n                                        unsigned char *mainzicounter_mem_235063)\n{\n    #define segred_group_sizze_220335 (mainzisegred_group_sizze_220012)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *sync_arr_mem_235076_backing_3 =\n                           &shared_mem[sync_arr_mem_235076_backing_offset_0];\n    volatile unsigned char *red_arr_mem_235074_backing_2 =\n                           &shared_mem[red_arr_mem_235074_backing_offset_1];\n    volatile unsigned char *red_arr_mem_235072_backing_1 =\n                           &shared_mem[red_arr_mem_235072_backing_offset_2];\n    volatile unsign",
            "ed char *red_arr_mem_235070_backing_0 =\n                           &shared_mem[red_arr_mem_235070_backing_offset_3];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235065;\n    int32_t local_tid_235066;\n    int64_t group_sizze_235069;\n    int32_t wave_sizze_235068;\n    int32_t group_tid_235067;\n    \n    global_tid_235065 = get_global_id(0);\n    local_tid_235066 = get_local_id(0);\n    group_sizze_235069 = get_local_size(0);\n    wave_sizze_235068 = LOCKSTEP_WIDTH;\n    group_tid_235067 = get_group_id(0);\n    \n    int32_t phys_tid_220344 = global_tid_235065;\n    __local unsigned char *red_arr_mem_235070;\n    \n    red_arr_mem_235070 = (__local unsigned char *) red_arr_mem_235070_backing_0;\n    \n    __local unsigned char *red_arr_mem_235072;\n    \n    red_arr_mem_235072 = (__local unsigned char *) red_arr_mem_235072_backing_1;\n    \n    __local unsigned char *red_arr_mem_235074;\n    \n    red_arr_mem_235074 = (__local unsigned char *) red_arr_mem_235074_backing_2;\n    \n    __local unsigned char *sync_arr_mem_235076;\n    \n    sync_arr_mem_235076 = (__local\n                           unsigned char *) sync_arr_mem_235076_backing_3;\n    \n    int32_t phys_group_id_235078;\n    \n    phys_group_id_235078 = get_group_id(0);\n    for (int32_t i_235079 = 0; i_235079 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_235054) - phys_group_id_235078,\n                   sext_i64_i32(num_groups_220336)); i_235079++) {\n        int32_t virt_group_id_235080 = phys_group_id_235078 + i_235079 *\n                sext_i64_i32(num_groups_220336);\n        int32_t flat_segment_id_235081 = squot32(virt_group_id_235080,\n                                                 sext_i64_i32(groups_per_segment_235052));\n        int64_t global_tid_235082 = srem64(sext_i32_i64(virt_group_id_235080) *\n                                           segred_group_sizze_220335 +\n                                           sext_i32_i64(local_tid_235066),\n                                           s",
            "egred_group_sizze_220335 *\n                                           groups_per_segment_235052);\n        int64_t slice_235083 = l_n_m_203643;\n        int64_t slice_235084 = partition_sizze_203577 * slice_235083;\n        int64_t gtid_220341 = squot64(sext_i32_i64(flat_segment_id_235081),\n                                      slice_235083);\n        int64_t remnant_235085 = sext_i32_i64(flat_segment_id_235081) -\n                gtid_220341 * slice_235083;\n        int64_t gtid_220342 = remnant_235085;\n        int64_t remnant_235086 = remnant_235085 - gtid_220342;\n        int64_t gtid_220343;\n        double x_acc_235087;\n        double x_acc_235088;\n        double x_acc_235089;\n        int64_t chunk_sizze_235090 = smin64(elements_per_thread_235053,\n                                            sdiv_up64(q_l_203495 -\n                                                      global_tid_235082,\n                                                      threads_per_segment_235056));\n        double x_220345;\n        double x_220346;\n        double x_220347;\n        double x_220348;\n        double x_220349;\n        double x_220350;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_235087 = 0.0;\n            x_acc_235088 = 0.0;\n            x_acc_235089 = 0.0;\n        }\n        for (int64_t i_235100 = 0; i_235100 < chunk_sizze_235090; i_235100++) {\n            gtid_220343 = global_tid_235082 + threads_per_segment_235056 *\n                i_235100;\n            // apply map function\n            {\n                int64_t x_220358;\n                \n                x_220358 = ((__global int64_t *) ext_mem_229412)[gtid_220341 *\n                                                                 l_n_m_203643 +\n                                                                 gtid_220342];\n                \n                double x_220359;\n                \n                x_220359 = ((__global double *) ext_mem_229411)[gtid_220341 *\n                                    ",
            "                            l_n_m_203643 +\n                                                                gtid_220342];\n                \n                int64_t binop_y_228704 = mul64(jump_t_203500, gtid_220342);\n                int64_t binop_y_228705 = smin64(i_203670, binop_y_228704);\n                int64_t index_primexp_228706 = add64((int64_t) 1,\n                                                     binop_y_228705);\n                bool cond_220362 = sle64(n_203490, gtid_220343);\n                int64_t defunc_0_f_res_220363;\n                \n                if (cond_220362) {\n                    defunc_0_f_res_220363 = (int64_t) 0;\n                } else {\n                    int64_t i_220364 = add64(gtid_220343, x_220358);\n                    int64_t defunc_1_add_res_220365 = add64((int64_t) 1,\n                                                            i_220364);\n                    \n                    defunc_0_f_res_220363 = defunc_1_add_res_220365;\n                }\n                \n                double defunc_0_f_res_220366;\n                \n                if (cond_220362) {\n                    defunc_0_f_res_220366 = 0.0;\n                } else {\n                    int64_t i_220367 = add64(gtid_220343, x_220358);\n                    double defunc_0_add_arg_220368;\n                    \n                    defunc_0_add_arg_220368 = ((__global\n                                                double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                                            (gtid_220341 *\n                                                                             ctx_param_ext_229489 +\n                                                                             i_220367 *\n                                                                             ctx_param_ext_229491)];\n                    defunc_0_f_res_220366 = defunc_0_add_arg_220368;\n                }\n                \n                int64_t binop_p_22036",
            "9 = sub64(defunc_0_f_res_220363,\n                                               index_primexp_228706);\n                double defunc_0_f_res_220370 = sitofp_i64_f64(binop_p_220369);\n                double abs_res_220371 = fabs(defunc_0_f_res_220370);\n                double tmp1_220372 = abs_res_220371 / x_220359;\n                double x_220373 = tmp1_220372 * tmp1_220372;\n                double y_220374 = tmp1_220372 * x_220373;\n                double tmp2_220375 = 1.0 - y_220374;\n                double x_220376 = tmp2_220375 * tmp2_220375;\n                double tmp3_220377 = tmp2_220375 * x_220376;\n                double w_j_220378 = defunc_0_f_res_220366 * tmp3_220377;\n                double xw_j_220379 = defunc_0_f_res_220370 * w_j_220378;\n                double x2w_j_220380 = defunc_0_f_res_220370 * xw_j_220379;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_220345 = x_acc_235087;\n                    x_220346 = x_acc_235088;\n                    x_220347 = x_acc_235089;\n                }\n                // load new values\n                {\n                    x_220348 = w_j_220378;\n                    x_220349 = xw_j_220379;\n                    x_220350 = x2w_j_220380;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_220351 = x_220345 + x_220348;\n                    double defunc_1_op_res_220352 = x_220346 + x_220349;\n                    double defunc_1_op_res_220353 = x_220347 + x_220350;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_235087 = defunc_1_op_res_220351;\n                        x_acc_235088 = defunc_1_op_res_220352;\n                        x_acc_235089 = defunc_1_op_res_220353;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in ",
            "memory\n        {\n            x_220345 = x_acc_235087;\n            x_220346 = x_acc_235088;\n            x_220347 = x_acc_235089;\n            ((__local\n              double *) red_arr_mem_235070)[sext_i32_i64(local_tid_235066)] =\n                x_220345;\n            ((__local\n              double *) red_arr_mem_235072)[sext_i32_i64(local_tid_235066)] =\n                x_220346;\n            ((__local\n              double *) red_arr_mem_235074)[sext_i32_i64(local_tid_235066)] =\n                x_220347;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_235101;\n        int32_t skip_waves_235102 = 1;\n        double x_235091;\n        double x_235092;\n        double x_235093;\n        double x_235094;\n        double x_235095;\n        double x_235096;\n        \n        offset_235101 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_235066,\n                      sext_i64_i32(segred_group_sizze_220335))) {\n                x_235091 = ((__local\n                             double *) red_arr_mem_235070)[sext_i32_i64(local_tid_235066 +\n                                                           offset_235101)];\n                x_235092 = ((__local\n                             double *) red_arr_mem_235072)[sext_i32_i64(local_tid_235066 +\n                                                           offset_235101)];\n                x_235093 = ((__local\n                             double *) red_arr_mem_235074)[sext_i32_i64(local_tid_235066 +\n                                                           offset_235101)];\n            }\n        }\n        offset_235101 = 1;\n        while (slt32(offset_235101, wave_sizze_235068)) {\n            if (slt32(local_tid_235066 + offset_235101,\n                      sext_i64_i32(segred_group_sizze_220335)) &&\n                ((local_tid_235066 - squot32(local_tid_235066,\n                                             wave_sizze_235068) *\n                  wave_sizze_235068",
            ") & (2 * offset_235101 - 1)) == 0) {\n                // read array element\n                {\n                    x_235094 = ((volatile __local\n                                 double *) red_arr_mem_235070)[sext_i32_i64(local_tid_235066 +\n                                                               offset_235101)];\n                    x_235095 = ((volatile __local\n                                 double *) red_arr_mem_235072)[sext_i32_i64(local_tid_235066 +\n                                                               offset_235101)];\n                    x_235096 = ((volatile __local\n                                 double *) red_arr_mem_235074)[sext_i32_i64(local_tid_235066 +\n                                                               offset_235101)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_235097 = x_235091 + x_235094;\n                    double defunc_1_op_res_235098 = x_235092 + x_235095;\n                    double defunc_1_op_res_235099 = x_235093 + x_235096;\n                    \n                    x_235091 = defunc_1_op_res_235097;\n                    x_235092 = defunc_1_op_res_235098;\n                    x_235093 = defunc_1_op_res_235099;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_235070)[sext_i32_i64(local_tid_235066)] =\n                        x_235091;\n                    ((volatile __local\n                      double *) red_arr_mem_235072)[sext_i32_i64(local_tid_235066)] =\n                        x_235092;\n                    ((volatile __local\n                      double *) red_arr_mem_235074)[sext_i32_i64(local_tid_235066)] =\n                        x_235093;\n                }\n            }\n            offset_235101 *= 2;\n        }\n        while (slt32(skip_waves_235102,\n                     squot32(sext_i64_i32(segred_group_sizze_220335) +\n   ",
            "                          wave_sizze_235068 - 1, wave_sizze_235068))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_235101 = skip_waves_235102 * wave_sizze_235068;\n            if (slt32(local_tid_235066 + offset_235101,\n                      sext_i64_i32(segred_group_sizze_220335)) &&\n                ((local_tid_235066 - squot32(local_tid_235066,\n                                             wave_sizze_235068) *\n                  wave_sizze_235068) == 0 && (squot32(local_tid_235066,\n                                                      wave_sizze_235068) & (2 *\n                                                                            skip_waves_235102 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_235094 = ((__local\n                                 double *) red_arr_mem_235070)[sext_i32_i64(local_tid_235066 +\n                                                               offset_235101)];\n                    x_235095 = ((__local\n                                 double *) red_arr_mem_235072)[sext_i32_i64(local_tid_235066 +\n                                                               offset_235101)];\n                    x_235096 = ((__local\n                                 double *) red_arr_mem_235074)[sext_i32_i64(local_tid_235066 +\n                                                               offset_235101)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_235097 = x_235091 + x_235094;\n                    double defunc_1_op_res_235098 = x_235092 + x_235095;\n                    double defunc_1_op_res_235099 = x_235093 + x_235096;\n                    \n                    x_235091 = defunc_1_op_res_235097;\n                    x_235092 = defunc_1_op_res_235098;\n                    x_235093 = defunc_1_op_res_235099;\n                }\n      ",
            "          // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_235070)[sext_i32_i64(local_tid_235066)] =\n                        x_235091;\n                    ((__local\n                      double *) red_arr_mem_235072)[sext_i32_i64(local_tid_235066)] =\n                        x_235092;\n                    ((__local\n                      double *) red_arr_mem_235074)[sext_i32_i64(local_tid_235066)] =\n                        x_235093;\n                }\n            }\n            skip_waves_235102 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_235066) == (int64_t) 0) {\n                x_acc_235087 = x_235091;\n                x_acc_235088 = x_235092;\n                x_acc_235089 = x_235093;\n            }\n        }\n        if (groups_per_segment_235052 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_235066 == 0) {\n                    ((__global double *) mem_230676)[gtid_220341 *\n                                                     l_n_m_203643 +\n                                                     gtid_220342] =\n                        x_acc_235087;\n                    ((__global double *) mem_230680)[gtid_220341 *\n                                                     l_n_m_203643 +\n                                                     gtid_220342] =\n                        x_acc_235088;\n                    ((__global double *) mem_230684)[gtid_220341 *\n                                                     l_n_m_203643 +\n                                                     gtid_220342] =\n                        x_acc_235089;\n                }\n            }\n        } else {\n            int32_t old_counter_235103;\n            \n            // first thread in group saves group result to global memory\n            {\n      ",
            "          if (local_tid_235066 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_235057)[sext_i32_i64(virt_group_id_235080)] =\n                        x_acc_235087;\n                    ((__global\n                      double *) segred_tmp_mem_235059)[sext_i32_i64(virt_group_id_235080)] =\n                        x_acc_235088;\n                    ((__global\n                      double *) segred_tmp_mem_235061)[sext_i32_i64(virt_group_id_235080)] =\n                        x_acc_235089;\n                    mem_fence_global();\n                    old_counter_235103 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_235063)[sext_i32_i64(srem32(flat_segment_id_235081,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_235076)[(int64_t) 0] =\n                        old_counter_235103 == groups_per_segment_235052 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_235104;\n            \n            is_last_group_235104 = ((__local\n                                     bool *) sync_arr_mem_235076)[(int64_t) 0];\n            if (is_last_group_235104) {\n                if (local_tid_235066 == 0) {\n                    old_counter_235103 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_235063)[sext_i32_i64(srem32(flat_segment_id_235081,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per",
            "_segment_235052));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_235105 =\n                            sdiv_up64(groups_per_segment_235052,\n                                      segred_group_sizze_220335);\n                    \n                    x_220345 = 0.0;\n                    x_220346 = 0.0;\n                    x_220347 = 0.0;\n                    for (int64_t i_235106 = 0; i_235106 <\n                         read_per_thread_235105; i_235106++) {\n                        int64_t group_res_id_235107 =\n                                sext_i32_i64(local_tid_235066) *\n                                read_per_thread_235105 + i_235106;\n                        int64_t index_of_group_res_235108 =\n                                sext_i32_i64(flat_segment_id_235081) *\n                                groups_per_segment_235052 + group_res_id_235107;\n                        \n                        if (slt64(group_res_id_235107,\n                                  groups_per_segment_235052)) {\n                            x_220348 = ((__global\n                                         double *) segred_tmp_mem_235057)[index_of_group_res_235108];\n                            x_220349 = ((__global\n                                         double *) segred_tmp_mem_235059)[index_of_group_res_235108];\n                            x_220350 = ((__global\n                                         double *) segred_tmp_mem_235061)[index_of_group_res_235108];\n                            \n                            double defunc_1_op_res_220351 = x_220345 + x_220348;\n                            double defunc_1_op_res_220352 = x_220346 + x_220349;\n                            double defunc_1_op_res_220353 = x_220347 + x_220350;\n                            \n                            x_220345 = defunc_1_op_res_220351;\n                            x_220346 = defunc_1_op_res_220352;\n                            x_220347 ",
            "= defunc_1_op_res_220353;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_235070)[sext_i32_i64(local_tid_235066)] =\n                    x_220345;\n                ((__local\n                  double *) red_arr_mem_235072)[sext_i32_i64(local_tid_235066)] =\n                    x_220346;\n                ((__local\n                  double *) red_arr_mem_235074)[sext_i32_i64(local_tid_235066)] =\n                    x_220347;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_235109;\n                    int32_t skip_waves_235110 = 1;\n                    double x_235091;\n                    double x_235092;\n                    double x_235093;\n                    double x_235094;\n                    double x_235095;\n                    double x_235096;\n                    \n                    offset_235109 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_235066,\n                                  sext_i64_i32(segred_group_sizze_220335))) {\n                            x_235091 = ((__local\n                                         double *) red_arr_mem_235070)[sext_i32_i64(local_tid_235066 +\n                                                                       offset_235109)];\n                            x_235092 = ((__local\n                                         double *) red_arr_mem_235072)[sext_i32_i64(local_tid_235066 +\n                                                                       offset_235109)];\n                            x_235093 = ((__local\n                                         double *) red_arr_mem_235074)[sext_i32_i64(local_tid_235066 +\n                                                                       offset_235109)];\n                        }\n                    }\n                ",
            "    offset_235109 = 1;\n                    while (slt32(offset_235109, wave_sizze_235068)) {\n                        if (slt32(local_tid_235066 + offset_235109,\n                                  sext_i64_i32(segred_group_sizze_220335)) &&\n                            ((local_tid_235066 - squot32(local_tid_235066,\n                                                         wave_sizze_235068) *\n                              wave_sizze_235068) & (2 * offset_235109 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_235094 = ((volatile __local\n                                             double *) red_arr_mem_235070)[sext_i32_i64(local_tid_235066 +\n                                                                           offset_235109)];\n                                x_235095 = ((volatile __local\n                                             double *) red_arr_mem_235072)[sext_i32_i64(local_tid_235066 +\n                                                                           offset_235109)];\n                                x_235096 = ((volatile __local\n                                             double *) red_arr_mem_235074)[sext_i32_i64(local_tid_235066 +\n                                                                           offset_235109)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_235097 = x_235091 +\n                                       x_235094;\n                                double defunc_1_op_res_235098 = x_235092 +\n                                       x_235095;\n                                double defunc_1_op_res_235099 = x_235093 +\n                                       x_235096;\n                                \n                                x_235091 = defunc_1_op_res_235097;\n                                x_235092 = d",
            "efunc_1_op_res_235098;\n                                x_235093 = defunc_1_op_res_235099;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_235070)[sext_i32_i64(local_tid_235066)] =\n                                    x_235091;\n                                ((volatile __local\n                                  double *) red_arr_mem_235072)[sext_i32_i64(local_tid_235066)] =\n                                    x_235092;\n                                ((volatile __local\n                                  double *) red_arr_mem_235074)[sext_i32_i64(local_tid_235066)] =\n                                    x_235093;\n                            }\n                        }\n                        offset_235109 *= 2;\n                    }\n                    while (slt32(skip_waves_235110,\n                                 squot32(sext_i64_i32(segred_group_sizze_220335) +\n                                         wave_sizze_235068 - 1,\n                                         wave_sizze_235068))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_235109 = skip_waves_235110 * wave_sizze_235068;\n                        if (slt32(local_tid_235066 + offset_235109,\n                                  sext_i64_i32(segred_group_sizze_220335)) &&\n                            ((local_tid_235066 - squot32(local_tid_235066,\n                                                         wave_sizze_235068) *\n                              wave_sizze_235068) == 0 &&\n                             (squot32(local_tid_235066, wave_sizze_235068) &\n                              (2 * skip_waves_235110 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_235094 = ((__local\n                                             double *) r",
            "ed_arr_mem_235070)[sext_i32_i64(local_tid_235066 +\n                                                                           offset_235109)];\n                                x_235095 = ((__local\n                                             double *) red_arr_mem_235072)[sext_i32_i64(local_tid_235066 +\n                                                                           offset_235109)];\n                                x_235096 = ((__local\n                                             double *) red_arr_mem_235074)[sext_i32_i64(local_tid_235066 +\n                                                                           offset_235109)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_235097 = x_235091 +\n                                       x_235094;\n                                double defunc_1_op_res_235098 = x_235092 +\n                                       x_235095;\n                                double defunc_1_op_res_235099 = x_235093 +\n                                       x_235096;\n                                \n                                x_235091 = defunc_1_op_res_235097;\n                                x_235092 = defunc_1_op_res_235098;\n                                x_235093 = defunc_1_op_res_235099;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_235070)[sext_i32_i64(local_tid_235066)] =\n                                    x_235091;\n                                ((__local\n                                  double *) red_arr_mem_235072)[sext_i32_i64(local_tid_235066)] =\n                                    x_235092;\n                                ((__local\n                                  double *) red_arr_mem_235074)[sext_i32_i64(local_tid_235066)] =\n ",
            "                                   x_235093;\n                            }\n                        }\n                        skip_waves_235110 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_235066 == 0) {\n                            ((__global double *) mem_230676)[gtid_220341 *\n                                                             l_n_m_203643 +\n                                                             gtid_220342] =\n                                x_235091;\n                            ((__global double *) mem_230680)[gtid_220341 *\n                                                             l_n_m_203643 +\n                                                             gtid_220342] =\n                                x_235092;\n                            ((__global double *) mem_230684)[gtid_220341 *\n                                                             l_n_m_203643 +\n                                                             gtid_220342] =\n                                x_235093;\n                        }\n                    }\n                }\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_220335\n}\n__kernel void mainzisegred_large_220413(__global int *global_failure,\n                                        uint sync_arr_mem_235176_backing_offset_0,\n                                        uint red_arr_mem_235174_backing_offset_1,\n                                        uint red_arr_mem_235172_backing_offset_2,\n                                        int64_t n_203490, int64_t q_l_203495,\n                                        int64_t jump_t_203500,\n                                        int64_t partition_sizze_203577,\n                                        int64_t l_n_m_203643, int64_t i_203670,\n                                        int64_t n",
            "um_groups_220406,\n                                        int64_t ctx_param_ext_229488,\n                                        int64_t ctx_param_ext_229489,\n                                        int64_t ctx_param_ext_229491,\n                                        int64_t groups_per_segment_235156,\n                                        int64_t elements_per_thread_235157,\n                                        int64_t virt_num_groups_235158,\n                                        int64_t threads_per_segment_235160,\n                                        __global unsigned char *ext_mem_229411,\n                                        __global unsigned char *ext_mem_229412,\n                                        __global\n                                        unsigned char *mem_param_229493,\n                                        __global unsigned char *mem_230551,\n                                        __global unsigned char *mem_230689,\n                                        __global unsigned char *mem_230693,\n                                        __global unsigned char *mem_230697,\n                                        __global unsigned char *mem_230702,\n                                        __global unsigned char *mem_230706,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235161,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235163,\n                                        __global\n                                        unsigned char *mainzicounter_mem_235165)\n{\n    #define segred_group_sizze_220405 (mainzisegred_group_sizze_219918)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *sync_arr_mem_235176_backing_2 =\n                           &shared_mem[sync_arr_mem_235176_backing_offset_0];\n    volatile unsigned char *red_arr_mem_2351",
            "74_backing_1 =\n                           &shared_mem[red_arr_mem_235174_backing_offset_1];\n    volatile unsigned char *red_arr_mem_235172_backing_0 =\n                           &shared_mem[red_arr_mem_235172_backing_offset_2];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235167;\n    int32_t local_tid_235168;\n    int64_t group_sizze_235171;\n    int32_t wave_sizze_235170;\n    int32_t group_tid_235169;\n    \n    global_tid_235167 = get_global_id(0);\n    local_tid_235168 = get_local_id(0);\n    group_sizze_235171 = get_local_size(0);\n    wave_sizze_235170 = LOCKSTEP_WIDTH;\n    group_tid_235169 = get_group_id(0);\n    \n    int32_t phys_tid_220413 = global_tid_235167;\n    __local unsigned char *red_arr_mem_235172;\n    \n    red_arr_mem_235172 = (__local unsigned char *) red_arr_mem_235172_backing_0;\n    \n    __local unsigned char *red_arr_mem_235174;\n    \n    red_arr_mem_235174 = (__local unsigned char *) red_arr_mem_235174_backing_1;\n    \n    __local unsigned char *sync_arr_mem_235176;\n    \n    sync_arr_mem_235176 = (__local\n                           unsigned char *) sync_arr_mem_235176_backing_2;\n    \n    int32_t phys_group_id_235178;\n    \n    phys_group_id_235178 = get_group_id(0);\n    for (int32_t i_235179 = 0; i_235179 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_235158) - phys_group_id_235178,\n                   sext_i64_i32(num_groups_220406)); i_235179++) {\n        int32_t virt_group_id_235180 = phys_group_id_235178 + i_235179 *\n                sext_i64_i32(num_groups_220406);\n        int32_t flat_segment_id_235181 = squot32(virt_group_id_235180,\n                                                 sext_i64_i32(groups_per_segment_235156));\n        int64_t global_tid_235182 = srem64(sext_i32_i64(virt_group_id_235180) *\n                                           segred_group_sizze_220405 +\n                                           sext_i32_i64(local_tid_235168),\n                                           segred_group_sizze_220405 *\n",
            "                                           groups_per_segment_235156);\n        int64_t slice_235183 = l_n_m_203643;\n        int64_t slice_235184 = partition_sizze_203577 * slice_235183;\n        int64_t gtid_220410 = squot64(sext_i32_i64(flat_segment_id_235181),\n                                      slice_235183);\n        int64_t remnant_235185 = sext_i32_i64(flat_segment_id_235181) -\n                gtid_220410 * slice_235183;\n        int64_t gtid_220411 = remnant_235185;\n        int64_t remnant_235186 = remnant_235185 - gtid_220411;\n        int64_t gtid_220412;\n        double x_acc_235187;\n        double x_acc_235188;\n        int64_t chunk_sizze_235189 = smin64(elements_per_thread_235157,\n                                            sdiv_up64(q_l_203495 -\n                                                      global_tid_235182,\n                                                      threads_per_segment_235160));\n        double x_220414;\n        double x_220415;\n        double x_220416;\n        double x_220417;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_235187 = 0.0;\n            x_acc_235188 = 0.0;\n        }\n        for (int64_t i_235196 = 0; i_235196 < chunk_sizze_235189; i_235196++) {\n            gtid_220412 = global_tid_235182 + threads_per_segment_235160 *\n                i_235196;\n            // apply map function\n            {\n                int64_t x_220428;\n                \n                x_220428 = ((__global int64_t *) ext_mem_229412)[gtid_220410 *\n                                                                 l_n_m_203643 +\n                                                                 gtid_220411];\n                \n                double x_220429;\n                \n                x_220429 = ((__global double *) ext_mem_229411)[gtid_220410 *\n                                                                l_n_m_203643 +\n                                                                gtid_220411];\n                \n",
            "                int64_t binop_y_228699 = mul64(jump_t_203500, gtid_220411);\n                int64_t binop_y_228700 = smin64(i_203670, binop_y_228699);\n                int64_t index_primexp_228701 = add64((int64_t) 1,\n                                                     binop_y_228700);\n                double a11_220431;\n                \n                a11_220431 = ((__global double *) mem_230689)[gtid_220410 *\n                                                              l_n_m_203643 +\n                                                              gtid_220411];\n                \n                double b11_220432;\n                \n                b11_220432 = ((__global double *) mem_230693)[gtid_220410 *\n                                                              l_n_m_203643 +\n                                                              gtid_220411];\n                \n                double c11_220433;\n                \n                c11_220433 = ((__global double *) mem_230697)[gtid_220410 *\n                                                              l_n_m_203643 +\n                                                              gtid_220411];\n                \n                bool cond_220435 = sle64(n_203490, gtid_220412);\n                int64_t defunc_0_f_res_220436;\n                \n                if (cond_220435) {\n                    defunc_0_f_res_220436 = (int64_t) 0;\n                } else {\n                    int64_t i_220437 = add64(gtid_220412, x_220428);\n                    int64_t defunc_1_add_res_220438 = add64((int64_t) 1,\n                                                            i_220437);\n                    \n                    defunc_0_f_res_220436 = defunc_1_add_res_220438;\n                }\n                \n                double defunc_0_f_res_220439;\n                \n                if (cond_220435) {\n                    defunc_0_f_res_220439 = 0.0;\n                } else {\n                    int64_t i_220440 = add64(gtid_220412, x_220",
            "428);\n                    double defunc_0_add_arg_220441;\n                    \n                    defunc_0_add_arg_220441 = ((__global\n                                                double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                                            (gtid_220410 *\n                                                                             ctx_param_ext_229489 +\n                                                                             i_220440 *\n                                                                             ctx_param_ext_229491)];\n                    defunc_0_f_res_220439 = defunc_0_add_arg_220441;\n                }\n                \n                int64_t binop_p_220442 = sub64(defunc_0_f_res_220436,\n                                               index_primexp_228701);\n                double defunc_0_f_res_220443 = sitofp_i64_f64(binop_p_220442);\n                double abs_res_220444 = fabs(defunc_0_f_res_220443);\n                double tmp1_220445 = abs_res_220444 / x_220429;\n                double x_220446 = tmp1_220445 * tmp1_220445;\n                double y_220447 = tmp1_220445 * x_220446;\n                double tmp2_220448 = 1.0 - y_220447;\n                double x_220449 = tmp2_220448 * tmp2_220448;\n                double tmp3_220450 = tmp2_220448 * x_220449;\n                double tmp4_220451 = defunc_0_f_res_220439 * tmp3_220450;\n                double defunc_1_f_res_220452 = defunc_0_f_res_220443 *\n                       tmp4_220451;\n                double defunc_0_f_res_220453;\n                \n                if (cond_220435) {\n                    defunc_0_f_res_220453 = 0.0;\n                } else {\n                    int64_t i_220454 = add64(gtid_220412, x_220428);\n                    double defunc_0_add_arg_220455;\n                    \n                    defunc_0_add_arg_220455 = ((__global\n                                                double *) mem_230551)[gtid_220410 *",
            "\n                                                                      n_203490 +\n                                                                      i_220454];\n                    defunc_0_f_res_220453 = defunc_0_add_arg_220455;\n                }\n                \n                double x_220456 = a11_220431 * tmp4_220451;\n                double y_220457 = b11_220432 * defunc_1_f_res_220452;\n                double x_220458 = x_220456 + y_220457;\n                double defunc_9_fit_fun_res_220459 = defunc_0_f_res_220453 *\n                       x_220458;\n                double x_220460 = b11_220432 * tmp4_220451;\n                double y_220461 = c11_220433 * defunc_1_f_res_220452;\n                double x_220462 = x_220460 + y_220461;\n                double defunc_9_slope_fun_res_220463 = defunc_0_f_res_220453 *\n                       x_220462;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_220414 = x_acc_235187;\n                    x_220415 = x_acc_235188;\n                }\n                // load new values\n                {\n                    x_220416 = defunc_9_fit_fun_res_220459;\n                    x_220417 = defunc_9_slope_fun_res_220463;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_220418 = x_220414 + x_220416;\n                    double defunc_1_op_res_220419 = x_220415 + x_220417;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_235187 = defunc_1_op_res_220418;\n                        x_acc_235188 = defunc_1_op_res_220419;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_220414 = x_acc_235187;\n            x_220415 = x_acc_235188;\n            ((__local\n              double *) red_arr_mem_235172)[sext_",
            "i32_i64(local_tid_235168)] =\n                x_220414;\n            ((__local\n              double *) red_arr_mem_235174)[sext_i32_i64(local_tid_235168)] =\n                x_220415;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_235197;\n        int32_t skip_waves_235198 = 1;\n        double x_235190;\n        double x_235191;\n        double x_235192;\n        double x_235193;\n        \n        offset_235197 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_235168,\n                      sext_i64_i32(segred_group_sizze_220405))) {\n                x_235190 = ((__local\n                             double *) red_arr_mem_235172)[sext_i32_i64(local_tid_235168 +\n                                                           offset_235197)];\n                x_235191 = ((__local\n                             double *) red_arr_mem_235174)[sext_i32_i64(local_tid_235168 +\n                                                           offset_235197)];\n            }\n        }\n        offset_235197 = 1;\n        while (slt32(offset_235197, wave_sizze_235170)) {\n            if (slt32(local_tid_235168 + offset_235197,\n                      sext_i64_i32(segred_group_sizze_220405)) &&\n                ((local_tid_235168 - squot32(local_tid_235168,\n                                             wave_sizze_235170) *\n                  wave_sizze_235170) & (2 * offset_235197 - 1)) == 0) {\n                // read array element\n                {\n                    x_235192 = ((volatile __local\n                                 double *) red_arr_mem_235172)[sext_i32_i64(local_tid_235168 +\n                                                               offset_235197)];\n                    x_235193 = ((volatile __local\n                                 double *) red_arr_mem_235174)[sext_i32_i64(local_tid_235168 +\n                                                               offset_235197)];\n                }\n                //",
            " apply reduction operation\n                {\n                    double defunc_1_op_res_235194 = x_235190 + x_235192;\n                    double defunc_1_op_res_235195 = x_235191 + x_235193;\n                    \n                    x_235190 = defunc_1_op_res_235194;\n                    x_235191 = defunc_1_op_res_235195;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_235172)[sext_i32_i64(local_tid_235168)] =\n                        x_235190;\n                    ((volatile __local\n                      double *) red_arr_mem_235174)[sext_i32_i64(local_tid_235168)] =\n                        x_235191;\n                }\n            }\n            offset_235197 *= 2;\n        }\n        while (slt32(skip_waves_235198,\n                     squot32(sext_i64_i32(segred_group_sizze_220405) +\n                             wave_sizze_235170 - 1, wave_sizze_235170))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_235197 = skip_waves_235198 * wave_sizze_235170;\n            if (slt32(local_tid_235168 + offset_235197,\n                      sext_i64_i32(segred_group_sizze_220405)) &&\n                ((local_tid_235168 - squot32(local_tid_235168,\n                                             wave_sizze_235170) *\n                  wave_sizze_235170) == 0 && (squot32(local_tid_235168,\n                                                      wave_sizze_235170) & (2 *\n                                                                            skip_waves_235198 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_235192 = ((__local\n                                 double *) red_arr_mem_235172)[sext_i32_i64(local_tid_235168 +\n                                                               offset_235197)];\n                    x_235193 = ((",
            "__local\n                                 double *) red_arr_mem_235174)[sext_i32_i64(local_tid_235168 +\n                                                               offset_235197)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_235194 = x_235190 + x_235192;\n                    double defunc_1_op_res_235195 = x_235191 + x_235193;\n                    \n                    x_235190 = defunc_1_op_res_235194;\n                    x_235191 = defunc_1_op_res_235195;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_235172)[sext_i32_i64(local_tid_235168)] =\n                        x_235190;\n                    ((__local\n                      double *) red_arr_mem_235174)[sext_i32_i64(local_tid_235168)] =\n                        x_235191;\n                }\n            }\n            skip_waves_235198 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_235168) == (int64_t) 0) {\n                x_acc_235187 = x_235190;\n                x_acc_235188 = x_235191;\n            }\n        }\n        if (groups_per_segment_235156 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_235168 == 0) {\n                    ((__global double *) mem_230702)[gtid_220410 *\n                                                     l_n_m_203643 +\n                                                     gtid_220411] =\n                        x_acc_235187;\n                    ((__global double *) mem_230706)[gtid_220410 *\n                                                     l_n_m_203643 +\n                                                     gtid_220411] =\n                        x_acc_235188;\n                }\n            }\n        } else {\n            i",
            "nt32_t old_counter_235199;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_235168 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_235161)[sext_i32_i64(virt_group_id_235180)] =\n                        x_acc_235187;\n                    ((__global\n                      double *) segred_tmp_mem_235163)[sext_i32_i64(virt_group_id_235180)] =\n                        x_acc_235188;\n                    mem_fence_global();\n                    old_counter_235199 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_235165)[sext_i32_i64(srem32(flat_segment_id_235181,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_235176)[(int64_t) 0] =\n                        old_counter_235199 == groups_per_segment_235156 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_235200;\n            \n            is_last_group_235200 = ((__local\n                                     bool *) sync_arr_mem_235176)[(int64_t) 0];\n            if (is_last_group_235200) {\n                if (local_tid_235168 == 0) {\n                    old_counter_235199 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_235165)[sext_i32_i64(srem32(flat_segment_id_235181,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_235156));\n          ",
            "      }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_235201 =\n                            sdiv_up64(groups_per_segment_235156,\n                                      segred_group_sizze_220405);\n                    \n                    x_220414 = 0.0;\n                    x_220415 = 0.0;\n                    for (int64_t i_235202 = 0; i_235202 <\n                         read_per_thread_235201; i_235202++) {\n                        int64_t group_res_id_235203 =\n                                sext_i32_i64(local_tid_235168) *\n                                read_per_thread_235201 + i_235202;\n                        int64_t index_of_group_res_235204 =\n                                sext_i32_i64(flat_segment_id_235181) *\n                                groups_per_segment_235156 + group_res_id_235203;\n                        \n                        if (slt64(group_res_id_235203,\n                                  groups_per_segment_235156)) {\n                            x_220416 = ((__global\n                                         double *) segred_tmp_mem_235161)[index_of_group_res_235204];\n                            x_220417 = ((__global\n                                         double *) segred_tmp_mem_235163)[index_of_group_res_235204];\n                            \n                            double defunc_1_op_res_220418 = x_220414 + x_220416;\n                            double defunc_1_op_res_220419 = x_220415 + x_220417;\n                            \n                            x_220414 = defunc_1_op_res_220418;\n                            x_220415 = defunc_1_op_res_220419;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_235172)[sext_i32_i64(local_tid_235168)] =\n                    x_220414;\n                ((__local\n                  double *) red_arr_mem_235174)[sext_i32_i64(local_tid_235168)] =\n                    x_2",
            "20415;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_235205;\n                    int32_t skip_waves_235206 = 1;\n                    double x_235190;\n                    double x_235191;\n                    double x_235192;\n                    double x_235193;\n                    \n                    offset_235205 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_235168,\n                                  sext_i64_i32(segred_group_sizze_220405))) {\n                            x_235190 = ((__local\n                                         double *) red_arr_mem_235172)[sext_i32_i64(local_tid_235168 +\n                                                                       offset_235205)];\n                            x_235191 = ((__local\n                                         double *) red_arr_mem_235174)[sext_i32_i64(local_tid_235168 +\n                                                                       offset_235205)];\n                        }\n                    }\n                    offset_235205 = 1;\n                    while (slt32(offset_235205, wave_sizze_235170)) {\n                        if (slt32(local_tid_235168 + offset_235205,\n                                  sext_i64_i32(segred_group_sizze_220405)) &&\n                            ((local_tid_235168 - squot32(local_tid_235168,\n                                                         wave_sizze_235170) *\n                              wave_sizze_235170) & (2 * offset_235205 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_235192 = ((volatile __local\n                                             double *) red_arr_mem_235172)[sext_i32_i64(local_tid_235168 +\n                                                            ",
            "               offset_235205)];\n                                x_235193 = ((volatile __local\n                                             double *) red_arr_mem_235174)[sext_i32_i64(local_tid_235168 +\n                                                                           offset_235205)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_235194 = x_235190 +\n                                       x_235192;\n                                double defunc_1_op_res_235195 = x_235191 +\n                                       x_235193;\n                                \n                                x_235190 = defunc_1_op_res_235194;\n                                x_235191 = defunc_1_op_res_235195;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_235172)[sext_i32_i64(local_tid_235168)] =\n                                    x_235190;\n                                ((volatile __local\n                                  double *) red_arr_mem_235174)[sext_i32_i64(local_tid_235168)] =\n                                    x_235191;\n                            }\n                        }\n                        offset_235205 *= 2;\n                    }\n                    while (slt32(skip_waves_235206,\n                                 squot32(sext_i64_i32(segred_group_sizze_220405) +\n                                         wave_sizze_235170 - 1,\n                                         wave_sizze_235170))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_235205 = skip_waves_235206 * wave_sizze_235170;\n                        if (slt32(local_tid_235168 + offset_235205,\n                                  sext_i64_i32(segred_group_sizze_220405)) &&\n    ",
            "                        ((local_tid_235168 - squot32(local_tid_235168,\n                                                         wave_sizze_235170) *\n                              wave_sizze_235170) == 0 &&\n                             (squot32(local_tid_235168, wave_sizze_235170) &\n                              (2 * skip_waves_235206 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_235192 = ((__local\n                                             double *) red_arr_mem_235172)[sext_i32_i64(local_tid_235168 +\n                                                                           offset_235205)];\n                                x_235193 = ((__local\n                                             double *) red_arr_mem_235174)[sext_i32_i64(local_tid_235168 +\n                                                                           offset_235205)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_235194 = x_235190 +\n                                       x_235192;\n                                double defunc_1_op_res_235195 = x_235191 +\n                                       x_235193;\n                                \n                                x_235190 = defunc_1_op_res_235194;\n                                x_235191 = defunc_1_op_res_235195;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_235172)[sext_i32_i64(local_tid_235168)] =\n                                    x_235190;\n                                ((__local\n                                  double *) red_arr_mem_235174)[sext_i32_i64(local_tid_235168)] =\n                                    x_235191;\n                            }\n              ",
            "          }\n                        skip_waves_235206 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_235168 == 0) {\n                            ((__global double *) mem_230702)[gtid_220410 *\n                                                             l_n_m_203643 +\n                                                             gtid_220411] =\n                                x_235190;\n                            ((__global double *) mem_230706)[gtid_220410 *\n                                                             l_n_m_203643 +\n                                                             gtid_220411] =\n                                x_235191;\n                        }\n                    }\n                }\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_220405\n}\n__kernel void mainzisegred_large_221423(__global int *global_failure,\n                                        uint sync_arr_mem_235350_backing_offset_0,\n                                        uint red_arr_mem_235348_backing_offset_1,\n                                        uint red_arr_mem_235346_backing_offset_2,\n                                        uint red_arr_mem_235344_backing_offset_3,\n                                        uint red_arr_mem_235342_backing_offset_4,\n                                        uint red_arr_mem_235340_backing_offset_5,\n                                        int64_t n_203490, int64_t q_l_203495,\n                                        int64_t jump_t_203500,\n                                        int64_t partition_sizze_203577,\n                                        int64_t l_n_m_203643, int64_t i_203670,\n                                        int64_t num_groups_221413,\n                                        int64_t ctx_param_ext_229488,\n                        ",
            "                int64_t ctx_param_ext_229489,\n                                        int64_t ctx_param_ext_229491,\n                                        int64_t groups_per_segment_235318,\n                                        int64_t elements_per_thread_235319,\n                                        int64_t virt_num_groups_235320,\n                                        int64_t threads_per_segment_235322,\n                                        __global unsigned char *ext_mem_229411,\n                                        __global unsigned char *ext_mem_229412,\n                                        __global\n                                        unsigned char *mem_param_229493,\n                                        __global unsigned char *mem_230783,\n                                        __global unsigned char *mem_230787,\n                                        __global unsigned char *mem_230791,\n                                        __global unsigned char *mem_230795,\n                                        __global unsigned char *mem_230799,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235323,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235325,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235327,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235329,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235331,\n                                        __global\n                                        unsigned char *mainzicounter_mem_235333)\n{\n    #define segred_group_sizze_221412 (mainzisegred_group_sizze_221009)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block",
            "_dim2 = 2;\n    volatile unsigned char *sync_arr_mem_235350_backing_5 =\n                           &shared_mem[sync_arr_mem_235350_backing_offset_0];\n    volatile unsigned char *red_arr_mem_235348_backing_4 =\n                           &shared_mem[red_arr_mem_235348_backing_offset_1];\n    volatile unsigned char *red_arr_mem_235346_backing_3 =\n                           &shared_mem[red_arr_mem_235346_backing_offset_2];\n    volatile unsigned char *red_arr_mem_235344_backing_2 =\n                           &shared_mem[red_arr_mem_235344_backing_offset_3];\n    volatile unsigned char *red_arr_mem_235342_backing_1 =\n                           &shared_mem[red_arr_mem_235342_backing_offset_4];\n    volatile unsigned char *red_arr_mem_235340_backing_0 =\n                           &shared_mem[red_arr_mem_235340_backing_offset_5];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235335;\n    int32_t local_tid_235336;\n    int64_t group_sizze_235339;\n    int32_t wave_sizze_235338;\n    int32_t group_tid_235337;\n    \n    global_tid_235335 = get_global_id(0);\n    local_tid_235336 = get_local_id(0);\n    group_sizze_235339 = get_local_size(0);\n    wave_sizze_235338 = LOCKSTEP_WIDTH;\n    group_tid_235337 = get_group_id(0);\n    \n    int32_t phys_tid_221423 = global_tid_235335;\n    __local unsigned char *red_arr_mem_235340;\n    \n    red_arr_mem_235340 = (__local unsigned char *) red_arr_mem_235340_backing_0;\n    \n    __local unsigned char *red_arr_mem_235342;\n    \n    red_arr_mem_235342 = (__local unsigned char *) red_arr_mem_235342_backing_1;\n    \n    __local unsigned char *red_arr_mem_235344;\n    \n    red_arr_mem_235344 = (__local unsigned char *) red_arr_mem_235344_backing_2;\n    \n    __local unsigned char *red_arr_mem_235346;\n    \n    red_arr_mem_235346 = (__local unsigned char *) red_arr_mem_235346_backing_3;\n    \n    __local unsigned char *red_arr_mem_235348;\n    \n    red_arr_mem_235348 = (__local unsigned char *) red_arr_mem_235348_backing_4;\n    \n    __",
            "local unsigned char *sync_arr_mem_235350;\n    \n    sync_arr_mem_235350 = (__local\n                           unsigned char *) sync_arr_mem_235350_backing_5;\n    \n    int32_t phys_group_id_235352;\n    \n    phys_group_id_235352 = get_group_id(0);\n    for (int32_t i_235353 = 0; i_235353 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_235320) - phys_group_id_235352,\n                   sext_i64_i32(num_groups_221413)); i_235353++) {\n        int32_t virt_group_id_235354 = phys_group_id_235352 + i_235353 *\n                sext_i64_i32(num_groups_221413);\n        int32_t flat_segment_id_235355 = squot32(virt_group_id_235354,\n                                                 sext_i64_i32(groups_per_segment_235318));\n        int64_t global_tid_235356 = srem64(sext_i32_i64(virt_group_id_235354) *\n                                           segred_group_sizze_221412 +\n                                           sext_i32_i64(local_tid_235336),\n                                           segred_group_sizze_221412 *\n                                           groups_per_segment_235318);\n        int64_t slice_235357 = l_n_m_203643;\n        int64_t slice_235358 = partition_sizze_203577 * slice_235357;\n        int64_t gtid_221420 = squot64(sext_i32_i64(flat_segment_id_235355),\n                                      slice_235357);\n        int64_t remnant_235359 = sext_i32_i64(flat_segment_id_235355) -\n                gtid_221420 * slice_235357;\n        int64_t gtid_221421 = remnant_235359;\n        int64_t remnant_235360 = remnant_235359 - gtid_221421;\n        int64_t gtid_221422;\n        double x_acc_235361;\n        double x_acc_235362;\n        double x_acc_235363;\n        double x_acc_235364;\n        double x_acc_235365;\n        int64_t chunk_sizze_235366 = smin64(elements_per_thread_235319,\n                                            sdiv_up64(q_l_203495 -\n                                                      global_tid_235356,\n                                                      threa",
            "ds_per_segment_235322));\n        double x_221424;\n        double x_221425;\n        double x_221426;\n        double x_221427;\n        double x_221428;\n        double x_221429;\n        double x_221430;\n        double x_221431;\n        double x_221432;\n        double x_221433;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_235361 = 0.0;\n            x_acc_235362 = 0.0;\n            x_acc_235363 = 0.0;\n            x_acc_235364 = 0.0;\n            x_acc_235365 = 0.0;\n        }\n        for (int64_t i_235382 = 0; i_235382 < chunk_sizze_235366; i_235382++) {\n            gtid_221422 = global_tid_235356 + threads_per_segment_235322 *\n                i_235382;\n            // apply map function\n            {\n                int64_t x_221443;\n                \n                x_221443 = ((__global int64_t *) ext_mem_229412)[gtid_221420 *\n                                                                 l_n_m_203643 +\n                                                                 gtid_221421];\n                \n                double x_221444;\n                \n                x_221444 = ((__global double *) ext_mem_229411)[gtid_221420 *\n                                                                l_n_m_203643 +\n                                                                gtid_221421];\n                \n                int64_t binop_y_228714 = mul64(jump_t_203500, gtid_221421);\n                int64_t binop_y_228715 = smin64(i_203670, binop_y_228714);\n                int64_t index_primexp_228716 = add64((int64_t) 1,\n                                                     binop_y_228715);\n                bool cond_221447 = sle64(n_203490, gtid_221422);\n                int64_t defunc_0_f_res_221448;\n                \n                if (cond_221447) {\n                    defunc_0_f_res_221448 = (int64_t) 0;\n                } else {\n                    int64_t i_221449 = add64(gtid_221422, x_221443);\n                    int64_t defunc_1_add_res_22145",
            "0 = add64((int64_t) 1,\n                                                            i_221449);\n                    \n                    defunc_0_f_res_221448 = defunc_1_add_res_221450;\n                }\n                \n                double defunc_0_f_res_221451;\n                \n                if (cond_221447) {\n                    defunc_0_f_res_221451 = 0.0;\n                } else {\n                    int64_t i_221452 = add64(gtid_221422, x_221443);\n                    double defunc_0_add_arg_221453;\n                    \n                    defunc_0_add_arg_221453 = ((__global\n                                                double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                                            (gtid_221420 *\n                                                                             ctx_param_ext_229489 +\n                                                                             i_221452 *\n                                                                             ctx_param_ext_229491)];\n                    defunc_0_f_res_221451 = defunc_0_add_arg_221453;\n                }\n                \n                int64_t binop_p_221454 = sub64(defunc_0_f_res_221448,\n                                               index_primexp_228716);\n                double defunc_0_f_res_221455 = sitofp_i64_f64(binop_p_221454);\n                double abs_res_221456 = fabs(defunc_0_f_res_221455);\n                double tmp1_221457 = abs_res_221456 / x_221444;\n                double x_221458 = tmp1_221457 * tmp1_221457;\n                double y_221459 = tmp1_221457 * x_221458;\n                double tmp2_221460 = 1.0 - y_221459;\n                double x_221461 = tmp2_221460 * tmp2_221460;\n                double tmp3_221462 = tmp2_221460 * x_221461;\n                double w_j_221463 = defunc_0_f_res_221451 * tmp3_221462;\n                double xw_j_221464 = defunc_0_f_res_221455 * w_j_221463;\n                double x2w_j_221465",
            " = defunc_0_f_res_221455 * xw_j_221464;\n                double x3w_j_221466 = defunc_0_f_res_221455 * x2w_j_221465;\n                double x4w_j_221467 = defunc_0_f_res_221455 * x3w_j_221466;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_221424 = x_acc_235361;\n                    x_221425 = x_acc_235362;\n                    x_221426 = x_acc_235363;\n                    x_221427 = x_acc_235364;\n                    x_221428 = x_acc_235365;\n                }\n                // load new values\n                {\n                    x_221429 = w_j_221463;\n                    x_221430 = xw_j_221464;\n                    x_221431 = x2w_j_221465;\n                    x_221432 = x3w_j_221466;\n                    x_221433 = x4w_j_221467;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_221434 = x_221424 + x_221429;\n                    double defunc_1_op_res_221435 = x_221425 + x_221430;\n                    double defunc_1_op_res_221436 = x_221426 + x_221431;\n                    double defunc_1_op_res_221437 = x_221427 + x_221432;\n                    double defunc_1_op_res_221438 = x_221428 + x_221433;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_235361 = defunc_1_op_res_221434;\n                        x_acc_235362 = defunc_1_op_res_221435;\n                        x_acc_235363 = defunc_1_op_res_221436;\n                        x_acc_235364 = defunc_1_op_res_221437;\n                        x_acc_235365 = defunc_1_op_res_221438;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_221424 = x_acc_235361;\n            x_221425 = x_acc_235362;\n            x_221426 = x_acc_235363;\n            x_221427 = x_acc_235364;\n            x_221428 ",
            "= x_acc_235365;\n            ((__local\n              double *) red_arr_mem_235340)[sext_i32_i64(local_tid_235336)] =\n                x_221424;\n            ((__local\n              double *) red_arr_mem_235342)[sext_i32_i64(local_tid_235336)] =\n                x_221425;\n            ((__local\n              double *) red_arr_mem_235344)[sext_i32_i64(local_tid_235336)] =\n                x_221426;\n            ((__local\n              double *) red_arr_mem_235346)[sext_i32_i64(local_tid_235336)] =\n                x_221427;\n            ((__local\n              double *) red_arr_mem_235348)[sext_i32_i64(local_tid_235336)] =\n                x_221428;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_235383;\n        int32_t skip_waves_235384 = 1;\n        double x_235367;\n        double x_235368;\n        double x_235369;\n        double x_235370;\n        double x_235371;\n        double x_235372;\n        double x_235373;\n        double x_235374;\n        double x_235375;\n        double x_235376;\n        \n        offset_235383 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_235336,\n                      sext_i64_i32(segred_group_sizze_221412))) {\n                x_235367 = ((__local\n                             double *) red_arr_mem_235340)[sext_i32_i64(local_tid_235336 +\n                                                           offset_235383)];\n                x_235368 = ((__local\n                             double *) red_arr_mem_235342)[sext_i32_i64(local_tid_235336 +\n                                                           offset_235383)];\n                x_235369 = ((__local\n                             double *) red_arr_mem_235344)[sext_i32_i64(local_tid_235336 +\n                                                           offset_235383)];\n                x_235370 = ((__local\n                             double *) red_arr_mem_235346)[sext_i32_i64(local_tid_235336 +\n                           ",
            "                                offset_235383)];\n                x_235371 = ((__local\n                             double *) red_arr_mem_235348)[sext_i32_i64(local_tid_235336 +\n                                                           offset_235383)];\n            }\n        }\n        offset_235383 = 1;\n        while (slt32(offset_235383, wave_sizze_235338)) {\n            if (slt32(local_tid_235336 + offset_235383,\n                      sext_i64_i32(segred_group_sizze_221412)) &&\n                ((local_tid_235336 - squot32(local_tid_235336,\n                                             wave_sizze_235338) *\n                  wave_sizze_235338) & (2 * offset_235383 - 1)) == 0) {\n                // read array element\n                {\n                    x_235372 = ((volatile __local\n                                 double *) red_arr_mem_235340)[sext_i32_i64(local_tid_235336 +\n                                                               offset_235383)];\n                    x_235373 = ((volatile __local\n                                 double *) red_arr_mem_235342)[sext_i32_i64(local_tid_235336 +\n                                                               offset_235383)];\n                    x_235374 = ((volatile __local\n                                 double *) red_arr_mem_235344)[sext_i32_i64(local_tid_235336 +\n                                                               offset_235383)];\n                    x_235375 = ((volatile __local\n                                 double *) red_arr_mem_235346)[sext_i32_i64(local_tid_235336 +\n                                                               offset_235383)];\n                    x_235376 = ((volatile __local\n                                 double *) red_arr_mem_235348)[sext_i32_i64(local_tid_235336 +\n                                                               offset_235383)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_235377 = x",
            "_235367 + x_235372;\n                    double defunc_1_op_res_235378 = x_235368 + x_235373;\n                    double defunc_1_op_res_235379 = x_235369 + x_235374;\n                    double defunc_1_op_res_235380 = x_235370 + x_235375;\n                    double defunc_1_op_res_235381 = x_235371 + x_235376;\n                    \n                    x_235367 = defunc_1_op_res_235377;\n                    x_235368 = defunc_1_op_res_235378;\n                    x_235369 = defunc_1_op_res_235379;\n                    x_235370 = defunc_1_op_res_235380;\n                    x_235371 = defunc_1_op_res_235381;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_235340)[sext_i32_i64(local_tid_235336)] =\n                        x_235367;\n                    ((volatile __local\n                      double *) red_arr_mem_235342)[sext_i32_i64(local_tid_235336)] =\n                        x_235368;\n                    ((volatile __local\n                      double *) red_arr_mem_235344)[sext_i32_i64(local_tid_235336)] =\n                        x_235369;\n                    ((volatile __local\n                      double *) red_arr_mem_235346)[sext_i32_i64(local_tid_235336)] =\n                        x_235370;\n                    ((volatile __local\n                      double *) red_arr_mem_235348)[sext_i32_i64(local_tid_235336)] =\n                        x_235371;\n                }\n            }\n            offset_235383 *= 2;\n        }\n        while (slt32(skip_waves_235384,\n                     squot32(sext_i64_i32(segred_group_sizze_221412) +\n                             wave_sizze_235338 - 1, wave_sizze_235338))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_235383 = skip_waves_235384 * wave_sizze_235338;\n            if (slt32(local_tid_235336 + offset_235383,\n                      sext_i64_i32(segred_group_sizze_221412)) &&\n                ((local_t",
            "id_235336 - squot32(local_tid_235336,\n                                             wave_sizze_235338) *\n                  wave_sizze_235338) == 0 && (squot32(local_tid_235336,\n                                                      wave_sizze_235338) & (2 *\n                                                                            skip_waves_235384 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_235372 = ((__local\n                                 double *) red_arr_mem_235340)[sext_i32_i64(local_tid_235336 +\n                                                               offset_235383)];\n                    x_235373 = ((__local\n                                 double *) red_arr_mem_235342)[sext_i32_i64(local_tid_235336 +\n                                                               offset_235383)];\n                    x_235374 = ((__local\n                                 double *) red_arr_mem_235344)[sext_i32_i64(local_tid_235336 +\n                                                               offset_235383)];\n                    x_235375 = ((__local\n                                 double *) red_arr_mem_235346)[sext_i32_i64(local_tid_235336 +\n                                                               offset_235383)];\n                    x_235376 = ((__local\n                                 double *) red_arr_mem_235348)[sext_i32_i64(local_tid_235336 +\n                                                               offset_235383)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_235377 = x_235367 + x_235372;\n                    double defunc_1_op_res_235378 = x_235368 + x_235373;\n                    double defunc_1_op_res_235379 = x_235369 + x_235374;\n                    double defunc_1_op_res_235380 = x_235370 + x_235375;\n                    double defunc",
            "_1_op_res_235381 = x_235371 + x_235376;\n                    \n                    x_235367 = defunc_1_op_res_235377;\n                    x_235368 = defunc_1_op_res_235378;\n                    x_235369 = defunc_1_op_res_235379;\n                    x_235370 = defunc_1_op_res_235380;\n                    x_235371 = defunc_1_op_res_235381;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_235340)[sext_i32_i64(local_tid_235336)] =\n                        x_235367;\n                    ((__local\n                      double *) red_arr_mem_235342)[sext_i32_i64(local_tid_235336)] =\n                        x_235368;\n                    ((__local\n                      double *) red_arr_mem_235344)[sext_i32_i64(local_tid_235336)] =\n                        x_235369;\n                    ((__local\n                      double *) red_arr_mem_235346)[sext_i32_i64(local_tid_235336)] =\n                        x_235370;\n                    ((__local\n                      double *) red_arr_mem_235348)[sext_i32_i64(local_tid_235336)] =\n                        x_235371;\n                }\n            }\n            skip_waves_235384 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_235336) == (int64_t) 0) {\n                x_acc_235361 = x_235367;\n                x_acc_235362 = x_235368;\n                x_acc_235363 = x_235369;\n                x_acc_235364 = x_235370;\n                x_acc_235365 = x_235371;\n            }\n        }\n        if (groups_per_segment_235318 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_235336 == 0) {\n                    ((__global double *) mem_230783)[gtid_221420 *\n                                                     l_n_m_203643 +\n                                         ",
            "            gtid_221421] =\n                        x_acc_235361;\n                    ((__global double *) mem_230787)[gtid_221420 *\n                                                     l_n_m_203643 +\n                                                     gtid_221421] =\n                        x_acc_235362;\n                    ((__global double *) mem_230791)[gtid_221420 *\n                                                     l_n_m_203643 +\n                                                     gtid_221421] =\n                        x_acc_235363;\n                    ((__global double *) mem_230795)[gtid_221420 *\n                                                     l_n_m_203643 +\n                                                     gtid_221421] =\n                        x_acc_235364;\n                    ((__global double *) mem_230799)[gtid_221420 *\n                                                     l_n_m_203643 +\n                                                     gtid_221421] =\n                        x_acc_235365;\n                }\n            }\n        } else {\n            int32_t old_counter_235385;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_235336 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_235323)[sext_i32_i64(virt_group_id_235354)] =\n                        x_acc_235361;\n                    ((__global\n                      double *) segred_tmp_mem_235325)[sext_i32_i64(virt_group_id_235354)] =\n                        x_acc_235362;\n                    ((__global\n                      double *) segred_tmp_mem_235327)[sext_i32_i64(virt_group_id_235354)] =\n                        x_acc_235363;\n                    ((__global\n                      double *) segred_tmp_mem_235329)[sext_i32_i64(virt_group_id_235354)] =\n                        x_acc_235364;\n                    ((__global\n                      double *) segred_tmp_mem_235331)[sex",
            "t_i32_i64(virt_group_id_235354)] =\n                        x_acc_235365;\n                    mem_fence_global();\n                    old_counter_235385 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_235333)[sext_i32_i64(srem32(flat_segment_id_235355,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_235350)[(int64_t) 0] =\n                        old_counter_235385 == groups_per_segment_235318 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_235386;\n            \n            is_last_group_235386 = ((__local\n                                     bool *) sync_arr_mem_235350)[(int64_t) 0];\n            if (is_last_group_235386) {\n                if (local_tid_235336 == 0) {\n                    old_counter_235385 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_235333)[sext_i32_i64(srem32(flat_segment_id_235355,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_235318));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_235387 =\n                            sdiv_up64(groups_per_segment_235318,\n                                      segred_group_sizze_221412);\n                    \n                    x_221424 = 0.0;\n                    x_221425 = 0.0;\n                    x_221426 = 0.0;\n                    x_221427 = 0.0;",
            "\n                    x_221428 = 0.0;\n                    for (int64_t i_235388 = 0; i_235388 <\n                         read_per_thread_235387; i_235388++) {\n                        int64_t group_res_id_235389 =\n                                sext_i32_i64(local_tid_235336) *\n                                read_per_thread_235387 + i_235388;\n                        int64_t index_of_group_res_235390 =\n                                sext_i32_i64(flat_segment_id_235355) *\n                                groups_per_segment_235318 + group_res_id_235389;\n                        \n                        if (slt64(group_res_id_235389,\n                                  groups_per_segment_235318)) {\n                            x_221429 = ((__global\n                                         double *) segred_tmp_mem_235323)[index_of_group_res_235390];\n                            x_221430 = ((__global\n                                         double *) segred_tmp_mem_235325)[index_of_group_res_235390];\n                            x_221431 = ((__global\n                                         double *) segred_tmp_mem_235327)[index_of_group_res_235390];\n                            x_221432 = ((__global\n                                         double *) segred_tmp_mem_235329)[index_of_group_res_235390];\n                            x_221433 = ((__global\n                                         double *) segred_tmp_mem_235331)[index_of_group_res_235390];\n                            \n                            double defunc_1_op_res_221434 = x_221424 + x_221429;\n                            double defunc_1_op_res_221435 = x_221425 + x_221430;\n                            double defunc_1_op_res_221436 = x_221426 + x_221431;\n                            double defunc_1_op_res_221437 = x_221427 + x_221432;\n                            double defunc_1_op_res_221438 = x_221428 + x_221433;\n                            \n                            x_221424 = defunc_1_op_res_221434;\n              ",
            "              x_221425 = defunc_1_op_res_221435;\n                            x_221426 = defunc_1_op_res_221436;\n                            x_221427 = defunc_1_op_res_221437;\n                            x_221428 = defunc_1_op_res_221438;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_235340)[sext_i32_i64(local_tid_235336)] =\n                    x_221424;\n                ((__local\n                  double *) red_arr_mem_235342)[sext_i32_i64(local_tid_235336)] =\n                    x_221425;\n                ((__local\n                  double *) red_arr_mem_235344)[sext_i32_i64(local_tid_235336)] =\n                    x_221426;\n                ((__local\n                  double *) red_arr_mem_235346)[sext_i32_i64(local_tid_235336)] =\n                    x_221427;\n                ((__local\n                  double *) red_arr_mem_235348)[sext_i32_i64(local_tid_235336)] =\n                    x_221428;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_235391;\n                    int32_t skip_waves_235392 = 1;\n                    double x_235367;\n                    double x_235368;\n                    double x_235369;\n                    double x_235370;\n                    double x_235371;\n                    double x_235372;\n                    double x_235373;\n                    double x_235374;\n                    double x_235375;\n                    double x_235376;\n                    \n                    offset_235391 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_235336,\n                                  sext_i64_i32(segred_group_sizze_221412))) {\n                            x_235367 = ((__local\n                                         double *) red_arr_mem_235340)[sext_i32_i64(local_tid_23533",
            "6 +\n                                                                       offset_235391)];\n                            x_235368 = ((__local\n                                         double *) red_arr_mem_235342)[sext_i32_i64(local_tid_235336 +\n                                                                       offset_235391)];\n                            x_235369 = ((__local\n                                         double *) red_arr_mem_235344)[sext_i32_i64(local_tid_235336 +\n                                                                       offset_235391)];\n                            x_235370 = ((__local\n                                         double *) red_arr_mem_235346)[sext_i32_i64(local_tid_235336 +\n                                                                       offset_235391)];\n                            x_235371 = ((__local\n                                         double *) red_arr_mem_235348)[sext_i32_i64(local_tid_235336 +\n                                                                       offset_235391)];\n                        }\n                    }\n                    offset_235391 = 1;\n                    while (slt32(offset_235391, wave_sizze_235338)) {\n                        if (slt32(local_tid_235336 + offset_235391,\n                                  sext_i64_i32(segred_group_sizze_221412)) &&\n                            ((local_tid_235336 - squot32(local_tid_235336,\n                                                         wave_sizze_235338) *\n                              wave_sizze_235338) & (2 * offset_235391 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_235372 = ((volatile __local\n                                             double *) red_arr_mem_235340)[sext_i32_i64(local_tid_235336 +\n                                                                           offset_235391)];\n                                x_23537",
            "3 = ((volatile __local\n                                             double *) red_arr_mem_235342)[sext_i32_i64(local_tid_235336 +\n                                                                           offset_235391)];\n                                x_235374 = ((volatile __local\n                                             double *) red_arr_mem_235344)[sext_i32_i64(local_tid_235336 +\n                                                                           offset_235391)];\n                                x_235375 = ((volatile __local\n                                             double *) red_arr_mem_235346)[sext_i32_i64(local_tid_235336 +\n                                                                           offset_235391)];\n                                x_235376 = ((volatile __local\n                                             double *) red_arr_mem_235348)[sext_i32_i64(local_tid_235336 +\n                                                                           offset_235391)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_235377 = x_235367 +\n                                       x_235372;\n                                double defunc_1_op_res_235378 = x_235368 +\n                                       x_235373;\n                                double defunc_1_op_res_235379 = x_235369 +\n                                       x_235374;\n                                double defunc_1_op_res_235380 = x_235370 +\n                                       x_235375;\n                                double defunc_1_op_res_235381 = x_235371 +\n                                       x_235376;\n                                \n                                x_235367 = defunc_1_op_res_235377;\n                                x_235368 = defunc_1_op_res_235378;\n                                x_235369 = defunc_1_op_res_235379;\n                        ",
            "        x_235370 = defunc_1_op_res_235380;\n                                x_235371 = defunc_1_op_res_235381;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_235340)[sext_i32_i64(local_tid_235336)] =\n                                    x_235367;\n                                ((volatile __local\n                                  double *) red_arr_mem_235342)[sext_i32_i64(local_tid_235336)] =\n                                    x_235368;\n                                ((volatile __local\n                                  double *) red_arr_mem_235344)[sext_i32_i64(local_tid_235336)] =\n                                    x_235369;\n                                ((volatile __local\n                                  double *) red_arr_mem_235346)[sext_i32_i64(local_tid_235336)] =\n                                    x_235370;\n                                ((volatile __local\n                                  double *) red_arr_mem_235348)[sext_i32_i64(local_tid_235336)] =\n                                    x_235371;\n                            }\n                        }\n                        offset_235391 *= 2;\n                    }\n                    while (slt32(skip_waves_235392,\n                                 squot32(sext_i64_i32(segred_group_sizze_221412) +\n                                         wave_sizze_235338 - 1,\n                                         wave_sizze_235338))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_235391 = skip_waves_235392 * wave_sizze_235338;\n                        if (slt32(local_tid_235336 + offset_235391,\n                                  sext_i64_i32(segred_group_sizze_221412)) &&\n                            ((local_tid_235336 - squot32(local_tid_235336,\n                                                         wa",
            "ve_sizze_235338) *\n                              wave_sizze_235338) == 0 &&\n                             (squot32(local_tid_235336, wave_sizze_235338) &\n                              (2 * skip_waves_235392 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_235372 = ((__local\n                                             double *) red_arr_mem_235340)[sext_i32_i64(local_tid_235336 +\n                                                                           offset_235391)];\n                                x_235373 = ((__local\n                                             double *) red_arr_mem_235342)[sext_i32_i64(local_tid_235336 +\n                                                                           offset_235391)];\n                                x_235374 = ((__local\n                                             double *) red_arr_mem_235344)[sext_i32_i64(local_tid_235336 +\n                                                                           offset_235391)];\n                                x_235375 = ((__local\n                                             double *) red_arr_mem_235346)[sext_i32_i64(local_tid_235336 +\n                                                                           offset_235391)];\n                                x_235376 = ((__local\n                                             double *) red_arr_mem_235348)[sext_i32_i64(local_tid_235336 +\n                                                                           offset_235391)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_235377 = x_235367 +\n                                       x_235372;\n                                double defunc_1_op_res_235378 = x_235368 +\n                                       x_235373;\n                                double defunc_1_op_res_235379 = x_235369 +",
            "\n                                       x_235374;\n                                double defunc_1_op_res_235380 = x_235370 +\n                                       x_235375;\n                                double defunc_1_op_res_235381 = x_235371 +\n                                       x_235376;\n                                \n                                x_235367 = defunc_1_op_res_235377;\n                                x_235368 = defunc_1_op_res_235378;\n                                x_235369 = defunc_1_op_res_235379;\n                                x_235370 = defunc_1_op_res_235380;\n                                x_235371 = defunc_1_op_res_235381;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_235340)[sext_i32_i64(local_tid_235336)] =\n                                    x_235367;\n                                ((__local\n                                  double *) red_arr_mem_235342)[sext_i32_i64(local_tid_235336)] =\n                                    x_235368;\n                                ((__local\n                                  double *) red_arr_mem_235344)[sext_i32_i64(local_tid_235336)] =\n                                    x_235369;\n                                ((__local\n                                  double *) red_arr_mem_235346)[sext_i32_i64(local_tid_235336)] =\n                                    x_235370;\n                                ((__local\n                                  double *) red_arr_mem_235348)[sext_i32_i64(local_tid_235336)] =\n                                    x_235371;\n                            }\n                        }\n                        skip_waves_235392 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_235336 == 0) {\n                      ",
            "      ((__global double *) mem_230783)[gtid_221420 *\n                                                             l_n_m_203643 +\n                                                             gtid_221421] =\n                                x_235367;\n                            ((__global double *) mem_230787)[gtid_221420 *\n                                                             l_n_m_203643 +\n                                                             gtid_221421] =\n                                x_235368;\n                            ((__global double *) mem_230791)[gtid_221420 *\n                                                             l_n_m_203643 +\n                                                             gtid_221421] =\n                                x_235369;\n                            ((__global double *) mem_230795)[gtid_221420 *\n                                                             l_n_m_203643 +\n                                                             gtid_221421] =\n                                x_235370;\n                            ((__global double *) mem_230799)[gtid_221420 *\n                                                             l_n_m_203643 +\n                                                             gtid_221421] =\n                                x_235371;\n                        }\n                    }\n                }\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_221412\n}\n__kernel void mainzisegred_large_221521(__global int *global_failure,\n                                        uint sync_arr_mem_235458_backing_offset_0,\n                                        uint red_arr_mem_235456_backing_offset_1,\n                                        uint red_arr_mem_235454_backing_offset_2,\n                                        int64_t n_203490, int64_t q_l_203495,\n                                        int64_t jump_t_203",
            "500,\n                                        int64_t partition_sizze_203577,\n                                        int64_t l_n_m_203643, int64_t i_203670,\n                                        int64_t num_groups_221514,\n                                        int64_t ctx_param_ext_229488,\n                                        int64_t ctx_param_ext_229489,\n                                        int64_t ctx_param_ext_229491,\n                                        int64_t groups_per_segment_235438,\n                                        int64_t elements_per_thread_235439,\n                                        int64_t virt_num_groups_235440,\n                                        int64_t threads_per_segment_235442,\n                                        __global unsigned char *ext_mem_229411,\n                                        __global unsigned char *ext_mem_229412,\n                                        __global\n                                        unsigned char *mem_param_229493,\n                                        __global unsigned char *mem_230551,\n                                        __global unsigned char *mem_230804,\n                                        __global unsigned char *mem_230808,\n                                        __global unsigned char *mem_230812,\n                                        __global unsigned char *mem_230816,\n                                        __global unsigned char *mem_230820,\n                                        __global unsigned char *mem_230825,\n                                        __global unsigned char *mem_230829,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235443,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235445,\n                                        __global\n                                        unsigned char *mainzicounter_mem_2",
            "35447)\n{\n    #define segred_group_sizze_221513 (mainzisegred_group_sizze_220883)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *sync_arr_mem_235458_backing_2 =\n                           &shared_mem[sync_arr_mem_235458_backing_offset_0];\n    volatile unsigned char *red_arr_mem_235456_backing_1 =\n                           &shared_mem[red_arr_mem_235456_backing_offset_1];\n    volatile unsigned char *red_arr_mem_235454_backing_0 =\n                           &shared_mem[red_arr_mem_235454_backing_offset_2];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235449;\n    int32_t local_tid_235450;\n    int64_t group_sizze_235453;\n    int32_t wave_sizze_235452;\n    int32_t group_tid_235451;\n    \n    global_tid_235449 = get_global_id(0);\n    local_tid_235450 = get_local_id(0);\n    group_sizze_235453 = get_local_size(0);\n    wave_sizze_235452 = LOCKSTEP_WIDTH;\n    group_tid_235451 = get_group_id(0);\n    \n    int32_t phys_tid_221521 = global_tid_235449;\n    __local unsigned char *red_arr_mem_235454;\n    \n    red_arr_mem_235454 = (__local unsigned char *) red_arr_mem_235454_backing_0;\n    \n    __local unsigned char *red_arr_mem_235456;\n    \n    red_arr_mem_235456 = (__local unsigned char *) red_arr_mem_235456_backing_1;\n    \n    __local unsigned char *sync_arr_mem_235458;\n    \n    sync_arr_mem_235458 = (__local\n                           unsigned char *) sync_arr_mem_235458_backing_2;\n    \n    int32_t phys_group_id_235460;\n    \n    phys_group_id_235460 = get_group_id(0);\n    for (int32_t i_235461 = 0; i_235461 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_235440) - phys_group_id_235460,\n                   sext_i64_i32(num_groups_221514)); i_235461++) {\n        int32_t virt_group_id_235462 = phys_group_id_235460 + i_235461 *\n                sext_i64_i32(num_groups_221514);\n        int32_t flat_segment_id_235463 = squot32(virt_group_id_235462,\n                              ",
            "                   sext_i64_i32(groups_per_segment_235438));\n        int64_t global_tid_235464 = srem64(sext_i32_i64(virt_group_id_235462) *\n                                           segred_group_sizze_221513 +\n                                           sext_i32_i64(local_tid_235450),\n                                           segred_group_sizze_221513 *\n                                           groups_per_segment_235438);\n        int64_t slice_235465 = l_n_m_203643;\n        int64_t slice_235466 = partition_sizze_203577 * slice_235465;\n        int64_t gtid_221518 = squot64(sext_i32_i64(flat_segment_id_235463),\n                                      slice_235465);\n        int64_t remnant_235467 = sext_i32_i64(flat_segment_id_235463) -\n                gtid_221518 * slice_235465;\n        int64_t gtid_221519 = remnant_235467;\n        int64_t remnant_235468 = remnant_235467 - gtid_221519;\n        int64_t gtid_221520;\n        double x_acc_235469;\n        double x_acc_235470;\n        int64_t chunk_sizze_235471 = smin64(elements_per_thread_235439,\n                                            sdiv_up64(q_l_203495 -\n                                                      global_tid_235464,\n                                                      threads_per_segment_235442));\n        double x_221522;\n        double x_221523;\n        double x_221524;\n        double x_221525;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_235469 = 0.0;\n            x_acc_235470 = 0.0;\n        }\n        for (int64_t i_235478 = 0; i_235478 < chunk_sizze_235471; i_235478++) {\n            gtid_221520 = global_tid_235464 + threads_per_segment_235442 *\n                i_235478;\n            // apply map function\n            {\n                int64_t x_221538;\n                \n                x_221538 = ((__global int64_t *) ext_mem_229412)[gtid_221518 *\n                                                                 l_n_m_203643 +\n                                        ",
            "                         gtid_221519];\n                \n                double x_221539;\n                \n                x_221539 = ((__global double *) ext_mem_229411)[gtid_221518 *\n                                                                l_n_m_203643 +\n                                                                gtid_221519];\n                \n                int64_t binop_y_228709 = mul64(jump_t_203500, gtid_221519);\n                int64_t binop_y_228710 = smin64(i_203670, binop_y_228709);\n                int64_t index_primexp_228711 = add64((int64_t) 1,\n                                                     binop_y_228710);\n                double a12_221541;\n                \n                a12_221541 = ((__global double *) mem_230804)[gtid_221518 *\n                                                              l_n_m_203643 +\n                                                              gtid_221519];\n                \n                double b12_221542;\n                \n                b12_221542 = ((__global double *) mem_230808)[gtid_221518 *\n                                                              l_n_m_203643 +\n                                                              gtid_221519];\n                \n                double c12_221543;\n                \n                c12_221543 = ((__global double *) mem_230812)[gtid_221518 *\n                                                              l_n_m_203643 +\n                                                              gtid_221519];\n                \n                double b2_221544;\n                \n                b2_221544 = ((__global double *) mem_230816)[gtid_221518 *\n                                                             l_n_m_203643 +\n                                                             gtid_221519];\n                \n                double c2_221545;\n                \n                c2_221545 = ((__global double *) mem_230820)[gtid_221518 *\n                                         ",
            "                    l_n_m_203643 +\n                                                             gtid_221519];\n                \n                bool cond_221547 = sle64(n_203490, gtid_221520);\n                int64_t defunc_0_f_res_221548;\n                \n                if (cond_221547) {\n                    defunc_0_f_res_221548 = (int64_t) 0;\n                } else {\n                    int64_t i_221549 = add64(gtid_221520, x_221538);\n                    int64_t defunc_1_add_res_221550 = add64((int64_t) 1,\n                                                            i_221549);\n                    \n                    defunc_0_f_res_221548 = defunc_1_add_res_221550;\n                }\n                \n                double defunc_0_f_res_221551;\n                \n                if (cond_221547) {\n                    defunc_0_f_res_221551 = 0.0;\n                } else {\n                    int64_t i_221552 = add64(gtid_221520, x_221538);\n                    double defunc_0_add_arg_221553;\n                    \n                    defunc_0_add_arg_221553 = ((__global\n                                                double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                                            (gtid_221518 *\n                                                                             ctx_param_ext_229489 +\n                                                                             i_221552 *\n                                                                             ctx_param_ext_229491)];\n                    defunc_0_f_res_221551 = defunc_0_add_arg_221553;\n                }\n                \n                int64_t binop_p_221554 = sub64(defunc_0_f_res_221548,\n                                               index_primexp_228711);\n                double defunc_0_f_res_221555 = sitofp_i64_f64(binop_p_221554);\n                double abs_res_221556 = fabs(defunc_0_f_res_221555);\n                double tmp1_221557 = abs_res_22",
            "1556 / x_221539;\n                double x_221558 = tmp1_221557 * tmp1_221557;\n                double y_221559 = tmp1_221557 * x_221558;\n                double tmp2_221560 = 1.0 - y_221559;\n                double x_221561 = tmp2_221560 * tmp2_221560;\n                double tmp3_221562 = tmp2_221560 * x_221561;\n                double tmp4_221563 = defunc_0_f_res_221551 * tmp3_221562;\n                double defunc_1_f_res_221564 = defunc_0_f_res_221555 *\n                       tmp4_221563;\n                double defunc_1_f_res_221565 = defunc_0_f_res_221555 *\n                       defunc_1_f_res_221564;\n                double defunc_0_f_res_221566;\n                \n                if (cond_221547) {\n                    defunc_0_f_res_221566 = 0.0;\n                } else {\n                    int64_t i_221567 = add64(gtid_221520, x_221538);\n                    double defunc_0_add_arg_221568;\n                    \n                    defunc_0_add_arg_221568 = ((__global\n                                                double *) mem_230551)[gtid_221518 *\n                                                                      n_203490 +\n                                                                      i_221567];\n                    defunc_0_f_res_221566 = defunc_0_add_arg_221568;\n                }\n                \n                double x_221569 = a12_221541 * tmp4_221563;\n                double y_221570 = b12_221542 * defunc_1_f_res_221564;\n                double x_221571 = x_221569 + y_221570;\n                double y_221572 = c12_221543 * defunc_1_f_res_221565;\n                double x_221573 = x_221571 + y_221572;\n                double defunc_9_fit_fun_res_221574 = defunc_0_f_res_221566 *\n                       x_221573;\n                double x_221575 = b12_221542 * tmp4_221563;\n                double y_221576 = b2_221544 * defunc_1_f_res_221564;\n                double x_221577 = x_221575 + y_221576;\n                double y_221578 = c2_221545 * defunc_1_f_res_22156",
            "5;\n                double x_221579 = x_221577 + y_221578;\n                double defunc_9_slope_fun_res_221580 = defunc_0_f_res_221566 *\n                       x_221579;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_221522 = x_acc_235469;\n                    x_221523 = x_acc_235470;\n                }\n                // load new values\n                {\n                    x_221524 = defunc_9_fit_fun_res_221574;\n                    x_221525 = defunc_9_slope_fun_res_221580;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_221526 = x_221522 + x_221524;\n                    double defunc_1_op_res_221527 = x_221523 + x_221525;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_235469 = defunc_1_op_res_221526;\n                        x_acc_235470 = defunc_1_op_res_221527;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_221522 = x_acc_235469;\n            x_221523 = x_acc_235470;\n            ((__local\n              double *) red_arr_mem_235454)[sext_i32_i64(local_tid_235450)] =\n                x_221522;\n            ((__local\n              double *) red_arr_mem_235456)[sext_i32_i64(local_tid_235450)] =\n                x_221523;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_235479;\n        int32_t skip_waves_235480 = 1;\n        double x_235472;\n        double x_235473;\n        double x_235474;\n        double x_235475;\n        \n        offset_235479 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_235450,\n                      sext_i64_i32(segred_group_sizze_221513))) {\n                x_235472 = ((__local\n                             doubl",
            "e *) red_arr_mem_235454)[sext_i32_i64(local_tid_235450 +\n                                                           offset_235479)];\n                x_235473 = ((__local\n                             double *) red_arr_mem_235456)[sext_i32_i64(local_tid_235450 +\n                                                           offset_235479)];\n            }\n        }\n        offset_235479 = 1;\n        while (slt32(offset_235479, wave_sizze_235452)) {\n            if (slt32(local_tid_235450 + offset_235479,\n                      sext_i64_i32(segred_group_sizze_221513)) &&\n                ((local_tid_235450 - squot32(local_tid_235450,\n                                             wave_sizze_235452) *\n                  wave_sizze_235452) & (2 * offset_235479 - 1)) == 0) {\n                // read array element\n                {\n                    x_235474 = ((volatile __local\n                                 double *) red_arr_mem_235454)[sext_i32_i64(local_tid_235450 +\n                                                               offset_235479)];\n                    x_235475 = ((volatile __local\n                                 double *) red_arr_mem_235456)[sext_i32_i64(local_tid_235450 +\n                                                               offset_235479)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_235476 = x_235472 + x_235474;\n                    double defunc_1_op_res_235477 = x_235473 + x_235475;\n                    \n                    x_235472 = defunc_1_op_res_235476;\n                    x_235473 = defunc_1_op_res_235477;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_235454)[sext_i32_i64(local_tid_235450)] =\n                        x_235472;\n                    ((volatile __local\n                      double *) red_arr_mem_235456)[sext_i32_i64(local_tid_235450)] =\n  ",
            "                      x_235473;\n                }\n            }\n            offset_235479 *= 2;\n        }\n        while (slt32(skip_waves_235480,\n                     squot32(sext_i64_i32(segred_group_sizze_221513) +\n                             wave_sizze_235452 - 1, wave_sizze_235452))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_235479 = skip_waves_235480 * wave_sizze_235452;\n            if (slt32(local_tid_235450 + offset_235479,\n                      sext_i64_i32(segred_group_sizze_221513)) &&\n                ((local_tid_235450 - squot32(local_tid_235450,\n                                             wave_sizze_235452) *\n                  wave_sizze_235452) == 0 && (squot32(local_tid_235450,\n                                                      wave_sizze_235452) & (2 *\n                                                                            skip_waves_235480 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_235474 = ((__local\n                                 double *) red_arr_mem_235454)[sext_i32_i64(local_tid_235450 +\n                                                               offset_235479)];\n                    x_235475 = ((__local\n                                 double *) red_arr_mem_235456)[sext_i32_i64(local_tid_235450 +\n                                                               offset_235479)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_235476 = x_235472 + x_235474;\n                    double defunc_1_op_res_235477 = x_235473 + x_235475;\n                    \n                    x_235472 = defunc_1_op_res_235476;\n                    x_235473 = defunc_1_op_res_235477;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_a",
            "rr_mem_235454)[sext_i32_i64(local_tid_235450)] =\n                        x_235472;\n                    ((__local\n                      double *) red_arr_mem_235456)[sext_i32_i64(local_tid_235450)] =\n                        x_235473;\n                }\n            }\n            skip_waves_235480 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_235450) == (int64_t) 0) {\n                x_acc_235469 = x_235472;\n                x_acc_235470 = x_235473;\n            }\n        }\n        if (groups_per_segment_235438 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_235450 == 0) {\n                    ((__global double *) mem_230825)[gtid_221518 *\n                                                     l_n_m_203643 +\n                                                     gtid_221519] =\n                        x_acc_235469;\n                    ((__global double *) mem_230829)[gtid_221518 *\n                                                     l_n_m_203643 +\n                                                     gtid_221519] =\n                        x_acc_235470;\n                }\n            }\n        } else {\n            int32_t old_counter_235481;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_235450 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_235443)[sext_i32_i64(virt_group_id_235462)] =\n                        x_acc_235469;\n                    ((__global\n                      double *) segred_tmp_mem_235445)[sext_i32_i64(virt_group_id_235462)] =\n                        x_acc_235470;\n                    mem_fence_global();\n                    old_counter_235481 =\n                        atomic_add_i32_global(&((volatile __global\n                                             ",
            "    int *) mainzicounter_mem_235447)[sext_i32_i64(srem32(flat_segment_id_235463,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_235458)[(int64_t) 0] =\n                        old_counter_235481 == groups_per_segment_235438 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_235482;\n            \n            is_last_group_235482 = ((__local\n                                     bool *) sync_arr_mem_235458)[(int64_t) 0];\n            if (is_last_group_235482) {\n                if (local_tid_235450 == 0) {\n                    old_counter_235481 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_235447)[sext_i32_i64(srem32(flat_segment_id_235463,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_235438));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_235483 =\n                            sdiv_up64(groups_per_segment_235438,\n                                      segred_group_sizze_221513);\n                    \n                    x_221522 = 0.0;\n                    x_221523 = 0.0;\n                    for (int64_t i_235484 = 0; i_235484 <\n                         read_per_thread_235483; i_235484++) {\n                        int64_t group_res_id_235485 =\n                                sext_i32_i64(local_tid_235450) *\n                                read_per_thread_235483 + i_235484;\n                        int64_",
            "t index_of_group_res_235486 =\n                                sext_i32_i64(flat_segment_id_235463) *\n                                groups_per_segment_235438 + group_res_id_235485;\n                        \n                        if (slt64(group_res_id_235485,\n                                  groups_per_segment_235438)) {\n                            x_221524 = ((__global\n                                         double *) segred_tmp_mem_235443)[index_of_group_res_235486];\n                            x_221525 = ((__global\n                                         double *) segred_tmp_mem_235445)[index_of_group_res_235486];\n                            \n                            double defunc_1_op_res_221526 = x_221522 + x_221524;\n                            double defunc_1_op_res_221527 = x_221523 + x_221525;\n                            \n                            x_221522 = defunc_1_op_res_221526;\n                            x_221523 = defunc_1_op_res_221527;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_235454)[sext_i32_i64(local_tid_235450)] =\n                    x_221522;\n                ((__local\n                  double *) red_arr_mem_235456)[sext_i32_i64(local_tid_235450)] =\n                    x_221523;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_235487;\n                    int32_t skip_waves_235488 = 1;\n                    double x_235472;\n                    double x_235473;\n                    double x_235474;\n                    double x_235475;\n                    \n                    offset_235487 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_235450,\n                                  sext_i64_i32(segred_group_sizze_221513))) {\n                            x_235472 = ((__loc",
            "al\n                                         double *) red_arr_mem_235454)[sext_i32_i64(local_tid_235450 +\n                                                                       offset_235487)];\n                            x_235473 = ((__local\n                                         double *) red_arr_mem_235456)[sext_i32_i64(local_tid_235450 +\n                                                                       offset_235487)];\n                        }\n                    }\n                    offset_235487 = 1;\n                    while (slt32(offset_235487, wave_sizze_235452)) {\n                        if (slt32(local_tid_235450 + offset_235487,\n                                  sext_i64_i32(segred_group_sizze_221513)) &&\n                            ((local_tid_235450 - squot32(local_tid_235450,\n                                                         wave_sizze_235452) *\n                              wave_sizze_235452) & (2 * offset_235487 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_235474 = ((volatile __local\n                                             double *) red_arr_mem_235454)[sext_i32_i64(local_tid_235450 +\n                                                                           offset_235487)];\n                                x_235475 = ((volatile __local\n                                             double *) red_arr_mem_235456)[sext_i32_i64(local_tid_235450 +\n                                                                           offset_235487)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_235476 = x_235472 +\n                                       x_235474;\n                                double defunc_1_op_res_235477 = x_235473 +\n                                       x_235475;\n                               ",
            " \n                                x_235472 = defunc_1_op_res_235476;\n                                x_235473 = defunc_1_op_res_235477;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_235454)[sext_i32_i64(local_tid_235450)] =\n                                    x_235472;\n                                ((volatile __local\n                                  double *) red_arr_mem_235456)[sext_i32_i64(local_tid_235450)] =\n                                    x_235473;\n                            }\n                        }\n                        offset_235487 *= 2;\n                    }\n                    while (slt32(skip_waves_235488,\n                                 squot32(sext_i64_i32(segred_group_sizze_221513) +\n                                         wave_sizze_235452 - 1,\n                                         wave_sizze_235452))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_235487 = skip_waves_235488 * wave_sizze_235452;\n                        if (slt32(local_tid_235450 + offset_235487,\n                                  sext_i64_i32(segred_group_sizze_221513)) &&\n                            ((local_tid_235450 - squot32(local_tid_235450,\n                                                         wave_sizze_235452) *\n                              wave_sizze_235452) == 0 &&\n                             (squot32(local_tid_235450, wave_sizze_235452) &\n                              (2 * skip_waves_235488 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_235474 = ((__local\n                                             double *) red_arr_mem_235454)[sext_i32_i64(local_tid_235450 +\n                                                                           offset_235487)];\n      ",
            "                          x_235475 = ((__local\n                                             double *) red_arr_mem_235456)[sext_i32_i64(local_tid_235450 +\n                                                                           offset_235487)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_235476 = x_235472 +\n                                       x_235474;\n                                double defunc_1_op_res_235477 = x_235473 +\n                                       x_235475;\n                                \n                                x_235472 = defunc_1_op_res_235476;\n                                x_235473 = defunc_1_op_res_235477;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_235454)[sext_i32_i64(local_tid_235450)] =\n                                    x_235472;\n                                ((__local\n                                  double *) red_arr_mem_235456)[sext_i32_i64(local_tid_235450)] =\n                                    x_235473;\n                            }\n                        }\n                        skip_waves_235488 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_235450 == 0) {\n                            ((__global double *) mem_230825)[gtid_221518 *\n                                                             l_n_m_203643 +\n                                                             gtid_221519] =\n                                x_235472;\n                            ((__global double *) mem_230829)[gtid_221518 *\n                                                             l_n_m_203643 +\n                                                ",
            "             gtid_221519] =\n                                x_235473;\n                        }\n                    }\n                }\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_221513\n}\n__kernel void mainzisegred_large_223197(__global int *global_failure,\n                                        uint sync_arr_mem_235698_backing_offset_0,\n                                        uint red_arr_mem_235696_backing_offset_1,\n                                        int64_t n_203490, int64_t q_t_203494,\n                                        int64_t jump_t_203500,\n                                        int64_t partition_sizze_203577,\n                                        int64_t t_n_m_203650, int64_t i_203670,\n                                        int64_t num_groups_223191,\n                                        int64_t groups_per_segment_235682,\n                                        int64_t elements_per_thread_235683,\n                                        int64_t virt_num_groups_235684,\n                                        int64_t threads_per_segment_235686,\n                                        __global unsigned char *ext_mem_229196,\n                                        __global unsigned char *ext_mem_229197,\n                                        __global unsigned char *ext_mem_229460,\n                                        __global unsigned char *ext_mem_229461,\n                                        __global unsigned char *mem_231013,\n                                        __global unsigned char *mem_231027,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235687,\n                                        __global\n                                        unsigned char *mainzicounter_mem_235689)\n{\n    #define segred_group_sizze_223190 (mainzisegred_group_sizze_222794)\n    \n    ",
            "const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *sync_arr_mem_235698_backing_1 =\n                           &shared_mem[sync_arr_mem_235698_backing_offset_0];\n    volatile unsigned char *red_arr_mem_235696_backing_0 =\n                           &shared_mem[red_arr_mem_235696_backing_offset_1];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235691;\n    int32_t local_tid_235692;\n    int64_t group_sizze_235695;\n    int32_t wave_sizze_235694;\n    int32_t group_tid_235693;\n    \n    global_tid_235691 = get_global_id(0);\n    local_tid_235692 = get_local_id(0);\n    group_sizze_235695 = get_local_size(0);\n    wave_sizze_235694 = LOCKSTEP_WIDTH;\n    group_tid_235693 = get_group_id(0);\n    \n    int32_t phys_tid_223197 = global_tid_235691;\n    __local unsigned char *red_arr_mem_235696;\n    \n    red_arr_mem_235696 = (__local unsigned char *) red_arr_mem_235696_backing_0;\n    \n    __local unsigned char *sync_arr_mem_235698;\n    \n    sync_arr_mem_235698 = (__local\n                           unsigned char *) sync_arr_mem_235698_backing_1;\n    \n    int32_t phys_group_id_235700;\n    \n    phys_group_id_235700 = get_group_id(0);\n    for (int32_t i_235701 = 0; i_235701 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_235684) - phys_group_id_235700,\n                   sext_i64_i32(num_groups_223191)); i_235701++) {\n        int32_t virt_group_id_235702 = phys_group_id_235700 + i_235701 *\n                sext_i64_i32(num_groups_223191);\n        int32_t flat_segment_id_235703 = squot32(virt_group_id_235702,\n                                                 sext_i64_i32(groups_per_segment_235682));\n        int64_t global_tid_235704 = srem64(sext_i32_i64(virt_group_id_235702) *\n                                           segred_group_sizze_223190 +\n                                           sext_i32_i64(local_tid_235692),\n                                           segred_group_sizze_223190 *\n      ",
            "                                     groups_per_segment_235682);\n        int64_t slice_235705 = t_n_m_203650;\n        int64_t slice_235706 = partition_sizze_203577 * slice_235705;\n        int64_t gtid_223194 = squot64(sext_i32_i64(flat_segment_id_235703),\n                                      slice_235705);\n        int64_t remnant_235707 = sext_i32_i64(flat_segment_id_235703) -\n                gtid_223194 * slice_235705;\n        int64_t gtid_223195 = remnant_235707;\n        int64_t remnant_235708 = remnant_235707 - gtid_223195;\n        int64_t gtid_223196;\n        double x_acc_235709;\n        int64_t chunk_sizze_235710 = smin64(elements_per_thread_235683,\n                                            sdiv_up64(q_t_203494 -\n                                                      global_tid_235704,\n                                                      threads_per_segment_235686));\n        double x_223198;\n        double x_223199;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_235709 = 0.0;\n        }\n        for (int64_t i_235714 = 0; i_235714 < chunk_sizze_235710; i_235714++) {\n            gtid_223196 = global_tid_235704 + threads_per_segment_235686 *\n                i_235714;\n            // apply map function\n            {\n                int64_t x_223202;\n                \n                x_223202 = ((__global int64_t *) ext_mem_229196)[gtid_223194];\n                \n                int64_t x_223207;\n                \n                x_223207 = ((__global int64_t *) ext_mem_229461)[gtid_223194 *\n                                                                 t_n_m_203650 +\n                                                                 gtid_223195];\n                \n                double x_223208;\n                \n                x_223208 = ((__global double *) ext_mem_229460)[gtid_223194 *\n                                                                t_n_m_203650 +\n                                                                g",
            "tid_223195];\n                \n                int64_t binop_y_228664 = mul64(jump_t_203500, gtid_223195);\n                int64_t binop_y_228665 = smin64(i_203670, binop_y_228664);\n                int64_t index_primexp_228666 = add64((int64_t) 1,\n                                                     binop_y_228665);\n                bool cond_223211 = sle64(x_223202, gtid_223196);\n                int64_t defunc_0_f_res_223212;\n                \n                if (cond_223211) {\n                    defunc_0_f_res_223212 = (int64_t) 0;\n                } else {\n                    int64_t i_223213 = add64(gtid_223196, x_223207);\n                    int64_t defunc_0_add_arg_223214;\n                    \n                    defunc_0_add_arg_223214 = ((__global\n                                                int64_t *) ext_mem_229197)[gtid_223194 *\n                                                                           n_203490 +\n                                                                           i_223213];\n                    \n                    int64_t defunc_1_add_res_223215 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_223214);\n                    \n                    defunc_0_f_res_223212 = defunc_1_add_res_223215;\n                }\n                \n                double defunc_0_f_res_223216;\n                \n                if (cond_223211) {\n                    defunc_0_f_res_223216 = 0.0;\n                } else {\n                    int64_t i_223217 = add64(gtid_223196, x_223207);\n                    double defunc_0_add_arg_223218;\n                    \n                    defunc_0_add_arg_223218 = ((__global\n                                                double *) mem_231013)[gtid_223194 *\n                                                                      n_203490 +\n                                                                      i_223217];\n                    defunc_0_f_res_223216 = defunc_0_a",
            "dd_arg_223218;\n                }\n                \n                int64_t binop_p_223219 = sub64(defunc_0_f_res_223212,\n                                               index_primexp_228666);\n                double defunc_0_f_res_223220 = sitofp_i64_f64(binop_p_223219);\n                double abs_res_223221 = fabs(defunc_0_f_res_223220);\n                double tmp1_223222 = abs_res_223221 / x_223208;\n                double x_223223 = tmp1_223222 * tmp1_223222;\n                double y_223224 = tmp1_223222 * x_223223;\n                double tmp2_223225 = 1.0 - y_223224;\n                double x_223226 = tmp2_223225 * tmp2_223225;\n                double tmp3_223227 = tmp2_223225 * x_223226;\n                double w_j_223228 = defunc_0_f_res_223216 * tmp3_223227;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_223198 = x_acc_235709;\n                }\n                // load new values\n                {\n                    x_223199 = w_j_223228;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_223200 = x_223198 + x_223199;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_235709 = defunc_1_op_res_223200;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_223198 = x_acc_235709;\n            ((__local\n              double *) red_arr_mem_235696)[sext_i32_i64(local_tid_235692)] =\n                x_223198;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_235715;\n        int32_t skip_waves_235716 = 1;\n        double x_235711;\n        double x_235712;\n        \n        offset_235715 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_235692,\n           ",
            "           sext_i64_i32(segred_group_sizze_223190))) {\n                x_235711 = ((__local\n                             double *) red_arr_mem_235696)[sext_i32_i64(local_tid_235692 +\n                                                           offset_235715)];\n            }\n        }\n        offset_235715 = 1;\n        while (slt32(offset_235715, wave_sizze_235694)) {\n            if (slt32(local_tid_235692 + offset_235715,\n                      sext_i64_i32(segred_group_sizze_223190)) &&\n                ((local_tid_235692 - squot32(local_tid_235692,\n                                             wave_sizze_235694) *\n                  wave_sizze_235694) & (2 * offset_235715 - 1)) == 0) {\n                // read array element\n                {\n                    x_235712 = ((volatile __local\n                                 double *) red_arr_mem_235696)[sext_i32_i64(local_tid_235692 +\n                                                               offset_235715)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_235713 = x_235711 + x_235712;\n                    \n                    x_235711 = defunc_1_op_res_235713;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_235696)[sext_i32_i64(local_tid_235692)] =\n                        x_235711;\n                }\n            }\n            offset_235715 *= 2;\n        }\n        while (slt32(skip_waves_235716,\n                     squot32(sext_i64_i32(segred_group_sizze_223190) +\n                             wave_sizze_235694 - 1, wave_sizze_235694))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_235715 = skip_waves_235716 * wave_sizze_235694;\n            if (slt32(local_tid_235692 + offset_235715,\n                      sext_i64_i32(segred_group_sizze_223190)) &&\n                ((local_tid_235692 - squot32(local_tid_235692,\n    ",
            "                                         wave_sizze_235694) *\n                  wave_sizze_235694) == 0 && (squot32(local_tid_235692,\n                                                      wave_sizze_235694) & (2 *\n                                                                            skip_waves_235716 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_235712 = ((__local\n                                 double *) red_arr_mem_235696)[sext_i32_i64(local_tid_235692 +\n                                                               offset_235715)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_235713 = x_235711 + x_235712;\n                    \n                    x_235711 = defunc_1_op_res_235713;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_235696)[sext_i32_i64(local_tid_235692)] =\n                        x_235711;\n                }\n            }\n            skip_waves_235716 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_235692) == (int64_t) 0) {\n                x_acc_235709 = x_235711;\n            }\n        }\n        if (groups_per_segment_235682 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_235692 == 0) {\n                    ((__global double *) mem_231027)[gtid_223194 *\n                                                     t_n_m_203650 +\n                                                     gtid_223195] =\n                        x_acc_235709;\n                }\n            }\n        } else {\n            int32_t old_counter_235717;\n            \n            // ",
            "first thread in group saves group result to global memory\n            {\n                if (local_tid_235692 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_235687)[sext_i32_i64(virt_group_id_235702)] =\n                        x_acc_235709;\n                    mem_fence_global();\n                    old_counter_235717 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_235689)[sext_i32_i64(srem32(flat_segment_id_235703,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_235698)[(int64_t) 0] =\n                        old_counter_235717 == groups_per_segment_235682 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_235718;\n            \n            is_last_group_235718 = ((__local\n                                     bool *) sync_arr_mem_235698)[(int64_t) 0];\n            if (is_last_group_235718) {\n                if (local_tid_235692 == 0) {\n                    old_counter_235717 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_235689)[sext_i32_i64(srem32(flat_segment_id_235703,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_235682));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_235719 =\n                            sdiv_up64(groups_per_segment_235682,\n                        ",
            "              segred_group_sizze_223190);\n                    \n                    x_223198 = 0.0;\n                    for (int64_t i_235720 = 0; i_235720 <\n                         read_per_thread_235719; i_235720++) {\n                        int64_t group_res_id_235721 =\n                                sext_i32_i64(local_tid_235692) *\n                                read_per_thread_235719 + i_235720;\n                        int64_t index_of_group_res_235722 =\n                                sext_i32_i64(flat_segment_id_235703) *\n                                groups_per_segment_235682 + group_res_id_235721;\n                        \n                        if (slt64(group_res_id_235721,\n                                  groups_per_segment_235682)) {\n                            x_223199 = ((__global\n                                         double *) segred_tmp_mem_235687)[index_of_group_res_235722];\n                            \n                            double defunc_1_op_res_223200 = x_223198 + x_223199;\n                            \n                            x_223198 = defunc_1_op_res_223200;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_235696)[sext_i32_i64(local_tid_235692)] =\n                    x_223198;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_235723;\n                    int32_t skip_waves_235724 = 1;\n                    double x_235711;\n                    double x_235712;\n                    \n                    offset_235723 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_235692,\n                                  sext_i64_i32(segred_group_sizze_223190))) {\n                            x_235711 = ((__local\n                                         double *) red_arr_mem_235696",
            ")[sext_i32_i64(local_tid_235692 +\n                                                                       offset_235723)];\n                        }\n                    }\n                    offset_235723 = 1;\n                    while (slt32(offset_235723, wave_sizze_235694)) {\n                        if (slt32(local_tid_235692 + offset_235723,\n                                  sext_i64_i32(segred_group_sizze_223190)) &&\n                            ((local_tid_235692 - squot32(local_tid_235692,\n                                                         wave_sizze_235694) *\n                              wave_sizze_235694) & (2 * offset_235723 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_235712 = ((volatile __local\n                                             double *) red_arr_mem_235696)[sext_i32_i64(local_tid_235692 +\n                                                                           offset_235723)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_235713 = x_235711 +\n                                       x_235712;\n                                \n                                x_235711 = defunc_1_op_res_235713;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_235696)[sext_i32_i64(local_tid_235692)] =\n                                    x_235711;\n                            }\n                        }\n                        offset_235723 *= 2;\n                    }\n                    while (slt32(skip_waves_235724,\n                                 squot32(sext_i64_i32(segred_group_sizze_223190) +\n                                         wave_sizze_235694 ",
            "- 1,\n                                         wave_sizze_235694))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_235723 = skip_waves_235724 * wave_sizze_235694;\n                        if (slt32(local_tid_235692 + offset_235723,\n                                  sext_i64_i32(segred_group_sizze_223190)) &&\n                            ((local_tid_235692 - squot32(local_tid_235692,\n                                                         wave_sizze_235694) *\n                              wave_sizze_235694) == 0 &&\n                             (squot32(local_tid_235692, wave_sizze_235694) &\n                              (2 * skip_waves_235724 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_235712 = ((__local\n                                             double *) red_arr_mem_235696)[sext_i32_i64(local_tid_235692 +\n                                                                           offset_235723)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_235713 = x_235711 +\n                                       x_235712;\n                                \n                                x_235711 = defunc_1_op_res_235713;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_235696)[sext_i32_i64(local_tid_235692)] =\n                                    x_235711;\n                            }\n                        }\n                        skip_waves_235724 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_235692 == 0) {\n                            ((__global double *) mem_231",
            "027)[gtid_223194 *\n                                                             t_n_m_203650 +\n                                                             gtid_223195] =\n                                x_235711;\n                        }\n                    }\n                }\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_223190\n}\n__kernel void mainzisegred_large_223249(__global int *global_failure,\n                                        uint sync_arr_mem_235780_backing_offset_0,\n                                        uint red_arr_mem_235778_backing_offset_1,\n                                        int64_t n_203490, int64_t q_t_203494,\n                                        int64_t jump_t_203500,\n                                        int64_t partition_sizze_203577,\n                                        int64_t t_n_m_203650, int64_t i_203670,\n                                        int64_t num_groups_223243,\n                                        int64_t groups_per_segment_235764,\n                                        int64_t elements_per_thread_235765,\n                                        int64_t virt_num_groups_235766,\n                                        int64_t threads_per_segment_235768,\n                                        __global unsigned char *ext_mem_229196,\n                                        __global unsigned char *ext_mem_229197,\n                                        __global unsigned char *ext_mem_229460,\n                                        __global unsigned char *ext_mem_229461,\n                                        __global unsigned char *mem_231013,\n                                        __global unsigned char *mem_231017,\n                                        __global unsigned char *mem_231032,\n                                        __global unsigned char *mem_231037,\n                                        __glo",
            "bal\n                                        unsigned char *segred_tmp_mem_235769,\n                                        __global\n                                        unsigned char *mainzicounter_mem_235771)\n{\n    #define segred_group_sizze_223242 (mainzisegred_group_sizze_222724)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *sync_arr_mem_235780_backing_1 =\n                           &shared_mem[sync_arr_mem_235780_backing_offset_0];\n    volatile unsigned char *red_arr_mem_235778_backing_0 =\n                           &shared_mem[red_arr_mem_235778_backing_offset_1];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235773;\n    int32_t local_tid_235774;\n    int64_t group_sizze_235777;\n    int32_t wave_sizze_235776;\n    int32_t group_tid_235775;\n    \n    global_tid_235773 = get_global_id(0);\n    local_tid_235774 = get_local_id(0);\n    group_sizze_235777 = get_local_size(0);\n    wave_sizze_235776 = LOCKSTEP_WIDTH;\n    group_tid_235775 = get_group_id(0);\n    \n    int32_t phys_tid_223249 = global_tid_235773;\n    __local unsigned char *red_arr_mem_235778;\n    \n    red_arr_mem_235778 = (__local unsigned char *) red_arr_mem_235778_backing_0;\n    \n    __local unsigned char *sync_arr_mem_235780;\n    \n    sync_arr_mem_235780 = (__local\n                           unsigned char *) sync_arr_mem_235780_backing_1;\n    \n    int32_t phys_group_id_235782;\n    \n    phys_group_id_235782 = get_group_id(0);\n    for (int32_t i_235783 = 0; i_235783 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_235766) - phys_group_id_235782,\n                   sext_i64_i32(num_groups_223243)); i_235783++) {\n        int32_t virt_group_id_235784 = phys_group_id_235782 + i_235783 *\n                sext_i64_i32(num_groups_223243);\n        int32_t flat_segment_id_235785 = squot32(virt_group_id_235784,\n                                                 sext_i64_i32(groups_per_segment_235764));\n        ",
            "int64_t global_tid_235786 = srem64(sext_i32_i64(virt_group_id_235784) *\n                                           segred_group_sizze_223242 +\n                                           sext_i32_i64(local_tid_235774),\n                                           segred_group_sizze_223242 *\n                                           groups_per_segment_235764);\n        int64_t slice_235787 = t_n_m_203650;\n        int64_t slice_235788 = partition_sizze_203577 * slice_235787;\n        int64_t gtid_223246 = squot64(sext_i32_i64(flat_segment_id_235785),\n                                      slice_235787);\n        int64_t remnant_235789 = sext_i32_i64(flat_segment_id_235785) -\n                gtid_223246 * slice_235787;\n        int64_t gtid_223247 = remnant_235789;\n        int64_t remnant_235790 = remnant_235789 - gtid_223247;\n        int64_t gtid_223248;\n        double x_acc_235791;\n        int64_t chunk_sizze_235792 = smin64(elements_per_thread_235765,\n                                            sdiv_up64(q_t_203494 -\n                                                      global_tid_235786,\n                                                      threads_per_segment_235768));\n        double x_223250;\n        double x_223251;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_235791 = 0.0;\n        }\n        for (int64_t i_235796 = 0; i_235796 < chunk_sizze_235792; i_235796++) {\n            gtid_223248 = global_tid_235786 + threads_per_segment_235768 *\n                i_235796;\n            // apply map function\n            {\n                int64_t x_223254;\n                \n                x_223254 = ((__global int64_t *) ext_mem_229196)[gtid_223246];\n                \n                int64_t x_223261;\n                \n                x_223261 = ((__global int64_t *) ext_mem_229461)[gtid_223246 *\n                                                                 t_n_m_203650 +\n                                                                 gtid_223",
            "247];\n                \n                double x_223262;\n                \n                x_223262 = ((__global double *) ext_mem_229460)[gtid_223246 *\n                                                                t_n_m_203650 +\n                                                                gtid_223247];\n                \n                int64_t binop_y_228659 = mul64(jump_t_203500, gtid_223247);\n                int64_t binop_y_228660 = smin64(i_203670, binop_y_228659);\n                int64_t index_primexp_228661 = add64((int64_t) 1,\n                                                     binop_y_228660);\n                double a0_223264;\n                \n                a0_223264 = ((__global double *) mem_231032)[gtid_223246 *\n                                                             t_n_m_203650 +\n                                                             gtid_223247];\n                \n                bool cond_223266 = sle64(x_223254, gtid_223248);\n                int64_t defunc_0_f_res_223267;\n                \n                if (cond_223266) {\n                    defunc_0_f_res_223267 = (int64_t) 0;\n                } else {\n                    int64_t i_223268 = add64(gtid_223248, x_223261);\n                    int64_t defunc_0_add_arg_223269;\n                    \n                    defunc_0_add_arg_223269 = ((__global\n                                                int64_t *) ext_mem_229197)[gtid_223246 *\n                                                                           n_203490 +\n                                                                           i_223268];\n                    \n                    int64_t defunc_1_add_res_223270 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_223269);\n                    \n                    defunc_0_f_res_223267 = defunc_1_add_res_223270;\n                }\n                \n                double defunc_0_f_res_223271;\n                \n                if ",
            "(cond_223266) {\n                    defunc_0_f_res_223271 = 0.0;\n                } else {\n                    int64_t i_223272 = add64(gtid_223248, x_223261);\n                    double defunc_0_add_arg_223273;\n                    \n                    defunc_0_add_arg_223273 = ((__global\n                                                double *) mem_231013)[gtid_223246 *\n                                                                      n_203490 +\n                                                                      i_223272];\n                    defunc_0_f_res_223271 = defunc_0_add_arg_223273;\n                }\n                \n                int64_t binop_p_223274 = sub64(defunc_0_f_res_223267,\n                                               index_primexp_228661);\n                double defunc_0_f_res_223275 = sitofp_i64_f64(binop_p_223274);\n                double abs_res_223276 = fabs(defunc_0_f_res_223275);\n                double tmp1_223277 = abs_res_223276 / x_223262;\n                double x_223278 = tmp1_223277 * tmp1_223277;\n                double y_223279 = tmp1_223277 * x_223278;\n                double tmp2_223280 = 1.0 - y_223279;\n                double x_223281 = tmp2_223280 * tmp2_223280;\n                double tmp3_223282 = tmp2_223280 * x_223281;\n                double tmp4_223283 = defunc_0_f_res_223271 * tmp3_223282;\n                double defunc_0_f_res_223284;\n                \n                if (cond_223266) {\n                    defunc_0_f_res_223284 = 0.0;\n                } else {\n                    int64_t i_223285 = add64(gtid_223248, x_223261);\n                    double defunc_0_add_arg_223286;\n                    \n                    defunc_0_add_arg_223286 = ((__global\n                                                double *) mem_231017)[gtid_223246 *\n                                                                      n_203490 +\n                                                                      i_223285];\n                    defu",
            "nc_0_f_res_223284 = defunc_0_add_arg_223286;\n                }\n                \n                double x_223287 = a0_223264 * tmp4_223283;\n                double defunc_9_fit_fun_res_223288 = defunc_0_f_res_223284 *\n                       x_223287;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_223250 = x_acc_235791;\n                }\n                // load new values\n                {\n                    x_223251 = defunc_9_fit_fun_res_223288;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_223252 = x_223250 + x_223251;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_235791 = defunc_1_op_res_223252;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_223250 = x_acc_235791;\n            ((__local\n              double *) red_arr_mem_235778)[sext_i32_i64(local_tid_235774)] =\n                x_223250;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_235797;\n        int32_t skip_waves_235798 = 1;\n        double x_235793;\n        double x_235794;\n        \n        offset_235797 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_235774,\n                      sext_i64_i32(segred_group_sizze_223242))) {\n                x_235793 = ((__local\n                             double *) red_arr_mem_235778)[sext_i32_i64(local_tid_235774 +\n                                                           offset_235797)];\n            }\n        }\n        offset_235797 = 1;\n        while (slt32(offset_235797, wave_sizze_235776)) {\n            if (slt32(local_tid_235774 + offset_235797,\n                      sext_i64_i32(segred_group_sizze_223242)) &&\n             ",
            "   ((local_tid_235774 - squot32(local_tid_235774,\n                                             wave_sizze_235776) *\n                  wave_sizze_235776) & (2 * offset_235797 - 1)) == 0) {\n                // read array element\n                {\n                    x_235794 = ((volatile __local\n                                 double *) red_arr_mem_235778)[sext_i32_i64(local_tid_235774 +\n                                                               offset_235797)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_235795 = x_235793 + x_235794;\n                    \n                    x_235793 = defunc_1_op_res_235795;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_235778)[sext_i32_i64(local_tid_235774)] =\n                        x_235793;\n                }\n            }\n            offset_235797 *= 2;\n        }\n        while (slt32(skip_waves_235798,\n                     squot32(sext_i64_i32(segred_group_sizze_223242) +\n                             wave_sizze_235776 - 1, wave_sizze_235776))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_235797 = skip_waves_235798 * wave_sizze_235776;\n            if (slt32(local_tid_235774 + offset_235797,\n                      sext_i64_i32(segred_group_sizze_223242)) &&\n                ((local_tid_235774 - squot32(local_tid_235774,\n                                             wave_sizze_235776) *\n                  wave_sizze_235776) == 0 && (squot32(local_tid_235774,\n                                                      wave_sizze_235776) & (2 *\n                                                                            skip_waves_235798 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_235794 = ",
            "((__local\n                                 double *) red_arr_mem_235778)[sext_i32_i64(local_tid_235774 +\n                                                               offset_235797)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_235795 = x_235793 + x_235794;\n                    \n                    x_235793 = defunc_1_op_res_235795;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_235778)[sext_i32_i64(local_tid_235774)] =\n                        x_235793;\n                }\n            }\n            skip_waves_235798 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_235774) == (int64_t) 0) {\n                x_acc_235791 = x_235793;\n            }\n        }\n        if (groups_per_segment_235764 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_235774 == 0) {\n                    ((__global double *) mem_231037)[gtid_223246 *\n                                                     t_n_m_203650 +\n                                                     gtid_223247] =\n                        x_acc_235791;\n                }\n            }\n        } else {\n            int32_t old_counter_235799;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_235774 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_235769)[sext_i32_i64(virt_group_id_235784)] =\n                        x_acc_235791;\n                    mem_fence_global();\n                    old_counter_235799 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_23",
            "5771)[sext_i32_i64(srem32(flat_segment_id_235785,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_235780)[(int64_t) 0] =\n                        old_counter_235799 == groups_per_segment_235764 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_235800;\n            \n            is_last_group_235800 = ((__local\n                                     bool *) sync_arr_mem_235780)[(int64_t) 0];\n            if (is_last_group_235800) {\n                if (local_tid_235774 == 0) {\n                    old_counter_235799 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_235771)[sext_i32_i64(srem32(flat_segment_id_235785,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_235764));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_235801 =\n                            sdiv_up64(groups_per_segment_235764,\n                                      segred_group_sizze_223242);\n                    \n                    x_223250 = 0.0;\n                    for (int64_t i_235802 = 0; i_235802 <\n                         read_per_thread_235801; i_235802++) {\n                        int64_t group_res_id_235803 =\n                                sext_i32_i64(local_tid_235774) *\n                                read_per_thread_235801 + i_235802;\n                        int64_t index_of_group_res_235804 =\n                                sext_",
            "i32_i64(flat_segment_id_235785) *\n                                groups_per_segment_235764 + group_res_id_235803;\n                        \n                        if (slt64(group_res_id_235803,\n                                  groups_per_segment_235764)) {\n                            x_223251 = ((__global\n                                         double *) segred_tmp_mem_235769)[index_of_group_res_235804];\n                            \n                            double defunc_1_op_res_223252 = x_223250 + x_223251;\n                            \n                            x_223250 = defunc_1_op_res_223252;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_235778)[sext_i32_i64(local_tid_235774)] =\n                    x_223250;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_235805;\n                    int32_t skip_waves_235806 = 1;\n                    double x_235793;\n                    double x_235794;\n                    \n                    offset_235805 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_235774,\n                                  sext_i64_i32(segred_group_sizze_223242))) {\n                            x_235793 = ((__local\n                                         double *) red_arr_mem_235778)[sext_i32_i64(local_tid_235774 +\n                                                                       offset_235805)];\n                        }\n                    }\n                    offset_235805 = 1;\n                    while (slt32(offset_235805, wave_sizze_235776)) {\n                        if (slt32(local_tid_235774 + offset_235805,\n                                  sext_i64_i32(segred_group_sizze_223242)) &&\n                            ((local_tid_235774 - squot32(local_tid_235774,\n   ",
            "                                                      wave_sizze_235776) *\n                              wave_sizze_235776) & (2 * offset_235805 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_235794 = ((volatile __local\n                                             double *) red_arr_mem_235778)[sext_i32_i64(local_tid_235774 +\n                                                                           offset_235805)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_235795 = x_235793 +\n                                       x_235794;\n                                \n                                x_235793 = defunc_1_op_res_235795;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_235778)[sext_i32_i64(local_tid_235774)] =\n                                    x_235793;\n                            }\n                        }\n                        offset_235805 *= 2;\n                    }\n                    while (slt32(skip_waves_235806,\n                                 squot32(sext_i64_i32(segred_group_sizze_223242) +\n                                         wave_sizze_235776 - 1,\n                                         wave_sizze_235776))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_235805 = skip_waves_235806 * wave_sizze_235776;\n                        if (slt32(local_tid_235774 + offset_235805,\n                                  sext_i64_i32(segred_group_sizze_223242)) &&\n                            ((local_tid_235774 - squot32(local_tid_235774,\n                                                         wave_sizze_235776) *\n  ",
            "                            wave_sizze_235776) == 0 &&\n                             (squot32(local_tid_235774, wave_sizze_235776) &\n                              (2 * skip_waves_235806 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_235794 = ((__local\n                                             double *) red_arr_mem_235778)[sext_i32_i64(local_tid_235774 +\n                                                                           offset_235805)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_235795 = x_235793 +\n                                       x_235794;\n                                \n                                x_235793 = defunc_1_op_res_235795;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_235778)[sext_i32_i64(local_tid_235774)] =\n                                    x_235793;\n                            }\n                        }\n                        skip_waves_235806 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_235774 == 0) {\n                            ((__global double *) mem_231037)[gtid_223246 *\n                                                             t_n_m_203650 +\n                                                             gtid_223247] =\n                                x_235793;\n                        }\n                    }\n                }\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_223242\n}\n__kernel void mainzisegred_large_224235(__global int *global_failu",
            "re,\n                                        uint sync_arr_mem_235949_backing_offset_0,\n                                        uint red_arr_mem_235947_backing_offset_1,\n                                        uint red_arr_mem_235945_backing_offset_2,\n                                        uint red_arr_mem_235943_backing_offset_3,\n                                        int64_t n_203490, int64_t q_t_203494,\n                                        int64_t jump_t_203500,\n                                        int64_t partition_sizze_203577,\n                                        int64_t t_n_m_203650, int64_t i_203670,\n                                        int64_t num_groups_224227,\n                                        int64_t groups_per_segment_235925,\n                                        int64_t elements_per_thread_235926,\n                                        int64_t virt_num_groups_235927,\n                                        int64_t threads_per_segment_235929,\n                                        __global unsigned char *ext_mem_229196,\n                                        __global unsigned char *ext_mem_229197,\n                                        __global unsigned char *ext_mem_229460,\n                                        __global unsigned char *ext_mem_229461,\n                                        __global unsigned char *mem_231151,\n                                        __global unsigned char *mem_231169,\n                                        __global unsigned char *mem_231173,\n                                        __global unsigned char *mem_231177,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235930,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235932,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235934,\n   ",
            "                                     __global\n                                        unsigned char *mainzicounter_mem_235936)\n{\n    #define segred_group_sizze_224226 (mainzisegred_group_sizze_223755)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *sync_arr_mem_235949_backing_3 =\n                           &shared_mem[sync_arr_mem_235949_backing_offset_0];\n    volatile unsigned char *red_arr_mem_235947_backing_2 =\n                           &shared_mem[red_arr_mem_235947_backing_offset_1];\n    volatile unsigned char *red_arr_mem_235945_backing_1 =\n                           &shared_mem[red_arr_mem_235945_backing_offset_2];\n    volatile unsigned char *red_arr_mem_235943_backing_0 =\n                           &shared_mem[red_arr_mem_235943_backing_offset_3];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235938;\n    int32_t local_tid_235939;\n    int64_t group_sizze_235942;\n    int32_t wave_sizze_235941;\n    int32_t group_tid_235940;\n    \n    global_tid_235938 = get_global_id(0);\n    local_tid_235939 = get_local_id(0);\n    group_sizze_235942 = get_local_size(0);\n    wave_sizze_235941 = LOCKSTEP_WIDTH;\n    group_tid_235940 = get_group_id(0);\n    \n    int32_t phys_tid_224235 = global_tid_235938;\n    __local unsigned char *red_arr_mem_235943;\n    \n    red_arr_mem_235943 = (__local unsigned char *) red_arr_mem_235943_backing_0;\n    \n    __local unsigned char *red_arr_mem_235945;\n    \n    red_arr_mem_235945 = (__local unsigned char *) red_arr_mem_235945_backing_1;\n    \n    __local unsigned char *red_arr_mem_235947;\n    \n    red_arr_mem_235947 = (__local unsigned char *) red_arr_mem_235947_backing_2;\n    \n    __local unsigned char *sync_arr_mem_235949;\n    \n    sync_arr_mem_235949 = (__local\n                           unsigned char *) sync_arr_mem_235949_backing_3;\n    \n    int32_t phys_group_id_235951;\n    \n    phys_group_id_235951 = get_group_id(0);\n    for (int32_t i",
            "_235952 = 0; i_235952 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_235927) - phys_group_id_235951,\n                   sext_i64_i32(num_groups_224227)); i_235952++) {\n        int32_t virt_group_id_235953 = phys_group_id_235951 + i_235952 *\n                sext_i64_i32(num_groups_224227);\n        int32_t flat_segment_id_235954 = squot32(virt_group_id_235953,\n                                                 sext_i64_i32(groups_per_segment_235925));\n        int64_t global_tid_235955 = srem64(sext_i32_i64(virt_group_id_235953) *\n                                           segred_group_sizze_224226 +\n                                           sext_i32_i64(local_tid_235939),\n                                           segred_group_sizze_224226 *\n                                           groups_per_segment_235925);\n        int64_t slice_235956 = t_n_m_203650;\n        int64_t slice_235957 = partition_sizze_203577 * slice_235956;\n        int64_t gtid_224232 = squot64(sext_i32_i64(flat_segment_id_235954),\n                                      slice_235956);\n        int64_t remnant_235958 = sext_i32_i64(flat_segment_id_235954) -\n                gtid_224232 * slice_235956;\n        int64_t gtid_224233 = remnant_235958;\n        int64_t remnant_235959 = remnant_235958 - gtid_224233;\n        int64_t gtid_224234;\n        double x_acc_235960;\n        double x_acc_235961;\n        double x_acc_235962;\n        int64_t chunk_sizze_235963 = smin64(elements_per_thread_235926,\n                                            sdiv_up64(q_t_203494 -\n                                                      global_tid_235955,\n                                                      threads_per_segment_235929));\n        double x_224236;\n        double x_224237;\n        double x_224238;\n        double x_224239;\n        double x_224240;\n        double x_224241;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_235960 = 0.0;\n            x_acc_235961 = 0.0;\n            x_ac",
            "c_235962 = 0.0;\n        }\n        for (int64_t i_235973 = 0; i_235973 < chunk_sizze_235963; i_235973++) {\n            gtid_224234 = global_tid_235955 + threads_per_segment_235929 *\n                i_235973;\n            // apply map function\n            {\n                int64_t x_224246;\n                \n                x_224246 = ((__global int64_t *) ext_mem_229196)[gtid_224232];\n                \n                int64_t x_224251;\n                \n                x_224251 = ((__global int64_t *) ext_mem_229461)[gtid_224232 *\n                                                                 t_n_m_203650 +\n                                                                 gtid_224233];\n                \n                double x_224252;\n                \n                x_224252 = ((__global double *) ext_mem_229460)[gtid_224232 *\n                                                                t_n_m_203650 +\n                                                                gtid_224233];\n                \n                int64_t binop_y_228674 = mul64(jump_t_203500, gtid_224233);\n                int64_t binop_y_228675 = smin64(i_203670, binop_y_228674);\n                int64_t index_primexp_228676 = add64((int64_t) 1,\n                                                     binop_y_228675);\n                bool cond_224255 = sle64(x_224246, gtid_224234);\n                int64_t defunc_0_f_res_224256;\n                \n                if (cond_224255) {\n                    defunc_0_f_res_224256 = (int64_t) 0;\n                } else {\n                    int64_t i_224257 = add64(gtid_224234, x_224251);\n                    int64_t defunc_0_add_arg_224258;\n                    \n                    defunc_0_add_arg_224258 = ((__global\n                                                int64_t *) ext_mem_229197)[gtid_224232 *\n                                                                           n_203490 +\n                                                                           i_22425",
            "7];\n                    \n                    int64_t defunc_1_add_res_224259 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_224258);\n                    \n                    defunc_0_f_res_224256 = defunc_1_add_res_224259;\n                }\n                \n                double defunc_0_f_res_224260;\n                \n                if (cond_224255) {\n                    defunc_0_f_res_224260 = 0.0;\n                } else {\n                    int64_t i_224261 = add64(gtid_224234, x_224251);\n                    double defunc_0_add_arg_224262;\n                    \n                    defunc_0_add_arg_224262 = ((__global\n                                                double *) mem_231151)[gtid_224232 *\n                                                                      n_203490 +\n                                                                      i_224261];\n                    defunc_0_f_res_224260 = defunc_0_add_arg_224262;\n                }\n                \n                int64_t binop_p_224263 = sub64(defunc_0_f_res_224256,\n                                               index_primexp_228676);\n                double defunc_0_f_res_224264 = sitofp_i64_f64(binop_p_224263);\n                double abs_res_224265 = fabs(defunc_0_f_res_224264);\n                double tmp1_224266 = abs_res_224265 / x_224252;\n                double x_224267 = tmp1_224266 * tmp1_224266;\n                double y_224268 = tmp1_224266 * x_224267;\n                double tmp2_224269 = 1.0 - y_224268;\n                double x_224270 = tmp2_224269 * tmp2_224269;\n                double tmp3_224271 = tmp2_224269 * x_224270;\n                double w_j_224272 = defunc_0_f_res_224260 * tmp3_224271;\n                double xw_j_224273 = defunc_0_f_res_224264 * w_j_224272;\n                double x2w_j_224274 = defunc_0_f_res_224264 * xw_j_224273;\n                \n                // save map-out results\n                { }\n                // load ac",
            "cumulator\n                {\n                    x_224236 = x_acc_235960;\n                    x_224237 = x_acc_235961;\n                    x_224238 = x_acc_235962;\n                }\n                // load new values\n                {\n                    x_224239 = w_j_224272;\n                    x_224240 = xw_j_224273;\n                    x_224241 = x2w_j_224274;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_224242 = x_224236 + x_224239;\n                    double defunc_1_op_res_224243 = x_224237 + x_224240;\n                    double defunc_1_op_res_224244 = x_224238 + x_224241;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_235960 = defunc_1_op_res_224242;\n                        x_acc_235961 = defunc_1_op_res_224243;\n                        x_acc_235962 = defunc_1_op_res_224244;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_224236 = x_acc_235960;\n            x_224237 = x_acc_235961;\n            x_224238 = x_acc_235962;\n            ((__local\n              double *) red_arr_mem_235943)[sext_i32_i64(local_tid_235939)] =\n                x_224236;\n            ((__local\n              double *) red_arr_mem_235945)[sext_i32_i64(local_tid_235939)] =\n                x_224237;\n            ((__local\n              double *) red_arr_mem_235947)[sext_i32_i64(local_tid_235939)] =\n                x_224238;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_235974;\n        int32_t skip_waves_235975 = 1;\n        double x_235964;\n        double x_235965;\n        double x_235966;\n        double x_235967;\n        double x_235968;\n        double x_235969;\n        \n        offset_235974 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_235939,\n      ",
            "                sext_i64_i32(segred_group_sizze_224226))) {\n                x_235964 = ((__local\n                             double *) red_arr_mem_235943)[sext_i32_i64(local_tid_235939 +\n                                                           offset_235974)];\n                x_235965 = ((__local\n                             double *) red_arr_mem_235945)[sext_i32_i64(local_tid_235939 +\n                                                           offset_235974)];\n                x_235966 = ((__local\n                             double *) red_arr_mem_235947)[sext_i32_i64(local_tid_235939 +\n                                                           offset_235974)];\n            }\n        }\n        offset_235974 = 1;\n        while (slt32(offset_235974, wave_sizze_235941)) {\n            if (slt32(local_tid_235939 + offset_235974,\n                      sext_i64_i32(segred_group_sizze_224226)) &&\n                ((local_tid_235939 - squot32(local_tid_235939,\n                                             wave_sizze_235941) *\n                  wave_sizze_235941) & (2 * offset_235974 - 1)) == 0) {\n                // read array element\n                {\n                    x_235967 = ((volatile __local\n                                 double *) red_arr_mem_235943)[sext_i32_i64(local_tid_235939 +\n                                                               offset_235974)];\n                    x_235968 = ((volatile __local\n                                 double *) red_arr_mem_235945)[sext_i32_i64(local_tid_235939 +\n                                                               offset_235974)];\n                    x_235969 = ((volatile __local\n                                 double *) red_arr_mem_235947)[sext_i32_i64(local_tid_235939 +\n                                                               offset_235974)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_235970 = x_235964 + x_235967;\n           ",
            "         double defunc_1_op_res_235971 = x_235965 + x_235968;\n                    double defunc_1_op_res_235972 = x_235966 + x_235969;\n                    \n                    x_235964 = defunc_1_op_res_235970;\n                    x_235965 = defunc_1_op_res_235971;\n                    x_235966 = defunc_1_op_res_235972;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_235943)[sext_i32_i64(local_tid_235939)] =\n                        x_235964;\n                    ((volatile __local\n                      double *) red_arr_mem_235945)[sext_i32_i64(local_tid_235939)] =\n                        x_235965;\n                    ((volatile __local\n                      double *) red_arr_mem_235947)[sext_i32_i64(local_tid_235939)] =\n                        x_235966;\n                }\n            }\n            offset_235974 *= 2;\n        }\n        while (slt32(skip_waves_235975,\n                     squot32(sext_i64_i32(segred_group_sizze_224226) +\n                             wave_sizze_235941 - 1, wave_sizze_235941))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_235974 = skip_waves_235975 * wave_sizze_235941;\n            if (slt32(local_tid_235939 + offset_235974,\n                      sext_i64_i32(segred_group_sizze_224226)) &&\n                ((local_tid_235939 - squot32(local_tid_235939,\n                                             wave_sizze_235941) *\n                  wave_sizze_235941) == 0 && (squot32(local_tid_235939,\n                                                      wave_sizze_235941) & (2 *\n                                                                            skip_waves_235975 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_235967 = ((__local\n                                 double *) red_arr",
            "_mem_235943)[sext_i32_i64(local_tid_235939 +\n                                                               offset_235974)];\n                    x_235968 = ((__local\n                                 double *) red_arr_mem_235945)[sext_i32_i64(local_tid_235939 +\n                                                               offset_235974)];\n                    x_235969 = ((__local\n                                 double *) red_arr_mem_235947)[sext_i32_i64(local_tid_235939 +\n                                                               offset_235974)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_235970 = x_235964 + x_235967;\n                    double defunc_1_op_res_235971 = x_235965 + x_235968;\n                    double defunc_1_op_res_235972 = x_235966 + x_235969;\n                    \n                    x_235964 = defunc_1_op_res_235970;\n                    x_235965 = defunc_1_op_res_235971;\n                    x_235966 = defunc_1_op_res_235972;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_235943)[sext_i32_i64(local_tid_235939)] =\n                        x_235964;\n                    ((__local\n                      double *) red_arr_mem_235945)[sext_i32_i64(local_tid_235939)] =\n                        x_235965;\n                    ((__local\n                      double *) red_arr_mem_235947)[sext_i32_i64(local_tid_235939)] =\n                        x_235966;\n                }\n            }\n            skip_waves_235975 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_235939) == (int64_t) 0) {\n                x_acc_235960 = x_235964;\n                x_acc_235961 = x_235965;\n                x_acc_235962 = x_235966;\n            }\n        }\n        if (groups_per_segment_2",
            "35925 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_235939 == 0) {\n                    ((__global double *) mem_231169)[gtid_224232 *\n                                                     t_n_m_203650 +\n                                                     gtid_224233] =\n                        x_acc_235960;\n                    ((__global double *) mem_231173)[gtid_224232 *\n                                                     t_n_m_203650 +\n                                                     gtid_224233] =\n                        x_acc_235961;\n                    ((__global double *) mem_231177)[gtid_224232 *\n                                                     t_n_m_203650 +\n                                                     gtid_224233] =\n                        x_acc_235962;\n                }\n            }\n        } else {\n            int32_t old_counter_235976;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_235939 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_235930)[sext_i32_i64(virt_group_id_235953)] =\n                        x_acc_235960;\n                    ((__global\n                      double *) segred_tmp_mem_235932)[sext_i32_i64(virt_group_id_235953)] =\n                        x_acc_235961;\n                    ((__global\n                      double *) segred_tmp_mem_235934)[sext_i32_i64(virt_group_id_235953)] =\n                        x_acc_235962;\n                    mem_fence_global();\n                    old_counter_235976 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_235936)[sext_i32_i64(srem32(flat_segment_id_235954,\n                                                                                                      10240))],\n                      ",
            "                        (int) 1);\n                    ((__local bool *) sync_arr_mem_235949)[(int64_t) 0] =\n                        old_counter_235976 == groups_per_segment_235925 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_235977;\n            \n            is_last_group_235977 = ((__local\n                                     bool *) sync_arr_mem_235949)[(int64_t) 0];\n            if (is_last_group_235977) {\n                if (local_tid_235939 == 0) {\n                    old_counter_235976 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_235936)[sext_i32_i64(srem32(flat_segment_id_235954,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_235925));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_235978 =\n                            sdiv_up64(groups_per_segment_235925,\n                                      segred_group_sizze_224226);\n                    \n                    x_224236 = 0.0;\n                    x_224237 = 0.0;\n                    x_224238 = 0.0;\n                    for (int64_t i_235979 = 0; i_235979 <\n                         read_per_thread_235978; i_235979++) {\n                        int64_t group_res_id_235980 =\n                                sext_i32_i64(local_tid_235939) *\n                                read_per_thread_235978 + i_235979;\n                        int64_t index_of_group_res_235981 =\n                                sext_i32_i64(flat_segment_id_235954) *\n                                groups_per_segment_235925 + group_res_id_23598",
            "0;\n                        \n                        if (slt64(group_res_id_235980,\n                                  groups_per_segment_235925)) {\n                            x_224239 = ((__global\n                                         double *) segred_tmp_mem_235930)[index_of_group_res_235981];\n                            x_224240 = ((__global\n                                         double *) segred_tmp_mem_235932)[index_of_group_res_235981];\n                            x_224241 = ((__global\n                                         double *) segred_tmp_mem_235934)[index_of_group_res_235981];\n                            \n                            double defunc_1_op_res_224242 = x_224236 + x_224239;\n                            double defunc_1_op_res_224243 = x_224237 + x_224240;\n                            double defunc_1_op_res_224244 = x_224238 + x_224241;\n                            \n                            x_224236 = defunc_1_op_res_224242;\n                            x_224237 = defunc_1_op_res_224243;\n                            x_224238 = defunc_1_op_res_224244;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_235943)[sext_i32_i64(local_tid_235939)] =\n                    x_224236;\n                ((__local\n                  double *) red_arr_mem_235945)[sext_i32_i64(local_tid_235939)] =\n                    x_224237;\n                ((__local\n                  double *) red_arr_mem_235947)[sext_i32_i64(local_tid_235939)] =\n                    x_224238;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_235982;\n                    int32_t skip_waves_235983 = 1;\n                    double x_235964;\n                    double x_235965;\n                    double x_235966;\n                    double x_235967;\n                    double x_235968;\n                    double x_235969;",
            "\n                    \n                    offset_235982 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_235939,\n                                  sext_i64_i32(segred_group_sizze_224226))) {\n                            x_235964 = ((__local\n                                         double *) red_arr_mem_235943)[sext_i32_i64(local_tid_235939 +\n                                                                       offset_235982)];\n                            x_235965 = ((__local\n                                         double *) red_arr_mem_235945)[sext_i32_i64(local_tid_235939 +\n                                                                       offset_235982)];\n                            x_235966 = ((__local\n                                         double *) red_arr_mem_235947)[sext_i32_i64(local_tid_235939 +\n                                                                       offset_235982)];\n                        }\n                    }\n                    offset_235982 = 1;\n                    while (slt32(offset_235982, wave_sizze_235941)) {\n                        if (slt32(local_tid_235939 + offset_235982,\n                                  sext_i64_i32(segred_group_sizze_224226)) &&\n                            ((local_tid_235939 - squot32(local_tid_235939,\n                                                         wave_sizze_235941) *\n                              wave_sizze_235941) & (2 * offset_235982 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_235967 = ((volatile __local\n                                             double *) red_arr_mem_235943)[sext_i32_i64(local_tid_235939 +\n                                                                           offset_235982)];\n                                x_235968 = ((volatile __local\n                          ",
            "                   double *) red_arr_mem_235945)[sext_i32_i64(local_tid_235939 +\n                                                                           offset_235982)];\n                                x_235969 = ((volatile __local\n                                             double *) red_arr_mem_235947)[sext_i32_i64(local_tid_235939 +\n                                                                           offset_235982)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_235970 = x_235964 +\n                                       x_235967;\n                                double defunc_1_op_res_235971 = x_235965 +\n                                       x_235968;\n                                double defunc_1_op_res_235972 = x_235966 +\n                                       x_235969;\n                                \n                                x_235964 = defunc_1_op_res_235970;\n                                x_235965 = defunc_1_op_res_235971;\n                                x_235966 = defunc_1_op_res_235972;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_235943)[sext_i32_i64(local_tid_235939)] =\n                                    x_235964;\n                                ((volatile __local\n                                  double *) red_arr_mem_235945)[sext_i32_i64(local_tid_235939)] =\n                                    x_235965;\n                                ((volatile __local\n                                  double *) red_arr_mem_235947)[sext_i32_i64(local_tid_235939)] =\n                                    x_235966;\n                            }\n                        }\n                        offset_235982 *= 2;\n                    }\n                   ",
            " while (slt32(skip_waves_235983,\n                                 squot32(sext_i64_i32(segred_group_sizze_224226) +\n                                         wave_sizze_235941 - 1,\n                                         wave_sizze_235941))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_235982 = skip_waves_235983 * wave_sizze_235941;\n                        if (slt32(local_tid_235939 + offset_235982,\n                                  sext_i64_i32(segred_group_sizze_224226)) &&\n                            ((local_tid_235939 - squot32(local_tid_235939,\n                                                         wave_sizze_235941) *\n                              wave_sizze_235941) == 0 &&\n                             (squot32(local_tid_235939, wave_sizze_235941) &\n                              (2 * skip_waves_235983 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_235967 = ((__local\n                                             double *) red_arr_mem_235943)[sext_i32_i64(local_tid_235939 +\n                                                                           offset_235982)];\n                                x_235968 = ((__local\n                                             double *) red_arr_mem_235945)[sext_i32_i64(local_tid_235939 +\n                                                                           offset_235982)];\n                                x_235969 = ((__local\n                                             double *) red_arr_mem_235947)[sext_i32_i64(local_tid_235939 +\n                                                                           offset_235982)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_235970 = x_235964 +\n                                       x_235967;\n                                double defunc",
            "_1_op_res_235971 = x_235965 +\n                                       x_235968;\n                                double defunc_1_op_res_235972 = x_235966 +\n                                       x_235969;\n                                \n                                x_235964 = defunc_1_op_res_235970;\n                                x_235965 = defunc_1_op_res_235971;\n                                x_235966 = defunc_1_op_res_235972;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_235943)[sext_i32_i64(local_tid_235939)] =\n                                    x_235964;\n                                ((__local\n                                  double *) red_arr_mem_235945)[sext_i32_i64(local_tid_235939)] =\n                                    x_235965;\n                                ((__local\n                                  double *) red_arr_mem_235947)[sext_i32_i64(local_tid_235939)] =\n                                    x_235966;\n                            }\n                        }\n                        skip_waves_235983 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_235939 == 0) {\n                            ((__global double *) mem_231169)[gtid_224232 *\n                                                             t_n_m_203650 +\n                                                             gtid_224233] =\n                                x_235964;\n                            ((__global double *) mem_231173)[gtid_224232 *\n                                                             t_n_m_203650 +\n                                                             gtid_224233] =\n                                x_235965;\n                            ((__global double *) mem_231177)[gtid_224232 *\n          ",
            "                                                   t_n_m_203650 +\n                                                             gtid_224233] =\n                                x_235966;\n                        }\n                    }\n                }\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_224226\n}\n__kernel void mainzisegred_large_224307(__global int *global_failure,\n                                        uint sync_arr_mem_236049_backing_offset_0,\n                                        uint red_arr_mem_236047_backing_offset_1,\n                                        uint red_arr_mem_236045_backing_offset_2,\n                                        int64_t n_203490, int64_t q_t_203494,\n                                        int64_t jump_t_203500,\n                                        int64_t partition_sizze_203577,\n                                        int64_t t_n_m_203650, int64_t i_203670,\n                                        int64_t num_groups_224300,\n                                        int64_t groups_per_segment_236029,\n                                        int64_t elements_per_thread_236030,\n                                        int64_t virt_num_groups_236031,\n                                        int64_t threads_per_segment_236033,\n                                        __global unsigned char *ext_mem_229196,\n                                        __global unsigned char *ext_mem_229197,\n                                        __global unsigned char *ext_mem_229460,\n                                        __global unsigned char *ext_mem_229461,\n                                        __global unsigned char *mem_231151,\n                                        __global unsigned char *mem_231155,\n                                        __global unsigned char *mem_231182,\n                                        __global unsigned char *mem_",
            "231186,\n                                        __global unsigned char *mem_231190,\n                                        __global unsigned char *mem_231195,\n                                        __global unsigned char *mem_231199,\n                                        __global\n                                        unsigned char *segred_tmp_mem_236034,\n                                        __global\n                                        unsigned char *segred_tmp_mem_236036,\n                                        __global\n                                        unsigned char *mainzicounter_mem_236038)\n{\n    #define segred_group_sizze_224299 (mainzisegred_group_sizze_223658)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *sync_arr_mem_236049_backing_2 =\n                           &shared_mem[sync_arr_mem_236049_backing_offset_0];\n    volatile unsigned char *red_arr_mem_236047_backing_1 =\n                           &shared_mem[red_arr_mem_236047_backing_offset_1];\n    volatile unsigned char *red_arr_mem_236045_backing_0 =\n                           &shared_mem[red_arr_mem_236045_backing_offset_2];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236040;\n    int32_t local_tid_236041;\n    int64_t group_sizze_236044;\n    int32_t wave_sizze_236043;\n    int32_t group_tid_236042;\n    \n    global_tid_236040 = get_global_id(0);\n    local_tid_236041 = get_local_id(0);\n    group_sizze_236044 = get_local_size(0);\n    wave_sizze_236043 = LOCKSTEP_WIDTH;\n    group_tid_236042 = get_group_id(0);\n    \n    int32_t phys_tid_224307 = global_tid_236040;\n    __local unsigned char *red_arr_mem_236045;\n    \n    red_arr_mem_236045 = (__local unsigned char *) red_arr_mem_236045_backing_0;\n    \n    __local unsigned char *red_arr_mem_236047;\n    \n    red_arr_mem_236047 = (__local unsigned char *) red_arr_mem_236047_backing_1;\n    \n    __local unsigned char *sync_arr_mem_236049;\n  ",
            "  \n    sync_arr_mem_236049 = (__local\n                           unsigned char *) sync_arr_mem_236049_backing_2;\n    \n    int32_t phys_group_id_236051;\n    \n    phys_group_id_236051 = get_group_id(0);\n    for (int32_t i_236052 = 0; i_236052 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_236031) - phys_group_id_236051,\n                   sext_i64_i32(num_groups_224300)); i_236052++) {\n        int32_t virt_group_id_236053 = phys_group_id_236051 + i_236052 *\n                sext_i64_i32(num_groups_224300);\n        int32_t flat_segment_id_236054 = squot32(virt_group_id_236053,\n                                                 sext_i64_i32(groups_per_segment_236029));\n        int64_t global_tid_236055 = srem64(sext_i32_i64(virt_group_id_236053) *\n                                           segred_group_sizze_224299 +\n                                           sext_i32_i64(local_tid_236041),\n                                           segred_group_sizze_224299 *\n                                           groups_per_segment_236029);\n        int64_t slice_236056 = t_n_m_203650;\n        int64_t slice_236057 = partition_sizze_203577 * slice_236056;\n        int64_t gtid_224304 = squot64(sext_i32_i64(flat_segment_id_236054),\n                                      slice_236056);\n        int64_t remnant_236058 = sext_i32_i64(flat_segment_id_236054) -\n                gtid_224304 * slice_236056;\n        int64_t gtid_224305 = remnant_236058;\n        int64_t remnant_236059 = remnant_236058 - gtid_224305;\n        int64_t gtid_224306;\n        double x_acc_236060;\n        double x_acc_236061;\n        int64_t chunk_sizze_236062 = smin64(elements_per_thread_236030,\n                                            sdiv_up64(q_t_203494 -\n                                                      global_tid_236055,\n                                                      threads_per_segment_236033));\n        double x_224308;\n        double x_224309;\n        double x_224310;\n        double x_224311;\n      ",
            "  \n        // neutral-initialise the accumulators\n        {\n            x_acc_236060 = 0.0;\n            x_acc_236061 = 0.0;\n        }\n        for (int64_t i_236069 = 0; i_236069 < chunk_sizze_236062; i_236069++) {\n            gtid_224306 = global_tid_236055 + threads_per_segment_236033 *\n                i_236069;\n            // apply map function\n            {\n                int64_t x_224315;\n                \n                x_224315 = ((__global int64_t *) ext_mem_229196)[gtid_224304];\n                \n                int64_t x_224324;\n                \n                x_224324 = ((__global int64_t *) ext_mem_229461)[gtid_224304 *\n                                                                 t_n_m_203650 +\n                                                                 gtid_224305];\n                \n                double x_224325;\n                \n                x_224325 = ((__global double *) ext_mem_229460)[gtid_224304 *\n                                                                t_n_m_203650 +\n                                                                gtid_224305];\n                \n                int64_t binop_y_228669 = mul64(jump_t_203500, gtid_224305);\n                int64_t binop_y_228670 = smin64(i_203670, binop_y_228669);\n                int64_t index_primexp_228671 = add64((int64_t) 1,\n                                                     binop_y_228670);\n                double a11_224327;\n                \n                a11_224327 = ((__global double *) mem_231182)[gtid_224304 *\n                                                              t_n_m_203650 +\n                                                              gtid_224305];\n                \n                double b11_224328;\n                \n                b11_224328 = ((__global double *) mem_231186)[gtid_224304 *\n                                                              t_n_m_203650 +\n                                                              gtid_224305];\n                ",
            "\n                double c11_224329;\n                \n                c11_224329 = ((__global double *) mem_231190)[gtid_224304 *\n                                                              t_n_m_203650 +\n                                                              gtid_224305];\n                \n                bool cond_224331 = sle64(x_224315, gtid_224306);\n                int64_t defunc_0_f_res_224332;\n                \n                if (cond_224331) {\n                    defunc_0_f_res_224332 = (int64_t) 0;\n                } else {\n                    int64_t i_224333 = add64(gtid_224306, x_224324);\n                    int64_t defunc_0_add_arg_224334;\n                    \n                    defunc_0_add_arg_224334 = ((__global\n                                                int64_t *) ext_mem_229197)[gtid_224304 *\n                                                                           n_203490 +\n                                                                           i_224333];\n                    \n                    int64_t defunc_1_add_res_224335 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_224334);\n                    \n                    defunc_0_f_res_224332 = defunc_1_add_res_224335;\n                }\n                \n                double defunc_0_f_res_224336;\n                \n                if (cond_224331) {\n                    defunc_0_f_res_224336 = 0.0;\n                } else {\n                    int64_t i_224337 = add64(gtid_224306, x_224324);\n                    double defunc_0_add_arg_224338;\n                    \n                    defunc_0_add_arg_224338 = ((__global\n                                                double *) mem_231151)[gtid_224304 *\n                                                                      n_203490 +\n                                                                      i_224337];\n                    defunc_0_f_res_224336 = defunc_0_add_arg_224338;\n   ",
            "             }\n                \n                int64_t binop_p_224339 = sub64(defunc_0_f_res_224332,\n                                               index_primexp_228671);\n                double defunc_0_f_res_224340 = sitofp_i64_f64(binop_p_224339);\n                double abs_res_224341 = fabs(defunc_0_f_res_224340);\n                double tmp1_224342 = abs_res_224341 / x_224325;\n                double x_224343 = tmp1_224342 * tmp1_224342;\n                double y_224344 = tmp1_224342 * x_224343;\n                double tmp2_224345 = 1.0 - y_224344;\n                double x_224346 = tmp2_224345 * tmp2_224345;\n                double tmp3_224347 = tmp2_224345 * x_224346;\n                double tmp4_224348 = defunc_0_f_res_224336 * tmp3_224347;\n                double defunc_1_f_res_224349 = defunc_0_f_res_224340 *\n                       tmp4_224348;\n                double defunc_0_f_res_224350;\n                \n                if (cond_224331) {\n                    defunc_0_f_res_224350 = 0.0;\n                } else {\n                    int64_t i_224351 = add64(gtid_224306, x_224324);\n                    double defunc_0_add_arg_224352;\n                    \n                    defunc_0_add_arg_224352 = ((__global\n                                                double *) mem_231155)[gtid_224304 *\n                                                                      n_203490 +\n                                                                      i_224351];\n                    defunc_0_f_res_224350 = defunc_0_add_arg_224352;\n                }\n                \n                double x_224353 = a11_224327 * tmp4_224348;\n                double y_224354 = b11_224328 * defunc_1_f_res_224349;\n                double x_224355 = x_224353 + y_224354;\n                double defunc_9_fit_fun_res_224356 = defunc_0_f_res_224350 *\n                       x_224355;\n                double x_224357 = b11_224328 * tmp4_224348;\n                double y_224358 = c11_224329 * defunc_1_f_res_224",
            "349;\n                double x_224359 = x_224357 + y_224358;\n                double defunc_9_slope_fun_res_224360 = defunc_0_f_res_224350 *\n                       x_224359;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_224308 = x_acc_236060;\n                    x_224309 = x_acc_236061;\n                }\n                // load new values\n                {\n                    x_224310 = defunc_9_fit_fun_res_224356;\n                    x_224311 = defunc_9_slope_fun_res_224360;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_224312 = x_224308 + x_224310;\n                    double defunc_1_op_res_224313 = x_224309 + x_224311;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_236060 = defunc_1_op_res_224312;\n                        x_acc_236061 = defunc_1_op_res_224313;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_224308 = x_acc_236060;\n            x_224309 = x_acc_236061;\n            ((__local\n              double *) red_arr_mem_236045)[sext_i32_i64(local_tid_236041)] =\n                x_224308;\n            ((__local\n              double *) red_arr_mem_236047)[sext_i32_i64(local_tid_236041)] =\n                x_224309;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_236070;\n        int32_t skip_waves_236071 = 1;\n        double x_236063;\n        double x_236064;\n        double x_236065;\n        double x_236066;\n        \n        offset_236070 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_236041,\n                      sext_i64_i32(segred_group_sizze_224299))) {\n                x_236063 = ((__local\n                             dou",
            "ble *) red_arr_mem_236045)[sext_i32_i64(local_tid_236041 +\n                                                           offset_236070)];\n                x_236064 = ((__local\n                             double *) red_arr_mem_236047)[sext_i32_i64(local_tid_236041 +\n                                                           offset_236070)];\n            }\n        }\n        offset_236070 = 1;\n        while (slt32(offset_236070, wave_sizze_236043)) {\n            if (slt32(local_tid_236041 + offset_236070,\n                      sext_i64_i32(segred_group_sizze_224299)) &&\n                ((local_tid_236041 - squot32(local_tid_236041,\n                                             wave_sizze_236043) *\n                  wave_sizze_236043) & (2 * offset_236070 - 1)) == 0) {\n                // read array element\n                {\n                    x_236065 = ((volatile __local\n                                 double *) red_arr_mem_236045)[sext_i32_i64(local_tid_236041 +\n                                                               offset_236070)];\n                    x_236066 = ((volatile __local\n                                 double *) red_arr_mem_236047)[sext_i32_i64(local_tid_236041 +\n                                                               offset_236070)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_236067 = x_236063 + x_236065;\n                    double defunc_1_op_res_236068 = x_236064 + x_236066;\n                    \n                    x_236063 = defunc_1_op_res_236067;\n                    x_236064 = defunc_1_op_res_236068;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_236045)[sext_i32_i64(local_tid_236041)] =\n                        x_236063;\n                    ((volatile __local\n                      double *) red_arr_mem_236047)[sext_i32_i64(local_tid_236041)] =\n",
            "                        x_236064;\n                }\n            }\n            offset_236070 *= 2;\n        }\n        while (slt32(skip_waves_236071,\n                     squot32(sext_i64_i32(segred_group_sizze_224299) +\n                             wave_sizze_236043 - 1, wave_sizze_236043))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_236070 = skip_waves_236071 * wave_sizze_236043;\n            if (slt32(local_tid_236041 + offset_236070,\n                      sext_i64_i32(segred_group_sizze_224299)) &&\n                ((local_tid_236041 - squot32(local_tid_236041,\n                                             wave_sizze_236043) *\n                  wave_sizze_236043) == 0 && (squot32(local_tid_236041,\n                                                      wave_sizze_236043) & (2 *\n                                                                            skip_waves_236071 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_236065 = ((__local\n                                 double *) red_arr_mem_236045)[sext_i32_i64(local_tid_236041 +\n                                                               offset_236070)];\n                    x_236066 = ((__local\n                                 double *) red_arr_mem_236047)[sext_i32_i64(local_tid_236041 +\n                                                               offset_236070)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_236067 = x_236063 + x_236065;\n                    double defunc_1_op_res_236068 = x_236064 + x_236066;\n                    \n                    x_236063 = defunc_1_op_res_236067;\n                    x_236064 = defunc_1_op_res_236068;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red",
            "_arr_mem_236045)[sext_i32_i64(local_tid_236041)] =\n                        x_236063;\n                    ((__local\n                      double *) red_arr_mem_236047)[sext_i32_i64(local_tid_236041)] =\n                        x_236064;\n                }\n            }\n            skip_waves_236071 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_236041) == (int64_t) 0) {\n                x_acc_236060 = x_236063;\n                x_acc_236061 = x_236064;\n            }\n        }\n        if (groups_per_segment_236029 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_236041 == 0) {\n                    ((__global double *) mem_231195)[gtid_224304 *\n                                                     t_n_m_203650 +\n                                                     gtid_224305] =\n                        x_acc_236060;\n                    ((__global double *) mem_231199)[gtid_224304 *\n                                                     t_n_m_203650 +\n                                                     gtid_224305] =\n                        x_acc_236061;\n                }\n            }\n        } else {\n            int32_t old_counter_236072;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_236041 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_236034)[sext_i32_i64(virt_group_id_236053)] =\n                        x_acc_236060;\n                    ((__global\n                      double *) segred_tmp_mem_236036)[sext_i32_i64(virt_group_id_236053)] =\n                        x_acc_236061;\n                    mem_fence_global();\n                    old_counter_236072 =\n                        atomic_add_i32_global(&((volatile __global\n                                           ",
            "      int *) mainzicounter_mem_236038)[sext_i32_i64(srem32(flat_segment_id_236054,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_236049)[(int64_t) 0] =\n                        old_counter_236072 == groups_per_segment_236029 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_236073;\n            \n            is_last_group_236073 = ((__local\n                                     bool *) sync_arr_mem_236049)[(int64_t) 0];\n            if (is_last_group_236073) {\n                if (local_tid_236041 == 0) {\n                    old_counter_236072 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_236038)[sext_i32_i64(srem32(flat_segment_id_236054,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_236029));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_236074 =\n                            sdiv_up64(groups_per_segment_236029,\n                                      segred_group_sizze_224299);\n                    \n                    x_224308 = 0.0;\n                    x_224309 = 0.0;\n                    for (int64_t i_236075 = 0; i_236075 <\n                         read_per_thread_236074; i_236075++) {\n                        int64_t group_res_id_236076 =\n                                sext_i32_i64(local_tid_236041) *\n                                read_per_thread_236074 + i_236075;\n                        int6",
            "4_t index_of_group_res_236077 =\n                                sext_i32_i64(flat_segment_id_236054) *\n                                groups_per_segment_236029 + group_res_id_236076;\n                        \n                        if (slt64(group_res_id_236076,\n                                  groups_per_segment_236029)) {\n                            x_224310 = ((__global\n                                         double *) segred_tmp_mem_236034)[index_of_group_res_236077];\n                            x_224311 = ((__global\n                                         double *) segred_tmp_mem_236036)[index_of_group_res_236077];\n                            \n                            double defunc_1_op_res_224312 = x_224308 + x_224310;\n                            double defunc_1_op_res_224313 = x_224309 + x_224311;\n                            \n                            x_224308 = defunc_1_op_res_224312;\n                            x_224309 = defunc_1_op_res_224313;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_236045)[sext_i32_i64(local_tid_236041)] =\n                    x_224308;\n                ((__local\n                  double *) red_arr_mem_236047)[sext_i32_i64(local_tid_236041)] =\n                    x_224309;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_236078;\n                    int32_t skip_waves_236079 = 1;\n                    double x_236063;\n                    double x_236064;\n                    double x_236065;\n                    double x_236066;\n                    \n                    offset_236078 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_236041,\n                                  sext_i64_i32(segred_group_sizze_224299))) {\n                            x_236063 = ((__l",
            "ocal\n                                         double *) red_arr_mem_236045)[sext_i32_i64(local_tid_236041 +\n                                                                       offset_236078)];\n                            x_236064 = ((__local\n                                         double *) red_arr_mem_236047)[sext_i32_i64(local_tid_236041 +\n                                                                       offset_236078)];\n                        }\n                    }\n                    offset_236078 = 1;\n                    while (slt32(offset_236078, wave_sizze_236043)) {\n                        if (slt32(local_tid_236041 + offset_236078,\n                                  sext_i64_i32(segred_group_sizze_224299)) &&\n                            ((local_tid_236041 - squot32(local_tid_236041,\n                                                         wave_sizze_236043) *\n                              wave_sizze_236043) & (2 * offset_236078 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_236065 = ((volatile __local\n                                             double *) red_arr_mem_236045)[sext_i32_i64(local_tid_236041 +\n                                                                           offset_236078)];\n                                x_236066 = ((volatile __local\n                                             double *) red_arr_mem_236047)[sext_i32_i64(local_tid_236041 +\n                                                                           offset_236078)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_236067 = x_236063 +\n                                       x_236065;\n                                double defunc_1_op_res_236068 = x_236064 +\n                                       x_236066;\n                             ",
            "   \n                                x_236063 = defunc_1_op_res_236067;\n                                x_236064 = defunc_1_op_res_236068;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_236045)[sext_i32_i64(local_tid_236041)] =\n                                    x_236063;\n                                ((volatile __local\n                                  double *) red_arr_mem_236047)[sext_i32_i64(local_tid_236041)] =\n                                    x_236064;\n                            }\n                        }\n                        offset_236078 *= 2;\n                    }\n                    while (slt32(skip_waves_236079,\n                                 squot32(sext_i64_i32(segred_group_sizze_224299) +\n                                         wave_sizze_236043 - 1,\n                                         wave_sizze_236043))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_236078 = skip_waves_236079 * wave_sizze_236043;\n                        if (slt32(local_tid_236041 + offset_236078,\n                                  sext_i64_i32(segred_group_sizze_224299)) &&\n                            ((local_tid_236041 - squot32(local_tid_236041,\n                                                         wave_sizze_236043) *\n                              wave_sizze_236043) == 0 &&\n                             (squot32(local_tid_236041, wave_sizze_236043) &\n                              (2 * skip_waves_236079 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_236065 = ((__local\n                                             double *) red_arr_mem_236045)[sext_i32_i64(local_tid_236041 +\n                                                                           offset_236078)];\n    ",
            "                            x_236066 = ((__local\n                                             double *) red_arr_mem_236047)[sext_i32_i64(local_tid_236041 +\n                                                                           offset_236078)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_236067 = x_236063 +\n                                       x_236065;\n                                double defunc_1_op_res_236068 = x_236064 +\n                                       x_236066;\n                                \n                                x_236063 = defunc_1_op_res_236067;\n                                x_236064 = defunc_1_op_res_236068;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_236045)[sext_i32_i64(local_tid_236041)] =\n                                    x_236063;\n                                ((__local\n                                  double *) red_arr_mem_236047)[sext_i32_i64(local_tid_236041)] =\n                                    x_236064;\n                            }\n                        }\n                        skip_waves_236079 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_236041 == 0) {\n                            ((__global double *) mem_231195)[gtid_224304 *\n                                                             t_n_m_203650 +\n                                                             gtid_224305] =\n                                x_236063;\n                            ((__global double *) mem_231199)[gtid_224304 *\n                                                             t_n_m_203650 +\n                                              ",
            "               gtid_224305] =\n                                x_236064;\n                        }\n                    }\n                }\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_224299\n}\n__kernel void mainzisegred_large_225523(__global int *global_failure,\n                                        uint sync_arr_mem_236246_backing_offset_0,\n                                        uint red_arr_mem_236244_backing_offset_1,\n                                        uint red_arr_mem_236242_backing_offset_2,\n                                        uint red_arr_mem_236240_backing_offset_3,\n                                        uint red_arr_mem_236238_backing_offset_4,\n                                        uint red_arr_mem_236236_backing_offset_5,\n                                        int64_t n_203490, int64_t q_t_203494,\n                                        int64_t jump_t_203500,\n                                        int64_t partition_sizze_203577,\n                                        int64_t t_n_m_203650, int64_t i_203670,\n                                        int64_t num_groups_225513,\n                                        int64_t groups_per_segment_236214,\n                                        int64_t elements_per_thread_236215,\n                                        int64_t virt_num_groups_236216,\n                                        int64_t threads_per_segment_236218,\n                                        __global unsigned char *ext_mem_229196,\n                                        __global unsigned char *ext_mem_229197,\n                                        __global unsigned char *ext_mem_229460,\n                                        __global unsigned char *ext_mem_229461,\n                                        __global unsigned char *mem_231320,\n                                        __global unsigned char *mem_231338,\n          ",
            "                              __global unsigned char *mem_231342,\n                                        __global unsigned char *mem_231346,\n                                        __global unsigned char *mem_231350,\n                                        __global unsigned char *mem_231354,\n                                        __global\n                                        unsigned char *segred_tmp_mem_236219,\n                                        __global\n                                        unsigned char *segred_tmp_mem_236221,\n                                        __global\n                                        unsigned char *segred_tmp_mem_236223,\n                                        __global\n                                        unsigned char *segred_tmp_mem_236225,\n                                        __global\n                                        unsigned char *segred_tmp_mem_236227,\n                                        __global\n                                        unsigned char *mainzicounter_mem_236229)\n{\n    #define segred_group_sizze_225512 (mainzisegred_group_sizze_224961)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *sync_arr_mem_236246_backing_5 =\n                           &shared_mem[sync_arr_mem_236246_backing_offset_0];\n    volatile unsigned char *red_arr_mem_236244_backing_4 =\n                           &shared_mem[red_arr_mem_236244_backing_offset_1];\n    volatile unsigned char *red_arr_mem_236242_backing_3 =\n                           &shared_mem[red_arr_mem_236242_backing_offset_2];\n    volatile unsigned char *red_arr_mem_236240_backing_2 =\n                           &shared_mem[red_arr_mem_236240_backing_offset_3];\n    volatile unsigned char *red_arr_mem_236238_backing_1 =\n                           &shared_mem[red_arr_mem_236238_backing_offset_4];\n    volatile unsigned char *red_arr_mem_236236_backing_0 =\n                           &sha",
            "red_mem[red_arr_mem_236236_backing_offset_5];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236231;\n    int32_t local_tid_236232;\n    int64_t group_sizze_236235;\n    int32_t wave_sizze_236234;\n    int32_t group_tid_236233;\n    \n    global_tid_236231 = get_global_id(0);\n    local_tid_236232 = get_local_id(0);\n    group_sizze_236235 = get_local_size(0);\n    wave_sizze_236234 = LOCKSTEP_WIDTH;\n    group_tid_236233 = get_group_id(0);\n    \n    int32_t phys_tid_225523 = global_tid_236231;\n    __local unsigned char *red_arr_mem_236236;\n    \n    red_arr_mem_236236 = (__local unsigned char *) red_arr_mem_236236_backing_0;\n    \n    __local unsigned char *red_arr_mem_236238;\n    \n    red_arr_mem_236238 = (__local unsigned char *) red_arr_mem_236238_backing_1;\n    \n    __local unsigned char *red_arr_mem_236240;\n    \n    red_arr_mem_236240 = (__local unsigned char *) red_arr_mem_236240_backing_2;\n    \n    __local unsigned char *red_arr_mem_236242;\n    \n    red_arr_mem_236242 = (__local unsigned char *) red_arr_mem_236242_backing_3;\n    \n    __local unsigned char *red_arr_mem_236244;\n    \n    red_arr_mem_236244 = (__local unsigned char *) red_arr_mem_236244_backing_4;\n    \n    __local unsigned char *sync_arr_mem_236246;\n    \n    sync_arr_mem_236246 = (__local\n                           unsigned char *) sync_arr_mem_236246_backing_5;\n    \n    int32_t phys_group_id_236248;\n    \n    phys_group_id_236248 = get_group_id(0);\n    for (int32_t i_236249 = 0; i_236249 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_236216) - phys_group_id_236248,\n                   sext_i64_i32(num_groups_225513)); i_236249++) {\n        int32_t virt_group_id_236250 = phys_group_id_236248 + i_236249 *\n                sext_i64_i32(num_groups_225513);\n        int32_t flat_segment_id_236251 = squot32(virt_group_id_236250,\n                                                 sext_i64_i32(groups_per_segment_236214));\n        int64_t global_tid_236252 = srem64(sext_i32_i64(virt_grou",
            "p_id_236250) *\n                                           segred_group_sizze_225512 +\n                                           sext_i32_i64(local_tid_236232),\n                                           segred_group_sizze_225512 *\n                                           groups_per_segment_236214);\n        int64_t slice_236253 = t_n_m_203650;\n        int64_t slice_236254 = partition_sizze_203577 * slice_236253;\n        int64_t gtid_225520 = squot64(sext_i32_i64(flat_segment_id_236251),\n                                      slice_236253);\n        int64_t remnant_236255 = sext_i32_i64(flat_segment_id_236251) -\n                gtid_225520 * slice_236253;\n        int64_t gtid_225521 = remnant_236255;\n        int64_t remnant_236256 = remnant_236255 - gtid_225521;\n        int64_t gtid_225522;\n        double x_acc_236257;\n        double x_acc_236258;\n        double x_acc_236259;\n        double x_acc_236260;\n        double x_acc_236261;\n        int64_t chunk_sizze_236262 = smin64(elements_per_thread_236215,\n                                            sdiv_up64(q_t_203494 -\n                                                      global_tid_236252,\n                                                      threads_per_segment_236218));\n        double x_225524;\n        double x_225525;\n        double x_225526;\n        double x_225527;\n        double x_225528;\n        double x_225529;\n        double x_225530;\n        double x_225531;\n        double x_225532;\n        double x_225533;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_236257 = 0.0;\n            x_acc_236258 = 0.0;\n            x_acc_236259 = 0.0;\n            x_acc_236260 = 0.0;\n            x_acc_236261 = 0.0;\n        }\n        for (int64_t i_236278 = 0; i_236278 < chunk_sizze_236262; i_236278++) {\n            gtid_225522 = global_tid_236252 + threads_per_segment_236218 *\n                i_236278;\n            // apply map function\n            {\n                int64_t x_225540;\n         ",
            "       \n                x_225540 = ((__global int64_t *) ext_mem_229196)[gtid_225520];\n                \n                int64_t x_225545;\n                \n                x_225545 = ((__global int64_t *) ext_mem_229461)[gtid_225520 *\n                                                                 t_n_m_203650 +\n                                                                 gtid_225521];\n                \n                double x_225546;\n                \n                x_225546 = ((__global double *) ext_mem_229460)[gtid_225520 *\n                                                                t_n_m_203650 +\n                                                                gtid_225521];\n                \n                int64_t binop_y_228684 = mul64(jump_t_203500, gtid_225521);\n                int64_t binop_y_228685 = smin64(i_203670, binop_y_228684);\n                int64_t index_primexp_228686 = add64((int64_t) 1,\n                                                     binop_y_228685);\n                bool cond_225549 = sle64(x_225540, gtid_225522);\n                int64_t defunc_0_f_res_225550;\n                \n                if (cond_225549) {\n                    defunc_0_f_res_225550 = (int64_t) 0;\n                } else {\n                    int64_t i_225551 = add64(gtid_225522, x_225545);\n                    int64_t defunc_0_add_arg_225552;\n                    \n                    defunc_0_add_arg_225552 = ((__global\n                                                int64_t *) ext_mem_229197)[gtid_225520 *\n                                                                           n_203490 +\n                                                                           i_225551];\n                    \n                    int64_t defunc_1_add_res_225553 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_225552);\n                    \n                    defunc_0_f_res_225550 = defunc_1_add_res_225553;\n                }\n      ",
            "          \n                double defunc_0_f_res_225554;\n                \n                if (cond_225549) {\n                    defunc_0_f_res_225554 = 0.0;\n                } else {\n                    int64_t i_225555 = add64(gtid_225522, x_225545);\n                    double defunc_0_add_arg_225556;\n                    \n                    defunc_0_add_arg_225556 = ((__global\n                                                double *) mem_231320)[gtid_225520 *\n                                                                      n_203490 +\n                                                                      i_225555];\n                    defunc_0_f_res_225554 = defunc_0_add_arg_225556;\n                }\n                \n                int64_t binop_p_225557 = sub64(defunc_0_f_res_225550,\n                                               index_primexp_228686);\n                double defunc_0_f_res_225558 = sitofp_i64_f64(binop_p_225557);\n                double abs_res_225559 = fabs(defunc_0_f_res_225558);\n                double tmp1_225560 = abs_res_225559 / x_225546;\n                double x_225561 = tmp1_225560 * tmp1_225560;\n                double y_225562 = tmp1_225560 * x_225561;\n                double tmp2_225563 = 1.0 - y_225562;\n                double x_225564 = tmp2_225563 * tmp2_225563;\n                double tmp3_225565 = tmp2_225563 * x_225564;\n                double w_j_225566 = defunc_0_f_res_225554 * tmp3_225565;\n                double xw_j_225567 = defunc_0_f_res_225558 * w_j_225566;\n                double x2w_j_225568 = defunc_0_f_res_225558 * xw_j_225567;\n                double x3w_j_225569 = defunc_0_f_res_225558 * x2w_j_225568;\n                double x4w_j_225570 = defunc_0_f_res_225558 * x3w_j_225569;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_225524 = x_acc_236257;\n                    x_225525 = x_acc_236258;\n                    x_225526",
            " = x_acc_236259;\n                    x_225527 = x_acc_236260;\n                    x_225528 = x_acc_236261;\n                }\n                // load new values\n                {\n                    x_225529 = w_j_225566;\n                    x_225530 = xw_j_225567;\n                    x_225531 = x2w_j_225568;\n                    x_225532 = x3w_j_225569;\n                    x_225533 = x4w_j_225570;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_225534 = x_225524 + x_225529;\n                    double defunc_1_op_res_225535 = x_225525 + x_225530;\n                    double defunc_1_op_res_225536 = x_225526 + x_225531;\n                    double defunc_1_op_res_225537 = x_225527 + x_225532;\n                    double defunc_1_op_res_225538 = x_225528 + x_225533;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_236257 = defunc_1_op_res_225534;\n                        x_acc_236258 = defunc_1_op_res_225535;\n                        x_acc_236259 = defunc_1_op_res_225536;\n                        x_acc_236260 = defunc_1_op_res_225537;\n                        x_acc_236261 = defunc_1_op_res_225538;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_225524 = x_acc_236257;\n            x_225525 = x_acc_236258;\n            x_225526 = x_acc_236259;\n            x_225527 = x_acc_236260;\n            x_225528 = x_acc_236261;\n            ((__local\n              double *) red_arr_mem_236236)[sext_i32_i64(local_tid_236232)] =\n                x_225524;\n            ((__local\n              double *) red_arr_mem_236238)[sext_i32_i64(local_tid_236232)] =\n                x_225525;\n            ((__local\n              double *) red_arr_mem_236240)[sext_i32_i64(local_tid_236232)] =\n                x_225526;\n            ((__local\n              double *) r",
            "ed_arr_mem_236242)[sext_i32_i64(local_tid_236232)] =\n                x_225527;\n            ((__local\n              double *) red_arr_mem_236244)[sext_i32_i64(local_tid_236232)] =\n                x_225528;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_236279;\n        int32_t skip_waves_236280 = 1;\n        double x_236263;\n        double x_236264;\n        double x_236265;\n        double x_236266;\n        double x_236267;\n        double x_236268;\n        double x_236269;\n        double x_236270;\n        double x_236271;\n        double x_236272;\n        \n        offset_236279 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_236232,\n                      sext_i64_i32(segred_group_sizze_225512))) {\n                x_236263 = ((__local\n                             double *) red_arr_mem_236236)[sext_i32_i64(local_tid_236232 +\n                                                           offset_236279)];\n                x_236264 = ((__local\n                             double *) red_arr_mem_236238)[sext_i32_i64(local_tid_236232 +\n                                                           offset_236279)];\n                x_236265 = ((__local\n                             double *) red_arr_mem_236240)[sext_i32_i64(local_tid_236232 +\n                                                           offset_236279)];\n                x_236266 = ((__local\n                             double *) red_arr_mem_236242)[sext_i32_i64(local_tid_236232 +\n                                                           offset_236279)];\n                x_236267 = ((__local\n                             double *) red_arr_mem_236244)[sext_i32_i64(local_tid_236232 +\n                                                           offset_236279)];\n            }\n        }\n        offset_236279 = 1;\n        while (slt32(offset_236279, wave_sizze_236234)) {\n            if (slt32(local_tid_236232 + offset_236279,\n                      s",
            "ext_i64_i32(segred_group_sizze_225512)) &&\n                ((local_tid_236232 - squot32(local_tid_236232,\n                                             wave_sizze_236234) *\n                  wave_sizze_236234) & (2 * offset_236279 - 1)) == 0) {\n                // read array element\n                {\n                    x_236268 = ((volatile __local\n                                 double *) red_arr_mem_236236)[sext_i32_i64(local_tid_236232 +\n                                                               offset_236279)];\n                    x_236269 = ((volatile __local\n                                 double *) red_arr_mem_236238)[sext_i32_i64(local_tid_236232 +\n                                                               offset_236279)];\n                    x_236270 = ((volatile __local\n                                 double *) red_arr_mem_236240)[sext_i32_i64(local_tid_236232 +\n                                                               offset_236279)];\n                    x_236271 = ((volatile __local\n                                 double *) red_arr_mem_236242)[sext_i32_i64(local_tid_236232 +\n                                                               offset_236279)];\n                    x_236272 = ((volatile __local\n                                 double *) red_arr_mem_236244)[sext_i32_i64(local_tid_236232 +\n                                                               offset_236279)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_236273 = x_236263 + x_236268;\n                    double defunc_1_op_res_236274 = x_236264 + x_236269;\n                    double defunc_1_op_res_236275 = x_236265 + x_236270;\n                    double defunc_1_op_res_236276 = x_236266 + x_236271;\n                    double defunc_1_op_res_236277 = x_236267 + x_236272;\n                    \n                    x_236263 = defunc_1_op_res_236273;\n                    x_236264 = defunc_1_op_res_236274",
            ";\n                    x_236265 = defunc_1_op_res_236275;\n                    x_236266 = defunc_1_op_res_236276;\n                    x_236267 = defunc_1_op_res_236277;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_236236)[sext_i32_i64(local_tid_236232)] =\n                        x_236263;\n                    ((volatile __local\n                      double *) red_arr_mem_236238)[sext_i32_i64(local_tid_236232)] =\n                        x_236264;\n                    ((volatile __local\n                      double *) red_arr_mem_236240)[sext_i32_i64(local_tid_236232)] =\n                        x_236265;\n                    ((volatile __local\n                      double *) red_arr_mem_236242)[sext_i32_i64(local_tid_236232)] =\n                        x_236266;\n                    ((volatile __local\n                      double *) red_arr_mem_236244)[sext_i32_i64(local_tid_236232)] =\n                        x_236267;\n                }\n            }\n            offset_236279 *= 2;\n        }\n        while (slt32(skip_waves_236280,\n                     squot32(sext_i64_i32(segred_group_sizze_225512) +\n                             wave_sizze_236234 - 1, wave_sizze_236234))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_236279 = skip_waves_236280 * wave_sizze_236234;\n            if (slt32(local_tid_236232 + offset_236279,\n                      sext_i64_i32(segred_group_sizze_225512)) &&\n                ((local_tid_236232 - squot32(local_tid_236232,\n                                             wave_sizze_236234) *\n                  wave_sizze_236234) == 0 && (squot32(local_tid_236232,\n                                                      wave_sizze_236234) & (2 *\n                                                                            skip_waves_236280 -\n                                                                            1)) ==\n      ",
            "           0)) {\n                // read array element\n                {\n                    x_236268 = ((__local\n                                 double *) red_arr_mem_236236)[sext_i32_i64(local_tid_236232 +\n                                                               offset_236279)];\n                    x_236269 = ((__local\n                                 double *) red_arr_mem_236238)[sext_i32_i64(local_tid_236232 +\n                                                               offset_236279)];\n                    x_236270 = ((__local\n                                 double *) red_arr_mem_236240)[sext_i32_i64(local_tid_236232 +\n                                                               offset_236279)];\n                    x_236271 = ((__local\n                                 double *) red_arr_mem_236242)[sext_i32_i64(local_tid_236232 +\n                                                               offset_236279)];\n                    x_236272 = ((__local\n                                 double *) red_arr_mem_236244)[sext_i32_i64(local_tid_236232 +\n                                                               offset_236279)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_236273 = x_236263 + x_236268;\n                    double defunc_1_op_res_236274 = x_236264 + x_236269;\n                    double defunc_1_op_res_236275 = x_236265 + x_236270;\n                    double defunc_1_op_res_236276 = x_236266 + x_236271;\n                    double defunc_1_op_res_236277 = x_236267 + x_236272;\n                    \n                    x_236263 = defunc_1_op_res_236273;\n                    x_236264 = defunc_1_op_res_236274;\n                    x_236265 = defunc_1_op_res_236275;\n                    x_236266 = defunc_1_op_res_236276;\n                    x_236267 = defunc_1_op_res_236277;\n                }\n                // write result of operation\n                {\n                    ((__",
            "local\n                      double *) red_arr_mem_236236)[sext_i32_i64(local_tid_236232)] =\n                        x_236263;\n                    ((__local\n                      double *) red_arr_mem_236238)[sext_i32_i64(local_tid_236232)] =\n                        x_236264;\n                    ((__local\n                      double *) red_arr_mem_236240)[sext_i32_i64(local_tid_236232)] =\n                        x_236265;\n                    ((__local\n                      double *) red_arr_mem_236242)[sext_i32_i64(local_tid_236232)] =\n                        x_236266;\n                    ((__local\n                      double *) red_arr_mem_236244)[sext_i32_i64(local_tid_236232)] =\n                        x_236267;\n                }\n            }\n            skip_waves_236280 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_236232) == (int64_t) 0) {\n                x_acc_236257 = x_236263;\n                x_acc_236258 = x_236264;\n                x_acc_236259 = x_236265;\n                x_acc_236260 = x_236266;\n                x_acc_236261 = x_236267;\n            }\n        }\n        if (groups_per_segment_236214 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_236232 == 0) {\n                    ((__global double *) mem_231338)[gtid_225520 *\n                                                     t_n_m_203650 +\n                                                     gtid_225521] =\n                        x_acc_236257;\n                    ((__global double *) mem_231342)[gtid_225520 *\n                                                     t_n_m_203650 +\n                                                     gtid_225521] =\n                        x_acc_236258;\n                    ((__global double *) mem_231346)[gtid_225520 *\n                                                     t_n_m_203650 +\n",
            "                                                     gtid_225521] =\n                        x_acc_236259;\n                    ((__global double *) mem_231350)[gtid_225520 *\n                                                     t_n_m_203650 +\n                                                     gtid_225521] =\n                        x_acc_236260;\n                    ((__global double *) mem_231354)[gtid_225520 *\n                                                     t_n_m_203650 +\n                                                     gtid_225521] =\n                        x_acc_236261;\n                }\n            }\n        } else {\n            int32_t old_counter_236281;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_236232 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_236219)[sext_i32_i64(virt_group_id_236250)] =\n                        x_acc_236257;\n                    ((__global\n                      double *) segred_tmp_mem_236221)[sext_i32_i64(virt_group_id_236250)] =\n                        x_acc_236258;\n                    ((__global\n                      double *) segred_tmp_mem_236223)[sext_i32_i64(virt_group_id_236250)] =\n                        x_acc_236259;\n                    ((__global\n                      double *) segred_tmp_mem_236225)[sext_i32_i64(virt_group_id_236250)] =\n                        x_acc_236260;\n                    ((__global\n                      double *) segred_tmp_mem_236227)[sext_i32_i64(virt_group_id_236250)] =\n                        x_acc_236261;\n                    mem_fence_global();\n                    old_counter_236281 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_236229)[sext_i32_i64(srem32(flat_segment_id_236251,\n                                                                                              ",
            "        10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_236246)[(int64_t) 0] =\n                        old_counter_236281 == groups_per_segment_236214 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_236282;\n            \n            is_last_group_236282 = ((__local\n                                     bool *) sync_arr_mem_236246)[(int64_t) 0];\n            if (is_last_group_236282) {\n                if (local_tid_236232 == 0) {\n                    old_counter_236281 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_236229)[sext_i32_i64(srem32(flat_segment_id_236251,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_236214));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_236283 =\n                            sdiv_up64(groups_per_segment_236214,\n                                      segred_group_sizze_225512);\n                    \n                    x_225524 = 0.0;\n                    x_225525 = 0.0;\n                    x_225526 = 0.0;\n                    x_225527 = 0.0;\n                    x_225528 = 0.0;\n                    for (int64_t i_236284 = 0; i_236284 <\n                         read_per_thread_236283; i_236284++) {\n                        int64_t group_res_id_236285 =\n                                sext_i32_i64(local_tid_236232) *\n                                read_per_thread_236283 + i_236284;\n                        int64_t index_of_group_res_236286 =\n                                sext_",
            "i32_i64(flat_segment_id_236251) *\n                                groups_per_segment_236214 + group_res_id_236285;\n                        \n                        if (slt64(group_res_id_236285,\n                                  groups_per_segment_236214)) {\n                            x_225529 = ((__global\n                                         double *) segred_tmp_mem_236219)[index_of_group_res_236286];\n                            x_225530 = ((__global\n                                         double *) segred_tmp_mem_236221)[index_of_group_res_236286];\n                            x_225531 = ((__global\n                                         double *) segred_tmp_mem_236223)[index_of_group_res_236286];\n                            x_225532 = ((__global\n                                         double *) segred_tmp_mem_236225)[index_of_group_res_236286];\n                            x_225533 = ((__global\n                                         double *) segred_tmp_mem_236227)[index_of_group_res_236286];\n                            \n                            double defunc_1_op_res_225534 = x_225524 + x_225529;\n                            double defunc_1_op_res_225535 = x_225525 + x_225530;\n                            double defunc_1_op_res_225536 = x_225526 + x_225531;\n                            double defunc_1_op_res_225537 = x_225527 + x_225532;\n                            double defunc_1_op_res_225538 = x_225528 + x_225533;\n                            \n                            x_225524 = defunc_1_op_res_225534;\n                            x_225525 = defunc_1_op_res_225535;\n                            x_225526 = defunc_1_op_res_225536;\n                            x_225527 = defunc_1_op_res_225537;\n                            x_225528 = defunc_1_op_res_225538;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_236236)[sext_i32_i64(local_tid_236232)] =\n                    x_225524;",
            "\n                ((__local\n                  double *) red_arr_mem_236238)[sext_i32_i64(local_tid_236232)] =\n                    x_225525;\n                ((__local\n                  double *) red_arr_mem_236240)[sext_i32_i64(local_tid_236232)] =\n                    x_225526;\n                ((__local\n                  double *) red_arr_mem_236242)[sext_i32_i64(local_tid_236232)] =\n                    x_225527;\n                ((__local\n                  double *) red_arr_mem_236244)[sext_i32_i64(local_tid_236232)] =\n                    x_225528;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_236287;\n                    int32_t skip_waves_236288 = 1;\n                    double x_236263;\n                    double x_236264;\n                    double x_236265;\n                    double x_236266;\n                    double x_236267;\n                    double x_236268;\n                    double x_236269;\n                    double x_236270;\n                    double x_236271;\n                    double x_236272;\n                    \n                    offset_236287 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_236232,\n                                  sext_i64_i32(segred_group_sizze_225512))) {\n                            x_236263 = ((__local\n                                         double *) red_arr_mem_236236)[sext_i32_i64(local_tid_236232 +\n                                                                       offset_236287)];\n                            x_236264 = ((__local\n                                         double *) red_arr_mem_236238)[sext_i32_i64(local_tid_236232 +\n                                                                       offset_236287)];\n                            x_236265 = ((__local\n                                         double *) red_arr_m",
            "em_236240)[sext_i32_i64(local_tid_236232 +\n                                                                       offset_236287)];\n                            x_236266 = ((__local\n                                         double *) red_arr_mem_236242)[sext_i32_i64(local_tid_236232 +\n                                                                       offset_236287)];\n                            x_236267 = ((__local\n                                         double *) red_arr_mem_236244)[sext_i32_i64(local_tid_236232 +\n                                                                       offset_236287)];\n                        }\n                    }\n                    offset_236287 = 1;\n                    while (slt32(offset_236287, wave_sizze_236234)) {\n                        if (slt32(local_tid_236232 + offset_236287,\n                                  sext_i64_i32(segred_group_sizze_225512)) &&\n                            ((local_tid_236232 - squot32(local_tid_236232,\n                                                         wave_sizze_236234) *\n                              wave_sizze_236234) & (2 * offset_236287 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_236268 = ((volatile __local\n                                             double *) red_arr_mem_236236)[sext_i32_i64(local_tid_236232 +\n                                                                           offset_236287)];\n                                x_236269 = ((volatile __local\n                                             double *) red_arr_mem_236238)[sext_i32_i64(local_tid_236232 +\n                                                                           offset_236287)];\n                                x_236270 = ((volatile __local\n                                             double *) red_arr_mem_236240)[sext_i32_i64(local_tid_236232 +\n                                                  ",
            "                         offset_236287)];\n                                x_236271 = ((volatile __local\n                                             double *) red_arr_mem_236242)[sext_i32_i64(local_tid_236232 +\n                                                                           offset_236287)];\n                                x_236272 = ((volatile __local\n                                             double *) red_arr_mem_236244)[sext_i32_i64(local_tid_236232 +\n                                                                           offset_236287)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_236273 = x_236263 +\n                                       x_236268;\n                                double defunc_1_op_res_236274 = x_236264 +\n                                       x_236269;\n                                double defunc_1_op_res_236275 = x_236265 +\n                                       x_236270;\n                                double defunc_1_op_res_236276 = x_236266 +\n                                       x_236271;\n                                double defunc_1_op_res_236277 = x_236267 +\n                                       x_236272;\n                                \n                                x_236263 = defunc_1_op_res_236273;\n                                x_236264 = defunc_1_op_res_236274;\n                                x_236265 = defunc_1_op_res_236275;\n                                x_236266 = defunc_1_op_res_236276;\n                                x_236267 = defunc_1_op_res_236277;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_236236)[sext_i32_i64(local_tid_236232)] =\n                                    x_236263;\n                   ",
            "             ((volatile __local\n                                  double *) red_arr_mem_236238)[sext_i32_i64(local_tid_236232)] =\n                                    x_236264;\n                                ((volatile __local\n                                  double *) red_arr_mem_236240)[sext_i32_i64(local_tid_236232)] =\n                                    x_236265;\n                                ((volatile __local\n                                  double *) red_arr_mem_236242)[sext_i32_i64(local_tid_236232)] =\n                                    x_236266;\n                                ((volatile __local\n                                  double *) red_arr_mem_236244)[sext_i32_i64(local_tid_236232)] =\n                                    x_236267;\n                            }\n                        }\n                        offset_236287 *= 2;\n                    }\n                    while (slt32(skip_waves_236288,\n                                 squot32(sext_i64_i32(segred_group_sizze_225512) +\n                                         wave_sizze_236234 - 1,\n                                         wave_sizze_236234))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_236287 = skip_waves_236288 * wave_sizze_236234;\n                        if (slt32(local_tid_236232 + offset_236287,\n                                  sext_i64_i32(segred_group_sizze_225512)) &&\n                            ((local_tid_236232 - squot32(local_tid_236232,\n                                                         wave_sizze_236234) *\n                              wave_sizze_236234) == 0 &&\n                             (squot32(local_tid_236232, wave_sizze_236234) &\n                              (2 * skip_waves_236288 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_236268 = ((__local\n                                             double *) red_arr_mem_236236)[sext_i32_i64",
            "(local_tid_236232 +\n                                                                           offset_236287)];\n                                x_236269 = ((__local\n                                             double *) red_arr_mem_236238)[sext_i32_i64(local_tid_236232 +\n                                                                           offset_236287)];\n                                x_236270 = ((__local\n                                             double *) red_arr_mem_236240)[sext_i32_i64(local_tid_236232 +\n                                                                           offset_236287)];\n                                x_236271 = ((__local\n                                             double *) red_arr_mem_236242)[sext_i32_i64(local_tid_236232 +\n                                                                           offset_236287)];\n                                x_236272 = ((__local\n                                             double *) red_arr_mem_236244)[sext_i32_i64(local_tid_236232 +\n                                                                           offset_236287)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_236273 = x_236263 +\n                                       x_236268;\n                                double defunc_1_op_res_236274 = x_236264 +\n                                       x_236269;\n                                double defunc_1_op_res_236275 = x_236265 +\n                                       x_236270;\n                                double defunc_1_op_res_236276 = x_236266 +\n                                       x_236271;\n                                double defunc_1_op_res_236277 = x_236267 +\n                                       x_236272;\n                                \n                                x_236263 = defunc_1_op_res_236273;\n                                x_236264 = ",
            "defunc_1_op_res_236274;\n                                x_236265 = defunc_1_op_res_236275;\n                                x_236266 = defunc_1_op_res_236276;\n                                x_236267 = defunc_1_op_res_236277;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_236236)[sext_i32_i64(local_tid_236232)] =\n                                    x_236263;\n                                ((__local\n                                  double *) red_arr_mem_236238)[sext_i32_i64(local_tid_236232)] =\n                                    x_236264;\n                                ((__local\n                                  double *) red_arr_mem_236240)[sext_i32_i64(local_tid_236232)] =\n                                    x_236265;\n                                ((__local\n                                  double *) red_arr_mem_236242)[sext_i32_i64(local_tid_236232)] =\n                                    x_236266;\n                                ((__local\n                                  double *) red_arr_mem_236244)[sext_i32_i64(local_tid_236232)] =\n                                    x_236267;\n                            }\n                        }\n                        skip_waves_236288 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_236232 == 0) {\n                            ((__global double *) mem_231338)[gtid_225520 *\n                                                             t_n_m_203650 +\n                                                             gtid_225521] =\n                                x_236263;\n                            ((__global double *) mem_231342)[gtid_225520 *\n                                                             t_n_m_203650 +\n                                           ",
            "                  gtid_225521] =\n                                x_236264;\n                            ((__global double *) mem_231346)[gtid_225520 *\n                                                             t_n_m_203650 +\n                                                             gtid_225521] =\n                                x_236265;\n                            ((__global double *) mem_231350)[gtid_225520 *\n                                                             t_n_m_203650 +\n                                                             gtid_225521] =\n                                x_236266;\n                            ((__global double *) mem_231354)[gtid_225520 *\n                                                             t_n_m_203650 +\n                                                             gtid_225521] =\n                                x_236267;\n                        }\n                    }\n                }\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_225512\n}\n__kernel void mainzisegred_large_225624(__global int *global_failure,\n                                        uint sync_arr_mem_236354_backing_offset_0,\n                                        uint red_arr_mem_236352_backing_offset_1,\n                                        uint red_arr_mem_236350_backing_offset_2,\n                                        int64_t n_203490, int64_t q_t_203494,\n                                        int64_t jump_t_203500,\n                                        int64_t partition_sizze_203577,\n                                        int64_t t_n_m_203650, int64_t i_203670,\n                                        int64_t num_groups_225617,\n                                        int64_t groups_per_segment_236334,\n                                        int64_t elements_per_thread_236335,\n                                        int64_t virt_num_groups_23",
            "6336,\n                                        int64_t threads_per_segment_236338,\n                                        __global unsigned char *ext_mem_229196,\n                                        __global unsigned char *ext_mem_229197,\n                                        __global unsigned char *ext_mem_229460,\n                                        __global unsigned char *ext_mem_229461,\n                                        __global unsigned char *mem_231320,\n                                        __global unsigned char *mem_231324,\n                                        __global unsigned char *mem_231359,\n                                        __global unsigned char *mem_231363,\n                                        __global unsigned char *mem_231367,\n                                        __global unsigned char *mem_231371,\n                                        __global unsigned char *mem_231375,\n                                        __global unsigned char *mem_231380,\n                                        __global unsigned char *mem_231384,\n                                        __global\n                                        unsigned char *segred_tmp_mem_236339,\n                                        __global\n                                        unsigned char *segred_tmp_mem_236341,\n                                        __global\n                                        unsigned char *mainzicounter_mem_236343)\n{\n    #define segred_group_sizze_225616 (mainzisegred_group_sizze_224832)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *sync_arr_mem_236354_backing_2 =\n                           &shared_mem[sync_arr_mem_236354_backing_offset_0];\n    volatile unsigned char *red_arr_mem_236352_backing_1 =\n                           &shared_mem[red_arr_mem_236352_backing_offset_1];\n    volatile unsigned char *red_arr_mem_236350_backing_0 =\n                           &",
            "shared_mem[red_arr_mem_236350_backing_offset_2];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236345;\n    int32_t local_tid_236346;\n    int64_t group_sizze_236349;\n    int32_t wave_sizze_236348;\n    int32_t group_tid_236347;\n    \n    global_tid_236345 = get_global_id(0);\n    local_tid_236346 = get_local_id(0);\n    group_sizze_236349 = get_local_size(0);\n    wave_sizze_236348 = LOCKSTEP_WIDTH;\n    group_tid_236347 = get_group_id(0);\n    \n    int32_t phys_tid_225624 = global_tid_236345;\n    __local unsigned char *red_arr_mem_236350;\n    \n    red_arr_mem_236350 = (__local unsigned char *) red_arr_mem_236350_backing_0;\n    \n    __local unsigned char *red_arr_mem_236352;\n    \n    red_arr_mem_236352 = (__local unsigned char *) red_arr_mem_236352_backing_1;\n    \n    __local unsigned char *sync_arr_mem_236354;\n    \n    sync_arr_mem_236354 = (__local\n                           unsigned char *) sync_arr_mem_236354_backing_2;\n    \n    int32_t phys_group_id_236356;\n    \n    phys_group_id_236356 = get_group_id(0);\n    for (int32_t i_236357 = 0; i_236357 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_236336) - phys_group_id_236356,\n                   sext_i64_i32(num_groups_225617)); i_236357++) {\n        int32_t virt_group_id_236358 = phys_group_id_236356 + i_236357 *\n                sext_i64_i32(num_groups_225617);\n        int32_t flat_segment_id_236359 = squot32(virt_group_id_236358,\n                                                 sext_i64_i32(groups_per_segment_236334));\n        int64_t global_tid_236360 = srem64(sext_i32_i64(virt_group_id_236358) *\n                                           segred_group_sizze_225616 +\n                                           sext_i32_i64(local_tid_236346),\n                                           segred_group_sizze_225616 *\n                                           groups_per_segment_236334);\n        int64_t slice_236361 = t_n_m_203650;\n        int64_t slice_236362 = partition_sizze_203577 * slice_2",
            "36361;\n        int64_t gtid_225621 = squot64(sext_i32_i64(flat_segment_id_236359),\n                                      slice_236361);\n        int64_t remnant_236363 = sext_i32_i64(flat_segment_id_236359) -\n                gtid_225621 * slice_236361;\n        int64_t gtid_225622 = remnant_236363;\n        int64_t remnant_236364 = remnant_236363 - gtid_225622;\n        int64_t gtid_225623;\n        double x_acc_236365;\n        double x_acc_236366;\n        int64_t chunk_sizze_236367 = smin64(elements_per_thread_236335,\n                                            sdiv_up64(q_t_203494 -\n                                                      global_tid_236360,\n                                                      threads_per_segment_236338));\n        double x_225625;\n        double x_225626;\n        double x_225627;\n        double x_225628;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_236365 = 0.0;\n            x_acc_236366 = 0.0;\n        }\n        for (int64_t i_236374 = 0; i_236374 < chunk_sizze_236367; i_236374++) {\n            gtid_225623 = global_tid_236360 + threads_per_segment_236338 *\n                i_236374;\n            // apply map function\n            {\n                int64_t x_225632;\n                \n                x_225632 = ((__global int64_t *) ext_mem_229196)[gtid_225621];\n                \n                int64_t x_225643;\n                \n                x_225643 = ((__global int64_t *) ext_mem_229461)[gtid_225621 *\n                                                                 t_n_m_203650 +\n                                                                 gtid_225622];\n                \n                double x_225644;\n                \n                x_225644 = ((__global double *) ext_mem_229460)[gtid_225621 *\n                                                                t_n_m_203650 +\n                                                                gtid_225622];\n                \n                int64_t binop_y_",
            "228679 = mul64(jump_t_203500, gtid_225622);\n                int64_t binop_y_228680 = smin64(i_203670, binop_y_228679);\n                int64_t index_primexp_228681 = add64((int64_t) 1,\n                                                     binop_y_228680);\n                double a12_225646;\n                \n                a12_225646 = ((__global double *) mem_231359)[gtid_225621 *\n                                                              t_n_m_203650 +\n                                                              gtid_225622];\n                \n                double b12_225647;\n                \n                b12_225647 = ((__global double *) mem_231363)[gtid_225621 *\n                                                              t_n_m_203650 +\n                                                              gtid_225622];\n                \n                double c12_225648;\n                \n                c12_225648 = ((__global double *) mem_231367)[gtid_225621 *\n                                                              t_n_m_203650 +\n                                                              gtid_225622];\n                \n                double b2_225649;\n                \n                b2_225649 = ((__global double *) mem_231371)[gtid_225621 *\n                                                             t_n_m_203650 +\n                                                             gtid_225622];\n                \n                double c2_225650;\n                \n                c2_225650 = ((__global double *) mem_231375)[gtid_225621 *\n                                                             t_n_m_203650 +\n                                                             gtid_225622];\n                \n                bool cond_225652 = sle64(x_225632, gtid_225623);\n                int64_t defunc_0_f_res_225653;\n                \n                if (cond_225652) {\n                    defunc_0_f_res_225653 = (int64_t) 0;\n                } else {\n                 ",
            "   int64_t i_225654 = add64(gtid_225623, x_225643);\n                    int64_t defunc_0_add_arg_225655;\n                    \n                    defunc_0_add_arg_225655 = ((__global\n                                                int64_t *) ext_mem_229197)[gtid_225621 *\n                                                                           n_203490 +\n                                                                           i_225654];\n                    \n                    int64_t defunc_1_add_res_225656 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_225655);\n                    \n                    defunc_0_f_res_225653 = defunc_1_add_res_225656;\n                }\n                \n                double defunc_0_f_res_225657;\n                \n                if (cond_225652) {\n                    defunc_0_f_res_225657 = 0.0;\n                } else {\n                    int64_t i_225658 = add64(gtid_225623, x_225643);\n                    double defunc_0_add_arg_225659;\n                    \n                    defunc_0_add_arg_225659 = ((__global\n                                                double *) mem_231320)[gtid_225621 *\n                                                                      n_203490 +\n                                                                      i_225658];\n                    defunc_0_f_res_225657 = defunc_0_add_arg_225659;\n                }\n                \n                int64_t binop_p_225660 = sub64(defunc_0_f_res_225653,\n                                               index_primexp_228681);\n                double defunc_0_f_res_225661 = sitofp_i64_f64(binop_p_225660);\n                double abs_res_225662 = fabs(defunc_0_f_res_225661);\n                double tmp1_225663 = abs_res_225662 / x_225644;\n                double x_225664 = tmp1_225663 * tmp1_225663;\n                double y_225665 = tmp1_225663 * x_225664;\n                double tmp2_225666 = 1.0 - y_225665;\n      ",
            "          double x_225667 = tmp2_225666 * tmp2_225666;\n                double tmp3_225668 = tmp2_225666 * x_225667;\n                double tmp4_225669 = defunc_0_f_res_225657 * tmp3_225668;\n                double defunc_1_f_res_225670 = defunc_0_f_res_225661 *\n                       tmp4_225669;\n                double defunc_1_f_res_225671 = defunc_0_f_res_225661 *\n                       defunc_1_f_res_225670;\n                double defunc_0_f_res_225672;\n                \n                if (cond_225652) {\n                    defunc_0_f_res_225672 = 0.0;\n                } else {\n                    int64_t i_225673 = add64(gtid_225623, x_225643);\n                    double defunc_0_add_arg_225674;\n                    \n                    defunc_0_add_arg_225674 = ((__global\n                                                double *) mem_231324)[gtid_225621 *\n                                                                      n_203490 +\n                                                                      i_225673];\n                    defunc_0_f_res_225672 = defunc_0_add_arg_225674;\n                }\n                \n                double x_225675 = a12_225646 * tmp4_225669;\n                double y_225676 = b12_225647 * defunc_1_f_res_225670;\n                double x_225677 = x_225675 + y_225676;\n                double y_225678 = c12_225648 * defunc_1_f_res_225671;\n                double x_225679 = x_225677 + y_225678;\n                double defunc_9_fit_fun_res_225680 = defunc_0_f_res_225672 *\n                       x_225679;\n                double x_225681 = b12_225647 * tmp4_225669;\n                double y_225682 = b2_225649 * defunc_1_f_res_225670;\n                double x_225683 = x_225681 + y_225682;\n                double y_225684 = c2_225650 * defunc_1_f_res_225671;\n                double x_225685 = x_225683 + y_225684;\n                double defunc_9_slope_fun_res_225686 = defunc_0_f_res_225672 *\n                       x_225685;\n                \n        ",
            "        // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_225625 = x_acc_236365;\n                    x_225626 = x_acc_236366;\n                }\n                // load new values\n                {\n                    x_225627 = defunc_9_fit_fun_res_225680;\n                    x_225628 = defunc_9_slope_fun_res_225686;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_225629 = x_225625 + x_225627;\n                    double defunc_1_op_res_225630 = x_225626 + x_225628;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_236365 = defunc_1_op_res_225629;\n                        x_acc_236366 = defunc_1_op_res_225630;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_225625 = x_acc_236365;\n            x_225626 = x_acc_236366;\n            ((__local\n              double *) red_arr_mem_236350)[sext_i32_i64(local_tid_236346)] =\n                x_225625;\n            ((__local\n              double *) red_arr_mem_236352)[sext_i32_i64(local_tid_236346)] =\n                x_225626;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_236375;\n        int32_t skip_waves_236376 = 1;\n        double x_236368;\n        double x_236369;\n        double x_236370;\n        double x_236371;\n        \n        offset_236375 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_236346,\n                      sext_i64_i32(segred_group_sizze_225616))) {\n                x_236368 = ((__local\n                             double *) red_arr_mem_236350)[sext_i32_i64(local_tid_236346 +\n                                                           offset_236375)];\n                x_236369 = ((__local\n                         ",
            "    double *) red_arr_mem_236352)[sext_i32_i64(local_tid_236346 +\n                                                           offset_236375)];\n            }\n        }\n        offset_236375 = 1;\n        while (slt32(offset_236375, wave_sizze_236348)) {\n            if (slt32(local_tid_236346 + offset_236375,\n                      sext_i64_i32(segred_group_sizze_225616)) &&\n                ((local_tid_236346 - squot32(local_tid_236346,\n                                             wave_sizze_236348) *\n                  wave_sizze_236348) & (2 * offset_236375 - 1)) == 0) {\n                // read array element\n                {\n                    x_236370 = ((volatile __local\n                                 double *) red_arr_mem_236350)[sext_i32_i64(local_tid_236346 +\n                                                               offset_236375)];\n                    x_236371 = ((volatile __local\n                                 double *) red_arr_mem_236352)[sext_i32_i64(local_tid_236346 +\n                                                               offset_236375)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_236372 = x_236368 + x_236370;\n                    double defunc_1_op_res_236373 = x_236369 + x_236371;\n                    \n                    x_236368 = defunc_1_op_res_236372;\n                    x_236369 = defunc_1_op_res_236373;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_236350)[sext_i32_i64(local_tid_236346)] =\n                        x_236368;\n                    ((volatile __local\n                      double *) red_arr_mem_236352)[sext_i32_i64(local_tid_236346)] =\n                        x_236369;\n                }\n            }\n            offset_236375 *= 2;\n        }\n        while (slt32(skip_waves_236376,\n                     squot32(sext_i64_i32(segred_",
            "group_sizze_225616) +\n                             wave_sizze_236348 - 1, wave_sizze_236348))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_236375 = skip_waves_236376 * wave_sizze_236348;\n            if (slt32(local_tid_236346 + offset_236375,\n                      sext_i64_i32(segred_group_sizze_225616)) &&\n                ((local_tid_236346 - squot32(local_tid_236346,\n                                             wave_sizze_236348) *\n                  wave_sizze_236348) == 0 && (squot32(local_tid_236346,\n                                                      wave_sizze_236348) & (2 *\n                                                                            skip_waves_236376 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_236370 = ((__local\n                                 double *) red_arr_mem_236350)[sext_i32_i64(local_tid_236346 +\n                                                               offset_236375)];\n                    x_236371 = ((__local\n                                 double *) red_arr_mem_236352)[sext_i32_i64(local_tid_236346 +\n                                                               offset_236375)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_236372 = x_236368 + x_236370;\n                    double defunc_1_op_res_236373 = x_236369 + x_236371;\n                    \n                    x_236368 = defunc_1_op_res_236372;\n                    x_236369 = defunc_1_op_res_236373;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_236350)[sext_i32_i64(local_tid_236346)] =\n                        x_236368;\n                    ((__local\n                      double *) red_arr_mem_236352)[sext_i32_i64(local_tid_236346)",
            "] =\n                        x_236369;\n                }\n            }\n            skip_waves_236376 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_236346) == (int64_t) 0) {\n                x_acc_236365 = x_236368;\n                x_acc_236366 = x_236369;\n            }\n        }\n        if (groups_per_segment_236334 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_236346 == 0) {\n                    ((__global double *) mem_231380)[gtid_225621 *\n                                                     t_n_m_203650 +\n                                                     gtid_225622] =\n                        x_acc_236365;\n                    ((__global double *) mem_231384)[gtid_225621 *\n                                                     t_n_m_203650 +\n                                                     gtid_225622] =\n                        x_acc_236366;\n                }\n            }\n        } else {\n            int32_t old_counter_236377;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_236346 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_236339)[sext_i32_i64(virt_group_id_236358)] =\n                        x_acc_236365;\n                    ((__global\n                      double *) segred_tmp_mem_236341)[sext_i32_i64(virt_group_id_236358)] =\n                        x_acc_236366;\n                    mem_fence_global();\n                    old_counter_236377 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_236343)[sext_i32_i64(srem32(flat_segment_id_236359,\n                                                                                                      10240))],\n  ",
            "                                            (int) 1);\n                    ((__local bool *) sync_arr_mem_236354)[(int64_t) 0] =\n                        old_counter_236377 == groups_per_segment_236334 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_236378;\n            \n            is_last_group_236378 = ((__local\n                                     bool *) sync_arr_mem_236354)[(int64_t) 0];\n            if (is_last_group_236378) {\n                if (local_tid_236346 == 0) {\n                    old_counter_236377 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_236343)[sext_i32_i64(srem32(flat_segment_id_236359,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_236334));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_236379 =\n                            sdiv_up64(groups_per_segment_236334,\n                                      segred_group_sizze_225616);\n                    \n                    x_225625 = 0.0;\n                    x_225626 = 0.0;\n                    for (int64_t i_236380 = 0; i_236380 <\n                         read_per_thread_236379; i_236380++) {\n                        int64_t group_res_id_236381 =\n                                sext_i32_i64(local_tid_236346) *\n                                read_per_thread_236379 + i_236380;\n                        int64_t index_of_group_res_236382 =\n                                sext_i32_i64(flat_segment_id_236359) *\n                                groups_per_segment_236334 + group_res_id_236381;\n             ",
            "           \n                        if (slt64(group_res_id_236381,\n                                  groups_per_segment_236334)) {\n                            x_225627 = ((__global\n                                         double *) segred_tmp_mem_236339)[index_of_group_res_236382];\n                            x_225628 = ((__global\n                                         double *) segred_tmp_mem_236341)[index_of_group_res_236382];\n                            \n                            double defunc_1_op_res_225629 = x_225625 + x_225627;\n                            double defunc_1_op_res_225630 = x_225626 + x_225628;\n                            \n                            x_225625 = defunc_1_op_res_225629;\n                            x_225626 = defunc_1_op_res_225630;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_236350)[sext_i32_i64(local_tid_236346)] =\n                    x_225625;\n                ((__local\n                  double *) red_arr_mem_236352)[sext_i32_i64(local_tid_236346)] =\n                    x_225626;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_236383;\n                    int32_t skip_waves_236384 = 1;\n                    double x_236368;\n                    double x_236369;\n                    double x_236370;\n                    double x_236371;\n                    \n                    offset_236383 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_236346,\n                                  sext_i64_i32(segred_group_sizze_225616))) {\n                            x_236368 = ((__local\n                                         double *) red_arr_mem_236350)[sext_i32_i64(local_tid_236346 +\n                                                                       offset_236383)];\n ",
            "                           x_236369 = ((__local\n                                         double *) red_arr_mem_236352)[sext_i32_i64(local_tid_236346 +\n                                                                       offset_236383)];\n                        }\n                    }\n                    offset_236383 = 1;\n                    while (slt32(offset_236383, wave_sizze_236348)) {\n                        if (slt32(local_tid_236346 + offset_236383,\n                                  sext_i64_i32(segred_group_sizze_225616)) &&\n                            ((local_tid_236346 - squot32(local_tid_236346,\n                                                         wave_sizze_236348) *\n                              wave_sizze_236348) & (2 * offset_236383 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_236370 = ((volatile __local\n                                             double *) red_arr_mem_236350)[sext_i32_i64(local_tid_236346 +\n                                                                           offset_236383)];\n                                x_236371 = ((volatile __local\n                                             double *) red_arr_mem_236352)[sext_i32_i64(local_tid_236346 +\n                                                                           offset_236383)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_236372 = x_236368 +\n                                       x_236370;\n                                double defunc_1_op_res_236373 = x_236369 +\n                                       x_236371;\n                                \n                                x_236368 = defunc_1_op_res_236372;\n                                x_236369 = defunc_1_op_res_236373;\n                            }\n                            /",
            "/ write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_236350)[sext_i32_i64(local_tid_236346)] =\n                                    x_236368;\n                                ((volatile __local\n                                  double *) red_arr_mem_236352)[sext_i32_i64(local_tid_236346)] =\n                                    x_236369;\n                            }\n                        }\n                        offset_236383 *= 2;\n                    }\n                    while (slt32(skip_waves_236384,\n                                 squot32(sext_i64_i32(segred_group_sizze_225616) +\n                                         wave_sizze_236348 - 1,\n                                         wave_sizze_236348))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_236383 = skip_waves_236384 * wave_sizze_236348;\n                        if (slt32(local_tid_236346 + offset_236383,\n                                  sext_i64_i32(segred_group_sizze_225616)) &&\n                            ((local_tid_236346 - squot32(local_tid_236346,\n                                                         wave_sizze_236348) *\n                              wave_sizze_236348) == 0 &&\n                             (squot32(local_tid_236346, wave_sizze_236348) &\n                              (2 * skip_waves_236384 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_236370 = ((__local\n                                             double *) red_arr_mem_236350)[sext_i32_i64(local_tid_236346 +\n                                                                           offset_236383)];\n                                x_236371 = ((__local\n                                             double *) red_arr_mem_236352)[sext_i32_i64(local_tid_236346 +\n                                         ",
            "                                  offset_236383)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_236372 = x_236368 +\n                                       x_236370;\n                                double defunc_1_op_res_236373 = x_236369 +\n                                       x_236371;\n                                \n                                x_236368 = defunc_1_op_res_236372;\n                                x_236369 = defunc_1_op_res_236373;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_236350)[sext_i32_i64(local_tid_236346)] =\n                                    x_236368;\n                                ((__local\n                                  double *) red_arr_mem_236352)[sext_i32_i64(local_tid_236346)] =\n                                    x_236369;\n                            }\n                        }\n                        skip_waves_236384 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_236346 == 0) {\n                            ((__global double *) mem_231380)[gtid_225621 *\n                                                             t_n_m_203650 +\n                                                             gtid_225622] =\n                                x_236368;\n                            ((__global double *) mem_231384)[gtid_225621 *\n                                                             t_n_m_203650 +\n                                                             gtid_225622] =\n                                x_236369;\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_225616\n}\n__kernel void mainzisegred_large_228090(__global int *global_failure,\n                                        uint sync_arr_mem_237009_backing_offset_0,\n                                        uint red_arr_mem_237007_backing_offset_1,\n                                        int64_t n_203490,\n                                        int64_t partition_sizze_203577,\n                                        int64_t stl_res_203664,\n                                        int64_t j_m_i_204133,\n                                        int64_t num_groups_228085,\n                                        int64_t groups_per_segment_236993,\n                                        int64_t elements_per_thread_236994,\n                                        int64_t virt_num_groups_236995,\n                                        int64_t threads_per_segment_236997,\n                                        __global unsigned char *ext_mem_231816,\n                                        __global unsigned char *mem_231833,\n                                        __global\n                                        unsigned char *segred_tmp_mem_236998,\n                                        __global\n                                        unsigned char *mainzicounter_mem_237000)\n{\n    #define segred_group_sizze_228084 (mainzisegred_group_sizze_228067)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *sync_arr_mem_237009_backing_1 =\n                           &shared_mem[sync_arr_mem_237009_backing_offset_0];\n    volatile unsigned char *red_arr_mem_237007_backing_0 =\n                           &shared_mem[red_arr_mem_237007_backing_offset_1];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_237002;\n    int32_t local_tid_237003;\n    int64_t group_sizze_237006;\n    int32_t wave_sizze_237005;\n    int3",
            "2_t group_tid_237004;\n    \n    global_tid_237002 = get_global_id(0);\n    local_tid_237003 = get_local_id(0);\n    group_sizze_237006 = get_local_size(0);\n    wave_sizze_237005 = LOCKSTEP_WIDTH;\n    group_tid_237004 = get_group_id(0);\n    \n    int32_t phys_tid_228090 = global_tid_237002;\n    __local unsigned char *red_arr_mem_237007;\n    \n    red_arr_mem_237007 = (__local unsigned char *) red_arr_mem_237007_backing_0;\n    \n    __local unsigned char *sync_arr_mem_237009;\n    \n    sync_arr_mem_237009 = (__local\n                           unsigned char *) sync_arr_mem_237009_backing_1;\n    \n    int32_t phys_group_id_237011;\n    \n    phys_group_id_237011 = get_group_id(0);\n    for (int32_t i_237012 = 0; i_237012 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_236995) - phys_group_id_237011,\n                   sext_i64_i32(num_groups_228085)); i_237012++) {\n        int32_t virt_group_id_237013 = phys_group_id_237011 + i_237012 *\n                sext_i64_i32(num_groups_228085);\n        int32_t flat_segment_id_237014 = squot32(virt_group_id_237013,\n                                                 sext_i64_i32(groups_per_segment_236993));\n        int64_t global_tid_237015 = srem64(sext_i32_i64(virt_group_id_237013) *\n                                           segred_group_sizze_228084 +\n                                           sext_i32_i64(local_tid_237003),\n                                           segred_group_sizze_228084 *\n                                           groups_per_segment_236993);\n        int64_t slice_237016 = partition_sizze_203577;\n        int64_t gtid_228088 = sext_i32_i64(flat_segment_id_237014);\n        int64_t remnant_237017 = sext_i32_i64(flat_segment_id_237014) -\n                gtid_228088;\n        int64_t gtid_228089;\n        double x_acc_237018;\n        int64_t chunk_sizze_237019 = smin64(elements_per_thread_236994,\n                                            sdiv_up64(j_m_i_204133 -\n                                                      global",
            "_tid_237015,\n                                                      threads_per_segment_236997));\n        double x_228091;\n        double x_228092;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_237018 = 0.0;\n        }\n        for (int64_t i_237023 = 0; i_237023 < chunk_sizze_237019; i_237023++) {\n            gtid_228089 = global_tid_237015 + threads_per_segment_236997 *\n                i_237023;\n            // apply map function\n            {\n                int64_t slice_228219 = stl_res_203664 + gtid_228089;\n                double x_228095;\n                \n                x_228095 = ((__global double *) ext_mem_231816)[gtid_228088 *\n                                                                n_203490 +\n                                                                slice_228219];\n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_228091 = x_acc_237018;\n                }\n                // load new values\n                {\n                    x_228092 = x_228095;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_228093 = x_228091 + x_228092;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_237018 = defunc_1_op_res_228093;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_228091 = x_acc_237018;\n            ((__local\n              double *) red_arr_mem_237007)[sext_i32_i64(local_tid_237003)] =\n                x_228091;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_237024;\n        int32_t skip_waves_237025 = 1;\n        double x_237020;\n        double x_237021;\n        \n        offset_237024 = 0;\n        // participating threads read initial accumulator\n        {\n    ",
            "        if (slt32(local_tid_237003,\n                      sext_i64_i32(segred_group_sizze_228084))) {\n                x_237020 = ((__local\n                             double *) red_arr_mem_237007)[sext_i32_i64(local_tid_237003 +\n                                                           offset_237024)];\n            }\n        }\n        offset_237024 = 1;\n        while (slt32(offset_237024, wave_sizze_237005)) {\n            if (slt32(local_tid_237003 + offset_237024,\n                      sext_i64_i32(segred_group_sizze_228084)) &&\n                ((local_tid_237003 - squot32(local_tid_237003,\n                                             wave_sizze_237005) *\n                  wave_sizze_237005) & (2 * offset_237024 - 1)) == 0) {\n                // read array element\n                {\n                    x_237021 = ((volatile __local\n                                 double *) red_arr_mem_237007)[sext_i32_i64(local_tid_237003 +\n                                                               offset_237024)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_237022 = x_237020 + x_237021;\n                    \n                    x_237020 = defunc_1_op_res_237022;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_237007)[sext_i32_i64(local_tid_237003)] =\n                        x_237020;\n                }\n            }\n            offset_237024 *= 2;\n        }\n        while (slt32(skip_waves_237025,\n                     squot32(sext_i64_i32(segred_group_sizze_228084) +\n                             wave_sizze_237005 - 1, wave_sizze_237005))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_237024 = skip_waves_237025 * wave_sizze_237005;\n            if (slt32(local_tid_237003 + offset_237024,\n                      sext_i64_i32(segred_group_sizze_228084)) &&\n                ((lo",
            "cal_tid_237003 - squot32(local_tid_237003,\n                                             wave_sizze_237005) *\n                  wave_sizze_237005) == 0 && (squot32(local_tid_237003,\n                                                      wave_sizze_237005) & (2 *\n                                                                            skip_waves_237025 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_237021 = ((__local\n                                 double *) red_arr_mem_237007)[sext_i32_i64(local_tid_237003 +\n                                                               offset_237024)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_237022 = x_237020 + x_237021;\n                    \n                    x_237020 = defunc_1_op_res_237022;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_237007)[sext_i32_i64(local_tid_237003)] =\n                        x_237020;\n                }\n            }\n            skip_waves_237025 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_237003) == (int64_t) 0) {\n                x_acc_237018 = x_237020;\n            }\n        }\n        if (groups_per_segment_236993 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_237003 == 0) {\n                    ((__global double *) mem_231833)[gtid_228088] =\n                        x_acc_237018;\n                }\n            }\n        } else {\n            int32_t old_counter_237026;\n            \n            // first thread in group saves group result to global memory\n            {\n                ",
            "if (local_tid_237003 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_236998)[sext_i32_i64(virt_group_id_237013)] =\n                        x_acc_237018;\n                    mem_fence_global();\n                    old_counter_237026 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_237000)[sext_i32_i64(srem32(flat_segment_id_237014,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_237009)[(int64_t) 0] =\n                        old_counter_237026 == groups_per_segment_236993 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_237027;\n            \n            is_last_group_237027 = ((__local\n                                     bool *) sync_arr_mem_237009)[(int64_t) 0];\n            if (is_last_group_237027) {\n                if (local_tid_237003 == 0) {\n                    old_counter_237026 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_237000)[sext_i32_i64(srem32(flat_segment_id_237014,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_236993));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_237028 =\n                            sdiv_up64(groups_per_segment_236993,\n                                      segred_group_sizze_228084);\n                    \n                    x_228",
            "091 = 0.0;\n                    for (int64_t i_237029 = 0; i_237029 <\n                         read_per_thread_237028; i_237029++) {\n                        int64_t group_res_id_237030 =\n                                sext_i32_i64(local_tid_237003) *\n                                read_per_thread_237028 + i_237029;\n                        int64_t index_of_group_res_237031 =\n                                sext_i32_i64(flat_segment_id_237014) *\n                                groups_per_segment_236993 + group_res_id_237030;\n                        \n                        if (slt64(group_res_id_237030,\n                                  groups_per_segment_236993)) {\n                            x_228092 = ((__global\n                                         double *) segred_tmp_mem_236998)[index_of_group_res_237031];\n                            \n                            double defunc_1_op_res_228093 = x_228091 + x_228092;\n                            \n                            x_228091 = defunc_1_op_res_228093;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_237007)[sext_i32_i64(local_tid_237003)] =\n                    x_228091;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_237032;\n                    int32_t skip_waves_237033 = 1;\n                    double x_237020;\n                    double x_237021;\n                    \n                    offset_237032 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_237003,\n                                  sext_i64_i32(segred_group_sizze_228084))) {\n                            x_237020 = ((__local\n                                         double *) red_arr_mem_237007)[sext_i32_i64(local_tid_237003 +\n                                                      ",
            "                 offset_237032)];\n                        }\n                    }\n                    offset_237032 = 1;\n                    while (slt32(offset_237032, wave_sizze_237005)) {\n                        if (slt32(local_tid_237003 + offset_237032,\n                                  sext_i64_i32(segred_group_sizze_228084)) &&\n                            ((local_tid_237003 - squot32(local_tid_237003,\n                                                         wave_sizze_237005) *\n                              wave_sizze_237005) & (2 * offset_237032 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_237021 = ((volatile __local\n                                             double *) red_arr_mem_237007)[sext_i32_i64(local_tid_237003 +\n                                                                           offset_237032)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_237022 = x_237020 +\n                                       x_237021;\n                                \n                                x_237020 = defunc_1_op_res_237022;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_237007)[sext_i32_i64(local_tid_237003)] =\n                                    x_237020;\n                            }\n                        }\n                        offset_237032 *= 2;\n                    }\n                    while (slt32(skip_waves_237033,\n                                 squot32(sext_i64_i32(segred_group_sizze_228084) +\n                                         wave_sizze_237005 - 1,\n                                         wave_sizze_237005))) {\n                   ",
            "     barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_237032 = skip_waves_237033 * wave_sizze_237005;\n                        if (slt32(local_tid_237003 + offset_237032,\n                                  sext_i64_i32(segred_group_sizze_228084)) &&\n                            ((local_tid_237003 - squot32(local_tid_237003,\n                                                         wave_sizze_237005) *\n                              wave_sizze_237005) == 0 &&\n                             (squot32(local_tid_237003, wave_sizze_237005) &\n                              (2 * skip_waves_237033 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_237021 = ((__local\n                                             double *) red_arr_mem_237007)[sext_i32_i64(local_tid_237003 +\n                                                                           offset_237032)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_237022 = x_237020 +\n                                       x_237021;\n                                \n                                x_237020 = defunc_1_op_res_237022;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_237007)[sext_i32_i64(local_tid_237003)] =\n                                    x_237020;\n                            }\n                        }\n                        skip_waves_237033 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_237003 == 0) {\n                            ((__global double *) mem_231833)[gtid_228088] =\n                                x_237020;\n                        }\n",
            "                    }\n                }\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_228084\n}\n__kernel void mainzisegred_small_212003(__global int *global_failure,\n                                        uint red_arr_mem_233152_backing_offset_0,\n                                        int64_t n_p_203492, int64_t q_s_203493,\n                                        int64_t partition_sizze_203577,\n                                        int64_t defunc_0_f_res_203631,\n                                        int64_t s_n_m_203636,\n                                        int64_t num_groups_211996,\n                                        int64_t segment_sizze_nonzzero_233145,\n                                        __global unsigned char *ext_mem_229264,\n                                        __global unsigned char *ext_mem_229265,\n                                        __global unsigned char *ext_mem_229362,\n                                        __global unsigned char *ext_mem_229363,\n                                        __global unsigned char *mem_229531,\n                                        __global unsigned char *mem_229687,\n                                        __global unsigned char *mem_229697)\n{\n    #define segred_group_sizze_211995 (mainzisegred_group_sizze_211176)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_233152_backing_0 =\n                           &shared_mem[red_arr_mem_233152_backing_offset_0];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233147;\n    int32_t local_tid_233148;\n    int64_t group_sizze_233151;\n    int32_t wave_sizze_233150;\n    int32_t group_tid_233149;\n    \n    global_tid_233147 = get_global_id(0);\n    local_tid_233148 = get_local_id(0);\n    group_sizze_233151 = get_local_size(0);\n    wave_sizze_233150 = L",
            "OCKSTEP_WIDTH;\n    group_tid_233149 = get_group_id(0);\n    \n    int32_t phys_tid_212003 = global_tid_233147;\n    __local unsigned char *red_arr_mem_233152;\n    \n    red_arr_mem_233152 = (__local unsigned char *) red_arr_mem_233152_backing_0;\n    \n    int32_t phys_group_id_233154;\n    \n    phys_group_id_233154 = get_group_id(0);\n    for (int32_t i_233155 = 0; i_233155 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577 * n_p_203492 *\n                                          s_n_m_203636,\n                                          squot64(segred_group_sizze_211995,\n                                                  segment_sizze_nonzzero_233145))) -\n                   phys_group_id_233154, sext_i64_i32(num_groups_211996));\n         i_233155++) {\n        int32_t virt_group_id_233156 = phys_group_id_233154 + i_233155 *\n                sext_i64_i32(num_groups_211996);\n        int64_t slice_233157 = s_n_m_203636;\n        int64_t slice_233158 = n_p_203492 * slice_233157;\n        int64_t slice_233159 = partition_sizze_203577 * slice_233158;\n        int64_t gtid_211999 = squot64(squot64(sext_i32_i64(local_tid_233148),\n                                              segment_sizze_nonzzero_233145) +\n                                      sext_i32_i64(virt_group_id_233156) *\n                                      squot64(segred_group_sizze_211995,\n                                              segment_sizze_nonzzero_233145),\n                                      slice_233158);\n        int64_t remnant_233160 = squot64(sext_i32_i64(local_tid_233148),\n                                         segment_sizze_nonzzero_233145) +\n                sext_i32_i64(virt_group_id_233156) *\n                squot64(segred_group_sizze_211995,\n                        segment_sizze_nonzzero_233145) - gtid_211999 *\n                slice_233158;\n        int64_t gtid_212000 = squot64(remnant_233160, slice_233157);\n        int64_t remnant_233161 = remnant_233160 - gtid_212000 * slice_233157;\n  ",
            "      int64_t gtid_212001 = remnant_233161;\n        int64_t remnant_233162 = remnant_233161 - gtid_212001;\n        int64_t gtid_212002 = srem64(sext_i32_i64(local_tid_233148),\n                                     q_s_203493);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_s_203493) && (((slt64(gtid_211999,\n                                                           partition_sizze_203577) &&\n                                                     slt64(gtid_212000,\n                                                           n_p_203492)) &&\n                                                    slt64(gtid_212001,\n                                                          s_n_m_203636)) &&\n                                                   slt64(sext_i32_i64(local_tid_233148),\n                                                         q_s_203493 *\n                                                         squot64(segred_group_sizze_211995,\n                                                                 segment_sizze_nonzzero_233145)))) {\n                int64_t x_212015;\n                \n                x_212015 = ((__global int64_t *) ext_mem_229264)[gtid_211999 *\n                                                                 n_p_203492 +\n                                                                 gtid_212000];\n                \n                int64_t x_212019;\n                \n                x_212019 = ((__global int64_t *) ext_mem_229363)[gtid_211999 *\n                                                                 (s_n_m_203636 *\n                                                                  n_p_203492) +\n                                                                 gtid_212000 *\n                                                                 s_n_m_203636 +\n                                                                 gtid_212001];\n                \n                double x_212020;\n                \n        ",
            "        x_212020 = ((__global double *) ext_mem_229362)[gtid_211999 *\n                                                                (s_n_m_203636 *\n                                                                 n_p_203492) +\n                                                                gtid_212000 *\n                                                                s_n_m_203636 +\n                                                                gtid_212001];\n                \n                int64_t defunc_0_m_fun_res_212021;\n                \n                defunc_0_m_fun_res_212021 = ((__global\n                                              int64_t *) mem_229687)[gtid_211999 *\n                                                                     (s_n_m_203636 *\n                                                                      n_p_203492) +\n                                                                     gtid_212000 *\n                                                                     s_n_m_203636 +\n                                                                     gtid_212001];\n                \n                bool cond_212023 = sle64(x_212015, gtid_212002);\n                int64_t defunc_0_f_res_212024;\n                \n                if (cond_212023) {\n                    defunc_0_f_res_212024 = (int64_t) 0;\n                } else {\n                    int64_t i_212025 = add64(gtid_212002, x_212019);\n                    int64_t defunc_0_add_arg_212026;\n                    \n                    defunc_0_add_arg_212026 = ((__global\n                                                int64_t *) ext_mem_229265)[gtid_211999 *\n                                                                           (defunc_0_f_res_203631 *\n                                                                            n_p_203492) +\n                                                                           gtid_212000 *\n                                                               ",
            "            defunc_0_f_res_203631 +\n                                                                           i_212025];\n                    \n                    int64_t defunc_1_add_res_212027 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_212026);\n                    \n                    defunc_0_f_res_212024 = defunc_1_add_res_212027;\n                }\n                \n                double defunc_0_f_res_212028;\n                \n                if (cond_212023) {\n                    defunc_0_f_res_212028 = 0.0;\n                } else {\n                    int64_t i_212029 = add64(gtid_212002, x_212019);\n                    double defunc_0_add_arg_212030;\n                    \n                    defunc_0_add_arg_212030 = ((__global\n                                                double *) mem_229531)[gtid_211999 *\n                                                                      (defunc_0_f_res_203631 *\n                                                                       n_p_203492) +\n                                                                      gtid_212000 *\n                                                                      defunc_0_f_res_203631 +\n                                                                      i_212029];\n                    defunc_0_f_res_212028 = defunc_0_add_arg_212030;\n                }\n                \n                int64_t binop_p_212031 = sub64(defunc_0_f_res_212024,\n                                               defunc_0_m_fun_res_212021);\n                double defunc_0_f_res_212032 = sitofp_i64_f64(binop_p_212031);\n                double abs_res_212033 = fabs(defunc_0_f_res_212032);\n                double tmp1_212034 = abs_res_212033 / x_212020;\n                double x_212035 = tmp1_212034 * tmp1_212034;\n                double y_212036 = tmp1_212034 * x_212035;\n                double tmp2_212037 = 1.0 - y_212036;\n                double x_212038 = tmp2_212037 ",
            "* tmp2_212037;\n                double tmp3_212039 = tmp2_212037 * x_212038;\n                double w_j_212040 = defunc_0_f_res_212028 * tmp3_212039;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_233152)[sext_i32_i64(local_tid_233148)] =\n                        w_j_212040;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_233152)[sext_i32_i64(local_tid_233148)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_s_203493)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_212004;\n                double x_212005;\n                double x_233163;\n                double x_233164;\n                bool ltid_in_bounds_233166 =\n                     slt64(sext_i32_i64(local_tid_233148), q_s_203493 *\n                           squot64(segred_group_sizze_211995,\n                                   segment_sizze_nonzzero_233145));\n                int32_t skip_threads_233167;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_233166) {\n                        x_212005 = ((volatile __local\n                                     double *) red_arr_mem_233152)[sext_i32_i64(local_tid_233148)];\n                        if ((local_tid_233148 - squot32(local_tid_233148, 32) *\n                             32) == 0) {\n                            x_212004 = x_212005;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_233167 = 1;\n                    while (slt32(skip_threads_233167, 32)) {\n                        bool thread_active_233168 = sle32(skip_threads_",
            "233167,\n                                                          local_tid_233148 -\n                                                          squot32(local_tid_233148,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_233166;\n                        \n                        if (thread_active_233168) {\n                            // read operands\n                            {\n                                x_212004 = ((volatile __local\n                                             double *) red_arr_mem_233152)[sext_i32_i64(local_tid_233148) -\n                                                                           sext_i32_i64(skip_threads_233167)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_233169 =\n                                 slt64(srem64(sext_i32_i64(local_tid_233148),\n                                              q_s_203493),\n                                       sext_i32_i64(local_tid_233148) -\n                                       sext_i32_i64(local_tid_233148 -\n                                       skip_threads_233167));\n                            \n                            if (thread_active_233168 && inactive_233169) {\n                                x_212004 = x_212005;\n                            }\n                            if (thread_active_233168) {\n                                if (!inactive_233169) {\n                                    double defunc_1_op_res_212006 = x_212004 +\n                                           x_212005;\n                                    \n                                    x_212004 = defunc_1_op_res_212006;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_233150, skip_threads_233167)) {\n                            barrier(CLK_L",
            "OCAL_MEM_FENCE);\n                        }\n                        if (thread_active_233168) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_233152)[sext_i32_i64(local_tid_233148)] =\n                                    x_212004;\n                                x_212005 = x_212004;\n                            }\n                        }\n                        if (sle32(wave_sizze_233150, skip_threads_233167)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_233167 *= 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_233148 - squot32(local_tid_233148, 32) *\n                         32) == 31 && ltid_in_bounds_233166) {\n                        ((volatile __local\n                          double *) red_arr_mem_233152)[sext_i32_i64(squot32(local_tid_233148,\n                                                                             32))] =\n                            x_212004;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n                {\n                    int32_t skip_threads_233170;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_233148, 32) == 0 &&\n                            ltid_in_bounds_233166) {\n                            x_233164 = ((volatile __local\n                                         double *) red_arr_mem_233152)[sext_i32_i64(local_tid_233148)];\n                            if ((local_tid_233148 - squot32(local_tid_233148,\n                               ",
            "                             32) * 32) == 0) {\n                                x_233163 = x_233164;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_233170 = 1;\n                        while (slt32(skip_threads_233170, 32)) {\n                            bool thread_active_233171 =\n                                 sle32(skip_threads_233170, local_tid_233148 -\n                                       squot32(local_tid_233148, 32) * 32) &&\n                                 (squot32(local_tid_233148, 32) == 0 &&\n                                  ltid_in_bounds_233166);\n                            \n                            if (thread_active_233171) {\n                                // read operands\n                                {\n                                    x_233163 = ((volatile __local\n                                                 double *) red_arr_mem_233152)[sext_i32_i64(local_tid_233148) -\n                                                                               sext_i32_i64(skip_threads_233170)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_233172 =\n                                     slt64(srem64(sext_i32_i64(local_tid_233148 *\n                                                  32 + 32 - 1), q_s_203493),\n                                           sext_i32_i64(local_tid_233148 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_233148 -\n                                                         skip_threads_233170) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_233171 && inactive_233172) ",
            "{\n                                    x_233163 = x_233164;\n                                }\n                                if (thread_active_233171) {\n                                    if (!inactive_233172) {\n                                        double defunc_1_op_res_233165 =\n                                               x_233163 + x_233164;\n                                        \n                                        x_233163 = defunc_1_op_res_233165;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_233150, skip_threads_233170)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_233171) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_233152)[sext_i32_i64(local_tid_233148)] =\n                                        x_233163;\n                                    x_233164 = x_233163;\n                                }\n                            }\n                            if (sle32(wave_sizze_233150, skip_threads_233170)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_233170 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_233173 = squot32(local_tid_233148, 32) == 0 ||\n                     !ltid_in_bounds_233166;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_233173) {\n                            x_212005 = x_212004;\n                            x_212004 = ((__local\n     ",
            "                                    double *) red_arr_mem_233152)[sext_i32_i64(squot32(local_tid_233148,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_233174 =\n                             slt64(srem64(sext_i32_i64(local_tid_233148),\n                                          q_s_203493),\n                                   sext_i32_i64(local_tid_233148) -\n                                   sext_i32_i64(squot32(local_tid_233148, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_233173) {\n                            if (inactive_233174) {\n                                x_212004 = x_212005;\n                            }\n                        }\n                        if (!no_carry_in_233173) {\n                            if (!inactive_233174) {\n                                double defunc_1_op_res_212006 = x_212004 +\n                                       x_212005;\n                                \n                                x_212004 = defunc_1_op_res_212006;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_233173) {\n                            ((__local\n                              double *) red_arr_mem_233152)[sext_i32_i64(local_tid_233148)] =\n                                x_212004;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_233148, 32) == 0 &&\n                        ltid_in_bounds_233166) {\n  ",
            "                      ((__local\n                          double *) red_arr_mem_233152)[sext_i32_i64(local_tid_233148)] =\n                            x_212005;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // save final values of segments\n        {\n            if (slt64(sext_i32_i64(virt_group_id_233156) *\n                      squot64(segred_group_sizze_211995,\n                              segment_sizze_nonzzero_233145) +\n                      sext_i32_i64(local_tid_233148), partition_sizze_203577 *\n                      n_p_203492 * s_n_m_203636) &&\n                slt64(sext_i32_i64(local_tid_233148),\n                      squot64(segred_group_sizze_211995,\n                              segment_sizze_nonzzero_233145))) {\n                double tmp_233175;\n                \n                tmp_233175 = ((__local\n                               double *) red_arr_mem_233152)[(sext_i32_i64(local_tid_233148) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_233145 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_229697)[squot64(sext_i32_i64(virt_group_id_233156) *\n                                                squot64(segred_group_sizze_211995,\n                                                        segment_sizze_nonzzero_233145) +\n                                                sext_i32_i64(local_tid_233148),\n                                                n_p_203492 * s_n_m_203636) *\n                                        (s_n_m_203636 * n_p_203492) +\n                                        squot64(sext_i32_i64(virt_group_id_233156) *\n                                                squot64(segred_group_sizze_211995,\n                                             ",
            "           segment_sizze_nonzzero_233145) +\n                                                sext_i32_i64(local_tid_233148) -\n                                                squot64(sext_i32_i64(virt_group_id_233156) *\n                                                        squot64(segred_group_sizze_211995,\n                                                                segment_sizze_nonzzero_233145) +\n                                                        sext_i32_i64(local_tid_233148),\n                                                        n_p_203492 *\n                                                        s_n_m_203636) *\n                                                (n_p_203492 * s_n_m_203636),\n                                                s_n_m_203636) * s_n_m_203636 +\n                                        (sext_i32_i64(virt_group_id_233156) *\n                                         squot64(segred_group_sizze_211995,\n                                                 segment_sizze_nonzzero_233145) +\n                                         sext_i32_i64(local_tid_233148) -\n                                         squot64(sext_i32_i64(virt_group_id_233156) *\n                                                 squot64(segred_group_sizze_211995,\n                                                         segment_sizze_nonzzero_233145) +\n                                                 sext_i32_i64(local_tid_233148),\n                                                 n_p_203492 * s_n_m_203636) *\n                                         (n_p_203492 * s_n_m_203636) -\n                                         squot64(sext_i32_i64(virt_group_id_233156) *\n                                                 squot64(segred_group_sizze_211995,\n                                                         segment_sizze_nonzzero_233145) +\n                                                 sext_i32_i64(local_tid_233148) -\n                                                 squot64(sext_i32_i",
            "64(virt_group_id_233156) *\n                                                         squot64(segred_group_sizze_211995,\n                                                                 segment_sizze_nonzzero_233145) +\n                                                         sext_i32_i64(local_tid_233148),\n                                                         n_p_203492 *\n                                                         s_n_m_203636) *\n                                                 (n_p_203492 * s_n_m_203636),\n                                                 s_n_m_203636) *\n                                         s_n_m_203636)] = tmp_233175;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_211995\n}\n__kernel void mainzisegred_small_212077(__global int *global_failure,\n                                        uint red_arr_mem_233240_backing_offset_0,\n                                        int64_t n_p_203492, int64_t q_s_203493,\n                                        int64_t partition_sizze_203577,\n                                        int64_t defunc_0_f_res_203631,\n                                        int64_t s_n_m_203636,\n                                        int64_t num_groups_212070,\n                                        int64_t segment_sizze_nonzzero_233233,\n                                        __global unsigned char *ext_mem_229264,\n                                        __global unsigned char *ext_mem_229265,\n                                        __global unsigned char *ext_mem_229362,\n                                        __global unsigned char *ext_mem_229363,\n                                        __global unsigned char *mem_229526,\n                                        __global unsigned char *mem_229531,\n                                        __global unsigned char *mem_229703,\n           ",
            "                             __global unsigned char *mem_229708,\n                                        __global unsigned char *mem_229714)\n{\n    #define segred_group_sizze_212069 (mainzisegred_group_sizze_211074)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_233240_backing_0 =\n                           &shared_mem[red_arr_mem_233240_backing_offset_0];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233235;\n    int32_t local_tid_233236;\n    int64_t group_sizze_233239;\n    int32_t wave_sizze_233238;\n    int32_t group_tid_233237;\n    \n    global_tid_233235 = get_global_id(0);\n    local_tid_233236 = get_local_id(0);\n    group_sizze_233239 = get_local_size(0);\n    wave_sizze_233238 = LOCKSTEP_WIDTH;\n    group_tid_233237 = get_group_id(0);\n    \n    int32_t phys_tid_212077 = global_tid_233235;\n    __local unsigned char *red_arr_mem_233240;\n    \n    red_arr_mem_233240 = (__local unsigned char *) red_arr_mem_233240_backing_0;\n    \n    int32_t phys_group_id_233242;\n    \n    phys_group_id_233242 = get_group_id(0);\n    for (int32_t i_233243 = 0; i_233243 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577 * n_p_203492 *\n                                          s_n_m_203636,\n                                          squot64(segred_group_sizze_212069,\n                                                  segment_sizze_nonzzero_233233))) -\n                   phys_group_id_233242, sext_i64_i32(num_groups_212070));\n         i_233243++) {\n        int32_t virt_group_id_233244 = phys_group_id_233242 + i_233243 *\n                sext_i64_i32(num_groups_212070);\n        int64_t slice_233245 = s_n_m_203636;\n        int64_t slice_233246 = n_p_203492 * slice_233245;\n        int64_t slice_233247 = partition_sizze_203577 * slice_233246;\n        int64_t gtid_212073 = squot64(squot64(sext_i32_i64(local_tid_233236),\n                                              s",
            "egment_sizze_nonzzero_233233) +\n                                      sext_i32_i64(virt_group_id_233244) *\n                                      squot64(segred_group_sizze_212069,\n                                              segment_sizze_nonzzero_233233),\n                                      slice_233246);\n        int64_t remnant_233248 = squot64(sext_i32_i64(local_tid_233236),\n                                         segment_sizze_nonzzero_233233) +\n                sext_i32_i64(virt_group_id_233244) *\n                squot64(segred_group_sizze_212069,\n                        segment_sizze_nonzzero_233233) - gtid_212073 *\n                slice_233246;\n        int64_t gtid_212074 = squot64(remnant_233248, slice_233245);\n        int64_t remnant_233249 = remnant_233248 - gtid_212074 * slice_233245;\n        int64_t gtid_212075 = remnant_233249;\n        int64_t remnant_233250 = remnant_233249 - gtid_212075;\n        int64_t gtid_212076 = srem64(sext_i32_i64(local_tid_233236),\n                                     q_s_203493);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_s_203493) && (((slt64(gtid_212073,\n                                                           partition_sizze_203577) &&\n                                                     slt64(gtid_212074,\n                                                           n_p_203492)) &&\n                                                    slt64(gtid_212075,\n                                                          s_n_m_203636)) &&\n                                                   slt64(sext_i32_i64(local_tid_233236),\n                                                         q_s_203493 *\n                                                         squot64(segred_group_sizze_212069,\n                                                                 segment_sizze_nonzzero_233233)))) {\n                int64_t x_212092;\n                \n                x_212092 = ((__global int64_t",
            " *) ext_mem_229264)[gtid_212073 *\n                                                                 n_p_203492 +\n                                                                 gtid_212074];\n                \n                int64_t x_212097;\n                \n                x_212097 = ((__global int64_t *) ext_mem_229363)[gtid_212073 *\n                                                                 (s_n_m_203636 *\n                                                                  n_p_203492) +\n                                                                 gtid_212074 *\n                                                                 s_n_m_203636 +\n                                                                 gtid_212075];\n                \n                double x_212098;\n                \n                x_212098 = ((__global double *) ext_mem_229362)[gtid_212073 *\n                                                                (s_n_m_203636 *\n                                                                 n_p_203492) +\n                                                                gtid_212074 *\n                                                                s_n_m_203636 +\n                                                                gtid_212075];\n                \n                double a0_212099;\n                \n                a0_212099 = ((__global double *) mem_229703)[gtid_212073 *\n                                                             (s_n_m_203636 *\n                                                              n_p_203492) +\n                                                             gtid_212074 *\n                                                             s_n_m_203636 +\n                                                             gtid_212075];\n                \n                int64_t defunc_0_m_fun_res_212100;\n                \n                defunc_0_m_fun_res_212100 = ((__global\n                                              int64_t *) mem_2",
            "29708)[gtid_212073 *\n                                                                     (s_n_m_203636 *\n                                                                      n_p_203492) +\n                                                                     gtid_212074 *\n                                                                     s_n_m_203636 +\n                                                                     gtid_212075];\n                \n                bool cond_212102 = sle64(x_212092, gtid_212076);\n                int64_t defunc_0_f_res_212103;\n                \n                if (cond_212102) {\n                    defunc_0_f_res_212103 = (int64_t) 0;\n                } else {\n                    int64_t i_212104 = add64(gtid_212076, x_212097);\n                    int64_t defunc_0_add_arg_212105;\n                    \n                    defunc_0_add_arg_212105 = ((__global\n                                                int64_t *) ext_mem_229265)[gtid_212073 *\n                                                                           (defunc_0_f_res_203631 *\n                                                                            n_p_203492) +\n                                                                           gtid_212074 *\n                                                                           defunc_0_f_res_203631 +\n                                                                           i_212104];\n                    \n                    int64_t defunc_1_add_res_212106 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_212105);\n                    \n                    defunc_0_f_res_212103 = defunc_1_add_res_212106;\n                }\n                \n                double defunc_0_f_res_212107;\n                \n                if (cond_212102) {\n                    defunc_0_f_res_212107 = 0.0;\n                } else {\n                    int64_t i_212108 = add64(gtid_212076, x_212097)",
            ";\n                    double defunc_0_add_arg_212109;\n                    \n                    defunc_0_add_arg_212109 = ((__global\n                                                double *) mem_229531)[gtid_212073 *\n                                                                      (defunc_0_f_res_203631 *\n                                                                       n_p_203492) +\n                                                                      gtid_212074 *\n                                                                      defunc_0_f_res_203631 +\n                                                                      i_212108];\n                    defunc_0_f_res_212107 = defunc_0_add_arg_212109;\n                }\n                \n                int64_t binop_p_212110 = sub64(defunc_0_f_res_212103,\n                                               defunc_0_m_fun_res_212100);\n                double defunc_0_f_res_212111 = sitofp_i64_f64(binop_p_212110);\n                double abs_res_212112 = fabs(defunc_0_f_res_212111);\n                double tmp1_212113 = abs_res_212112 / x_212098;\n                double x_212114 = tmp1_212113 * tmp1_212113;\n                double y_212115 = tmp1_212113 * x_212114;\n                double tmp2_212116 = 1.0 - y_212115;\n                double x_212117 = tmp2_212116 * tmp2_212116;\n                double tmp3_212118 = tmp2_212116 * x_212117;\n                double tmp4_212119 = defunc_0_f_res_212107 * tmp3_212118;\n                double defunc_0_f_res_212120;\n                \n                if (cond_212102) {\n                    defunc_0_f_res_212120 = 0.0;\n                } else {\n                    int64_t i_212121 = add64(gtid_212076, x_212097);\n                    double defunc_0_add_arg_212122;\n                    \n                    defunc_0_add_arg_212122 = ((__global\n                                                double *) mem_229526)[gtid_212073 *\n                                                             ",
            "         (defunc_0_f_res_203631 *\n                                                                       n_p_203492) +\n                                                                      gtid_212074 *\n                                                                      defunc_0_f_res_203631 +\n                                                                      i_212121];\n                    defunc_0_f_res_212120 = defunc_0_add_arg_212122;\n                }\n                \n                double x_212123 = a0_212099 * tmp4_212119;\n                double defunc_9_fit_fun_res_212124 = defunc_0_f_res_212120 *\n                       x_212123;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_233240)[sext_i32_i64(local_tid_233236)] =\n                        defunc_9_fit_fun_res_212124;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_233240)[sext_i32_i64(local_tid_233236)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_s_203493)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_212078;\n                double x_212079;\n                double x_233251;\n                double x_233252;\n                bool ltid_in_bounds_233254 =\n                     slt64(sext_i32_i64(local_tid_233236), q_s_203493 *\n                           squot64(segred_group_sizze_212069,\n                                   segment_sizze_nonzzero_233233));\n                int32_t skip_threads_233255;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_233254) {\n                        x_212079 = ((volatile __local\n                                     double *) red_arr_mem_233240)[sext_i32_",
            "i64(local_tid_233236)];\n                        if ((local_tid_233236 - squot32(local_tid_233236, 32) *\n                             32) == 0) {\n                            x_212078 = x_212079;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_233255 = 1;\n                    while (slt32(skip_threads_233255, 32)) {\n                        bool thread_active_233256 = sle32(skip_threads_233255,\n                                                          local_tid_233236 -\n                                                          squot32(local_tid_233236,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_233254;\n                        \n                        if (thread_active_233256) {\n                            // read operands\n                            {\n                                x_212078 = ((volatile __local\n                                             double *) red_arr_mem_233240)[sext_i32_i64(local_tid_233236) -\n                                                                           sext_i32_i64(skip_threads_233255)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_233257 =\n                                 slt64(srem64(sext_i32_i64(local_tid_233236),\n                                              q_s_203493),\n                                       sext_i32_i64(local_tid_233236) -\n                                       sext_i32_i64(local_tid_233236 -\n                                       skip_threads_233255));\n                            \n                            if (thread_active_233256 && inactive_233257) {\n                                x_212078 = x_212079;\n                            }\n                            if (thread_ac",
            "tive_233256) {\n                                if (!inactive_233257) {\n                                    double defunc_1_op_res_212080 = x_212078 +\n                                           x_212079;\n                                    \n                                    x_212078 = defunc_1_op_res_212080;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_233238, skip_threads_233255)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_233256) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_233240)[sext_i32_i64(local_tid_233236)] =\n                                    x_212078;\n                                x_212079 = x_212078;\n                            }\n                        }\n                        if (sle32(wave_sizze_233238, skip_threads_233255)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_233255 *= 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_233236 - squot32(local_tid_233236, 32) *\n                         32) == 31 && ltid_in_bounds_233254) {\n                        ((volatile __local\n                          double *) red_arr_mem_233240)[sext_i32_i64(squot32(local_tid_233236,\n                                                                             32))] =\n                            x_212078;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n                {\n               ",
            "     int32_t skip_threads_233258;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_233236, 32) == 0 &&\n                            ltid_in_bounds_233254) {\n                            x_233252 = ((volatile __local\n                                         double *) red_arr_mem_233240)[sext_i32_i64(local_tid_233236)];\n                            if ((local_tid_233236 - squot32(local_tid_233236,\n                                                            32) * 32) == 0) {\n                                x_233251 = x_233252;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_233258 = 1;\n                        while (slt32(skip_threads_233258, 32)) {\n                            bool thread_active_233259 =\n                                 sle32(skip_threads_233258, local_tid_233236 -\n                                       squot32(local_tid_233236, 32) * 32) &&\n                                 (squot32(local_tid_233236, 32) == 0 &&\n                                  ltid_in_bounds_233254);\n                            \n                            if (thread_active_233259) {\n                                // read operands\n                                {\n                                    x_233251 = ((volatile __local\n                                                 double *) red_arr_mem_233240)[sext_i32_i64(local_tid_233236) -\n                                                                               sext_i32_i64(skip_threads_233258)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_233260 =\n                                     slt64(srem64(sext_i32_i64(local_tid_233236 *\n               ",
            "                                   32 + 32 - 1), q_s_203493),\n                                           sext_i32_i64(local_tid_233236 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_233236 -\n                                                         skip_threads_233258) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_233259 && inactive_233260) {\n                                    x_233251 = x_233252;\n                                }\n                                if (thread_active_233259) {\n                                    if (!inactive_233260) {\n                                        double defunc_1_op_res_233253 =\n                                               x_233251 + x_233252;\n                                        \n                                        x_233251 = defunc_1_op_res_233253;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_233238, skip_threads_233258)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_233259) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_233240)[sext_i32_i64(local_tid_233236)] =\n                                        x_233251;\n                                    x_233252 = x_233251;\n                                }\n                            }\n                            if (sle32(wave_sizze_233238, skip_threads_233258)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_233258 *= 2;\n                        }\n                  ",
            "  }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_233261 = squot32(local_tid_233236, 32) == 0 ||\n                     !ltid_in_bounds_233254;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_233261) {\n                            x_212079 = x_212078;\n                            x_212078 = ((__local\n                                         double *) red_arr_mem_233240)[sext_i32_i64(squot32(local_tid_233236,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_233262 =\n                             slt64(srem64(sext_i32_i64(local_tid_233236),\n                                          q_s_203493),\n                                   sext_i32_i64(local_tid_233236) -\n                                   sext_i32_i64(squot32(local_tid_233236, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_233261) {\n                            if (inactive_233262) {\n                                x_212078 = x_212079;\n                            }\n                        }\n                        if (!no_carry_in_233261) {\n                            if (!inactive_233262) {\n                                double defunc_1_op_res_212080 = x_212078 +\n                                       x_212079;\n                                \n                                x_212078 = defunc_1_op_res_212080;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n       ",
            "                 if (!no_carry_in_233261) {\n                            ((__local\n                              double *) red_arr_mem_233240)[sext_i32_i64(local_tid_233236)] =\n                                x_212078;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_233236, 32) == 0 &&\n                        ltid_in_bounds_233254) {\n                        ((__local\n                          double *) red_arr_mem_233240)[sext_i32_i64(local_tid_233236)] =\n                            x_212079;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // save final values of segments\n        {\n            if (slt64(sext_i32_i64(virt_group_id_233244) *\n                      squot64(segred_group_sizze_212069,\n                              segment_sizze_nonzzero_233233) +\n                      sext_i32_i64(local_tid_233236), partition_sizze_203577 *\n                      n_p_203492 * s_n_m_203636) &&\n                slt64(sext_i32_i64(local_tid_233236),\n                      squot64(segred_group_sizze_212069,\n                              segment_sizze_nonzzero_233233))) {\n                double tmp_233263;\n                \n                tmp_233263 = ((__local\n                               double *) red_arr_mem_233240)[(sext_i32_i64(local_tid_233236) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_233233 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_229714)[squot64(sext_i32_i64(virt_group_id_233244) *\n                                                squot64(segred_group_sizze_212069,\n          ",
            "                                              segment_sizze_nonzzero_233233) +\n                                                sext_i32_i64(local_tid_233236),\n                                                n_p_203492 * s_n_m_203636) *\n                                        (s_n_m_203636 * n_p_203492) +\n                                        squot64(sext_i32_i64(virt_group_id_233244) *\n                                                squot64(segred_group_sizze_212069,\n                                                        segment_sizze_nonzzero_233233) +\n                                                sext_i32_i64(local_tid_233236) -\n                                                squot64(sext_i32_i64(virt_group_id_233244) *\n                                                        squot64(segred_group_sizze_212069,\n                                                                segment_sizze_nonzzero_233233) +\n                                                        sext_i32_i64(local_tid_233236),\n                                                        n_p_203492 *\n                                                        s_n_m_203636) *\n                                                (n_p_203492 * s_n_m_203636),\n                                                s_n_m_203636) * s_n_m_203636 +\n                                        (sext_i32_i64(virt_group_id_233244) *\n                                         squot64(segred_group_sizze_212069,\n                                                 segment_sizze_nonzzero_233233) +\n                                         sext_i32_i64(local_tid_233236) -\n                                         squot64(sext_i32_i64(virt_group_id_233244) *\n                                                 squot64(segred_group_sizze_212069,\n                                                         segment_sizze_nonzzero_233233) +\n                                                 sext_i32_i64(local_tid_233236),\n                                       ",
            "          n_p_203492 * s_n_m_203636) *\n                                         (n_p_203492 * s_n_m_203636) -\n                                         squot64(sext_i32_i64(virt_group_id_233244) *\n                                                 squot64(segred_group_sizze_212069,\n                                                         segment_sizze_nonzzero_233233) +\n                                                 sext_i32_i64(local_tid_233236) -\n                                                 squot64(sext_i32_i64(virt_group_id_233244) *\n                                                         squot64(segred_group_sizze_212069,\n                                                                 segment_sizze_nonzzero_233233) +\n                                                         sext_i32_i64(local_tid_233236),\n                                                         n_p_203492 *\n                                                         s_n_m_203636) *\n                                                 (n_p_203492 * s_n_m_203636),\n                                                 s_n_m_203636) *\n                                         s_n_m_203636)] = tmp_233263;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_212069\n}\n__kernel void mainzisegred_small_214137(__global int *global_failure,\n                                        uint red_arr_mem_233489_backing_offset_0,\n                                        uint red_arr_mem_233487_backing_offset_1,\n                                        uint red_arr_mem_233485_backing_offset_2,\n                                        int64_t n_p_203492, int64_t q_s_203493,\n                                        int64_t partition_sizze_203577,\n                                        int64_t defunc_0_f_res_203631,\n                                        int64_t s_n_m_203636,\n                      ",
            "                  int64_t num_groups_214128,\n                                        int64_t segment_sizze_nonzzero_233478,\n                                        __global unsigned char *ext_mem_229264,\n                                        __global unsigned char *ext_mem_229265,\n                                        __global unsigned char *ext_mem_229362,\n                                        __global unsigned char *ext_mem_229363,\n                                        __global unsigned char *mem_229531,\n                                        __global unsigned char *mem_229973,\n                                        __global unsigned char *mem_229983,\n                                        __global unsigned char *mem_229988,\n                                        __global unsigned char *mem_229993)\n{\n    #define segred_group_sizze_214127 (mainzisegred_group_sizze_213093)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_233489_backing_2 =\n                           &shared_mem[red_arr_mem_233489_backing_offset_0];\n    volatile unsigned char *red_arr_mem_233487_backing_1 =\n                           &shared_mem[red_arr_mem_233487_backing_offset_1];\n    volatile unsigned char *red_arr_mem_233485_backing_0 =\n                           &shared_mem[red_arr_mem_233485_backing_offset_2];\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_214137 = global_tid_233480;\n    __local unsigned char *red_arr_mem_233485;\n    \n    red_arr_mem_233485 = (__local unsigned char *) red_arr_mem_233485_ba",
            "cking_0;\n    \n    __local unsigned char *red_arr_mem_233487;\n    \n    red_arr_mem_233487 = (__local unsigned char *) red_arr_mem_233487_backing_1;\n    \n    __local unsigned char *red_arr_mem_233489;\n    \n    red_arr_mem_233489 = (__local unsigned char *) red_arr_mem_233489_backing_2;\n    \n    int32_t phys_group_id_233491;\n    \n    phys_group_id_233491 = get_group_id(0);\n    for (int32_t i_233492 = 0; i_233492 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577 * n_p_203492 *\n                                          s_n_m_203636,\n                                          squot64(segred_group_sizze_214127,\n                                                  segment_sizze_nonzzero_233478))) -\n                   phys_group_id_233491, sext_i64_i32(num_groups_214128));\n         i_233492++) {\n        int32_t virt_group_id_233493 = phys_group_id_233491 + i_233492 *\n                sext_i64_i32(num_groups_214128);\n        int64_t slice_233494 = s_n_m_203636;\n        int64_t slice_233495 = n_p_203492 * slice_233494;\n        int64_t slice_233496 = partition_sizze_203577 * slice_233495;\n        int64_t gtid_214133 = squot64(squot64(sext_i32_i64(local_tid_233481),\n                                              segment_sizze_nonzzero_233478) +\n                                      sext_i32_i64(virt_group_id_233493) *\n                                      squot64(segred_group_sizze_214127,\n                                              segment_sizze_nonzzero_233478),\n                                      slice_233495);\n        int64_t remnant_233497 = squot64(sext_i32_i64(local_tid_233481),\n                                         segment_sizze_nonzzero_233478) +\n                sext_i32_i64(virt_group_id_233493) *\n                squot64(segred_group_sizze_214127,\n                        segment_sizze_nonzzero_233478) - gtid_214133 *\n                slice_233495;\n        int64_t gtid_214134 = squot64(remnant_233497, slice_233494);\n        int64_t remnant_233498 = remn",
            "ant_233497 - gtid_214134 * slice_233494;\n        int64_t gtid_214135 = remnant_233498;\n        int64_t remnant_233499 = remnant_233498 - gtid_214135;\n        int64_t gtid_214136 = srem64(sext_i32_i64(local_tid_233481),\n                                     q_s_203493);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_s_203493) && (((slt64(gtid_214133,\n                                                           partition_sizze_203577) &&\n                                                     slt64(gtid_214134,\n                                                           n_p_203492)) &&\n                                                    slt64(gtid_214135,\n                                                          s_n_m_203636)) &&\n                                                   slt64(sext_i32_i64(local_tid_233481),\n                                                         q_s_203493 *\n                                                         squot64(segred_group_sizze_214127,\n                                                                 segment_sizze_nonzzero_233478)))) {\n                int64_t x_214155;\n                \n                x_214155 = ((__global int64_t *) ext_mem_229264)[gtid_214133 *\n                                                                 n_p_203492 +\n                                                                 gtid_214134];\n                \n                int64_t x_214159;\n                \n                x_214159 = ((__global int64_t *) ext_mem_229363)[gtid_214133 *\n                                                                 (s_n_m_203636 *\n                                                                  n_p_203492) +\n                                                                 gtid_214134 *\n                                                                 s_n_m_203636 +\n                                                                 gtid_214135];\n                \n               ",
            " double x_214160;\n                \n                x_214160 = ((__global double *) ext_mem_229362)[gtid_214133 *\n                                                                (s_n_m_203636 *\n                                                                 n_p_203492) +\n                                                                gtid_214134 *\n                                                                s_n_m_203636 +\n                                                                gtid_214135];\n                \n                int64_t defunc_0_m_fun_res_214161;\n                \n                defunc_0_m_fun_res_214161 = ((__global\n                                              int64_t *) mem_229973)[gtid_214133 *\n                                                                     (s_n_m_203636 *\n                                                                      n_p_203492) +\n                                                                     gtid_214134 *\n                                                                     s_n_m_203636 +\n                                                                     gtid_214135];\n                \n                bool cond_214163 = sle64(x_214155, gtid_214136);\n                int64_t defunc_0_f_res_214164;\n                \n                if (cond_214163) {\n                    defunc_0_f_res_214164 = (int64_t) 0;\n                } else {\n                    int64_t i_214165 = add64(gtid_214136, x_214159);\n                    int64_t defunc_0_add_arg_214166;\n                    \n                    defunc_0_add_arg_214166 = ((__global\n                                                int64_t *) ext_mem_229265)[gtid_214133 *\n                                                                           (defunc_0_f_res_203631 *\n                                                                            n_p_203492) +\n                                                                           gtid_214134 *\n                    ",
            "                                                       defunc_0_f_res_203631 +\n                                                                           i_214165];\n                    \n                    int64_t defunc_1_add_res_214167 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_214166);\n                    \n                    defunc_0_f_res_214164 = defunc_1_add_res_214167;\n                }\n                \n                double defunc_0_f_res_214168;\n                \n                if (cond_214163) {\n                    defunc_0_f_res_214168 = 0.0;\n                } else {\n                    int64_t i_214169 = add64(gtid_214136, x_214159);\n                    double defunc_0_add_arg_214170;\n                    \n                    defunc_0_add_arg_214170 = ((__global\n                                                double *) mem_229531)[gtid_214133 *\n                                                                      (defunc_0_f_res_203631 *\n                                                                       n_p_203492) +\n                                                                      gtid_214134 *\n                                                                      defunc_0_f_res_203631 +\n                                                                      i_214169];\n                    defunc_0_f_res_214168 = defunc_0_add_arg_214170;\n                }\n                \n                int64_t binop_p_214171 = sub64(defunc_0_f_res_214164,\n                                               defunc_0_m_fun_res_214161);\n                double defunc_0_f_res_214172 = sitofp_i64_f64(binop_p_214171);\n                double abs_res_214173 = fabs(defunc_0_f_res_214172);\n                double tmp1_214174 = abs_res_214173 / x_214160;\n                double x_214175 = tmp1_214174 * tmp1_214174;\n                double y_214176 = tmp1_214174 * x_214175;\n                double tmp2_214177 = 1.0 - y_214176;\n   ",
            "             double x_214178 = tmp2_214177 * tmp2_214177;\n                double tmp3_214179 = tmp2_214177 * x_214178;\n                double w_j_214180 = defunc_0_f_res_214168 * tmp3_214179;\n                double xw_j_214181 = defunc_0_f_res_214172 * w_j_214180;\n                double x2w_j_214182 = defunc_0_f_res_214172 * xw_j_214181;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_233485)[sext_i32_i64(local_tid_233481)] =\n                        w_j_214180;\n                    ((__local\n                      double *) red_arr_mem_233487)[sext_i32_i64(local_tid_233481)] =\n                        xw_j_214181;\n                    ((__local\n                      double *) red_arr_mem_233489)[sext_i32_i64(local_tid_233481)] =\n                        x2w_j_214182;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_233485)[sext_i32_i64(local_tid_233481)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_233487)[sext_i32_i64(local_tid_233481)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_233489)[sext_i32_i64(local_tid_233481)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_s_203493)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_214138;\n                double x_214139;\n                double x_214140;\n                double x_214141;\n                double x_214142;\n                double x_214143;\n                double x_233500;\n                double x_233501;\n                double x_233502;\n                double x_233503;\n                double x_233504;\n                double x_233505;\n                bool ltid_in_bounds_233509 =\n",
            "                     slt64(sext_i32_i64(local_tid_233481), q_s_203493 *\n                           squot64(segred_group_sizze_214127,\n                                   segment_sizze_nonzzero_233478));\n                int32_t skip_threads_233510;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_233509) {\n                        x_214141 = ((volatile __local\n                                     double *) red_arr_mem_233485)[sext_i32_i64(local_tid_233481)];\n                        x_214142 = ((volatile __local\n                                     double *) red_arr_mem_233487)[sext_i32_i64(local_tid_233481)];\n                        x_214143 = ((volatile __local\n                                     double *) red_arr_mem_233489)[sext_i32_i64(local_tid_233481)];\n                        if ((local_tid_233481 - squot32(local_tid_233481, 32) *\n                             32) == 0) {\n                            x_214138 = x_214141;\n                            x_214139 = x_214142;\n                            x_214140 = x_214143;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_233510 = 1;\n                    while (slt32(skip_threads_233510, 32)) {\n                        bool thread_active_233511 = sle32(skip_threads_233510,\n                                                          local_tid_233481 -\n                                                          squot32(local_tid_233481,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_233509;\n                        \n                        if (thread_active_233511) {\n                            // read operands\n                            {\n                                x_214138 = ((volatile __local\n                                             double ",
            "*) red_arr_mem_233485)[sext_i32_i64(local_tid_233481) -\n                                                                           sext_i32_i64(skip_threads_233510)];\n                                x_214139 = ((volatile __local\n                                             double *) red_arr_mem_233487)[sext_i32_i64(local_tid_233481) -\n                                                                           sext_i32_i64(skip_threads_233510)];\n                                x_214140 = ((volatile __local\n                                             double *) red_arr_mem_233489)[sext_i32_i64(local_tid_233481) -\n                                                                           sext_i32_i64(skip_threads_233510)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_233512 =\n                                 slt64(srem64(sext_i32_i64(local_tid_233481),\n                                              q_s_203493),\n                                       sext_i32_i64(local_tid_233481) -\n                                       sext_i32_i64(local_tid_233481 -\n                                       skip_threads_233510));\n                            \n                            if (thread_active_233511 && inactive_233512) {\n                                x_214138 = x_214141;\n                                x_214139 = x_214142;\n                                x_214140 = x_214143;\n                            }\n                            if (thread_active_233511) {\n                                if (!inactive_233512) {\n                                    double defunc_1_op_res_214144 = x_214138 +\n                                           x_214141;\n                                    double defunc_1_op_res_214145 = x_214139 +\n                                           x_214142;\n                                    double defunc_1_op_res_214146 = x_214140 +\n   ",
            "                                        x_214143;\n                                    \n                                    x_214138 = defunc_1_op_res_214144;\n                                    x_214139 = defunc_1_op_res_214145;\n                                    x_214140 = defunc_1_op_res_214146;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_233483, skip_threads_233510)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_233511) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_233485)[sext_i32_i64(local_tid_233481)] =\n                                    x_214138;\n                                x_214141 = x_214138;\n                                ((volatile __local\n                                  double *) red_arr_mem_233487)[sext_i32_i64(local_tid_233481)] =\n                                    x_214139;\n                                x_214142 = x_214139;\n                                ((volatile __local\n                                  double *) red_arr_mem_233489)[sext_i32_i64(local_tid_233481)] =\n                                    x_214140;\n                                x_214143 = x_214140;\n                            }\n                        }\n                        if (sle32(wave_sizze_233483, skip_threads_233510)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_233510 *= 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) *\n                         32) == 31 && ltid_in_bounds_233",
            "509) {\n                        ((volatile __local\n                          double *) red_arr_mem_233485)[sext_i32_i64(squot32(local_tid_233481,\n                                                                             32))] =\n                            x_214138;\n                        ((volatile __local\n                          double *) red_arr_mem_233487)[sext_i32_i64(squot32(local_tid_233481,\n                                                                             32))] =\n                            x_214139;\n                        ((volatile __local\n                          double *) red_arr_mem_233489)[sext_i32_i64(squot32(local_tid_233481,\n                                                                             32))] =\n                            x_214140;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n                {\n                    int32_t skip_threads_233513;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_233481, 32) == 0 &&\n                            ltid_in_bounds_233509) {\n                            x_233503 = ((volatile __local\n                                         double *) red_arr_mem_233485)[sext_i32_i64(local_tid_233481)];\n                            x_233504 = ((volatile __local\n                                         double *) red_arr_mem_233487)[sext_i32_i64(local_tid_233481)];\n                            x_233505 = ((volatile __local\n                                         double *) red_arr_mem_233489)[sext_i32_i64(local_tid_233481)];\n                            if ((local_tid_233481 - squot32(local_tid_233481,\n                                                            32) * 32) == 0) {\n                                x_233500 = x_233503;\n                                x_233501 = x_23350",
            "4;\n                                x_233502 = x_233505;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_233513 = 1;\n                        while (slt32(skip_threads_233513, 32)) {\n                            bool thread_active_233514 =\n                                 sle32(skip_threads_233513, local_tid_233481 -\n                                       squot32(local_tid_233481, 32) * 32) &&\n                                 (squot32(local_tid_233481, 32) == 0 &&\n                                  ltid_in_bounds_233509);\n                            \n                            if (thread_active_233514) {\n                                // read operands\n                                {\n                                    x_233500 = ((volatile __local\n                                                 double *) red_arr_mem_233485)[sext_i32_i64(local_tid_233481) -\n                                                                               sext_i32_i64(skip_threads_233513)];\n                                    x_233501 = ((volatile __local\n                                                 double *) red_arr_mem_233487)[sext_i32_i64(local_tid_233481) -\n                                                                               sext_i32_i64(skip_threads_233513)];\n                                    x_233502 = ((volatile __local\n                                                 double *) red_arr_mem_233489)[sext_i32_i64(local_tid_233481) -\n                                                                               sext_i32_i64(skip_threads_233513)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_233515 =\n                                     slt64(srem64(sext_i32_i64(local_tid_2",
            "33481 *\n                                                  32 + 32 - 1), q_s_203493),\n                                           sext_i32_i64(local_tid_233481 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_233481 -\n                                                         skip_threads_233513) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_233514 && inactive_233515) {\n                                    x_233500 = x_233503;\n                                    x_233501 = x_233504;\n                                    x_233502 = x_233505;\n                                }\n                                if (thread_active_233514) {\n                                    if (!inactive_233515) {\n                                        double defunc_1_op_res_233506 =\n                                               x_233500 + x_233503;\n                                        double defunc_1_op_res_233507 =\n                                               x_233501 + x_233504;\n                                        double defunc_1_op_res_233508 =\n                                               x_233502 + x_233505;\n                                        \n                                        x_233500 = defunc_1_op_res_233506;\n                                        x_233501 = defunc_1_op_res_233507;\n                                        x_233502 = defunc_1_op_res_233508;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_233483, skip_threads_233513)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_233514) {\n                                // write result\n                                {\n                                ",
            "    ((volatile __local\n                                      double *) red_arr_mem_233485)[sext_i32_i64(local_tid_233481)] =\n                                        x_233500;\n                                    x_233503 = x_233500;\n                                    ((volatile __local\n                                      double *) red_arr_mem_233487)[sext_i32_i64(local_tid_233481)] =\n                                        x_233501;\n                                    x_233504 = x_233501;\n                                    ((volatile __local\n                                      double *) red_arr_mem_233489)[sext_i32_i64(local_tid_233481)] =\n                                        x_233502;\n                                    x_233505 = x_233502;\n                                }\n                            }\n                            if (sle32(wave_sizze_233483, skip_threads_233513)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_233513 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_233516 = squot32(local_tid_233481, 32) == 0 ||\n                     !ltid_in_bounds_233509;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_233516) {\n                            x_214141 = x_214138;\n                            x_214142 = x_214139;\n                            x_214143 = x_214140;\n                            x_214138 = ((__local\n                                         double *) red_arr_mem_233485)[sext_i32_i64(squot32(local_tid_233481,\n                                                                                            32)) -\n                                                                       (int64_t) 1];",
            "\n                            x_214139 = ((__local\n                                         double *) red_arr_mem_233487)[sext_i32_i64(squot32(local_tid_233481,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_214140 = ((__local\n                                         double *) red_arr_mem_233489)[sext_i32_i64(squot32(local_tid_233481,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_233517 =\n                             slt64(srem64(sext_i32_i64(local_tid_233481),\n                                          q_s_203493),\n                                   sext_i32_i64(local_tid_233481) -\n                                   sext_i32_i64(squot32(local_tid_233481, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_233516) {\n                            if (inactive_233517) {\n                                x_214138 = x_214141;\n                                x_214139 = x_214142;\n                                x_214140 = x_214143;\n                            }\n                        }\n                        if (!no_carry_in_233516) {\n                            if (!inactive_233517) {\n                                double defunc_1_op_res_214144 = x_214138 +\n                                       x_214141;\n                                double defunc_1_op_res_214145 = x_214139 +\n                                       x_214142;\n                                double defunc_1_op_res_214146 = x_214140 +\n                                       x_214143;\n                ",
            "                \n                                x_214138 = defunc_1_op_res_214144;\n                                x_214139 = defunc_1_op_res_214145;\n                                x_214140 = defunc_1_op_res_214146;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_233516) {\n                            ((__local\n                              double *) red_arr_mem_233485)[sext_i32_i64(local_tid_233481)] =\n                                x_214138;\n                            ((__local\n                              double *) red_arr_mem_233487)[sext_i32_i64(local_tid_233481)] =\n                                x_214139;\n                            ((__local\n                              double *) red_arr_mem_233489)[sext_i32_i64(local_tid_233481)] =\n                                x_214140;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_233481, 32) == 0 &&\n                        ltid_in_bounds_233509) {\n                        ((__local\n                          double *) red_arr_mem_233485)[sext_i32_i64(local_tid_233481)] =\n                            x_214141;\n                        ((__local\n                          double *) red_arr_mem_233487)[sext_i32_i64(local_tid_233481)] =\n                            x_214142;\n                        ((__local\n                          double *) red_arr_mem_233489)[sext_i32_i64(local_tid_233481)] =\n                            x_214143;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // save final values of segments\n        {\n            if (slt64(sext_i32_i64(virt_group_id_233493) *\n                      sq",
            "uot64(segred_group_sizze_214127,\n                              segment_sizze_nonzzero_233478) +\n                      sext_i32_i64(local_tid_233481), partition_sizze_203577 *\n                      n_p_203492 * s_n_m_203636) &&\n                slt64(sext_i32_i64(local_tid_233481),\n                      squot64(segred_group_sizze_214127,\n                              segment_sizze_nonzzero_233478))) {\n                double tmp_233518;\n                \n                tmp_233518 = ((__local\n                               double *) red_arr_mem_233485)[(sext_i32_i64(local_tid_233481) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_233478 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_229983)[squot64(sext_i32_i64(virt_group_id_233493) *\n                                                squot64(segred_group_sizze_214127,\n                                                        segment_sizze_nonzzero_233478) +\n                                                sext_i32_i64(local_tid_233481),\n                                                n_p_203492 * s_n_m_203636) *\n                                        (s_n_m_203636 * n_p_203492) +\n                                        squot64(sext_i32_i64(virt_group_id_233493) *\n                                                squot64(segred_group_sizze_214127,\n                                                        segment_sizze_nonzzero_233478) +\n                                                sext_i32_i64(local_tid_233481) -\n                                                squot64(sext_i32_i64(virt_group_id_233493) *\n                                                        squot64(segred_group_sizze_214127,\n                                                                segment_sizze_nonzzero_233478) +\n                                    ",
            "                    sext_i32_i64(local_tid_233481),\n                                                        n_p_203492 *\n                                                        s_n_m_203636) *\n                                                (n_p_203492 * s_n_m_203636),\n                                                s_n_m_203636) * s_n_m_203636 +\n                                        (sext_i32_i64(virt_group_id_233493) *\n                                         squot64(segred_group_sizze_214127,\n                                                 segment_sizze_nonzzero_233478) +\n                                         sext_i32_i64(local_tid_233481) -\n                                         squot64(sext_i32_i64(virt_group_id_233493) *\n                                                 squot64(segred_group_sizze_214127,\n                                                         segment_sizze_nonzzero_233478) +\n                                                 sext_i32_i64(local_tid_233481),\n                                                 n_p_203492 * s_n_m_203636) *\n                                         (n_p_203492 * s_n_m_203636) -\n                                         squot64(sext_i32_i64(virt_group_id_233493) *\n                                                 squot64(segred_group_sizze_214127,\n                                                         segment_sizze_nonzzero_233478) +\n                                                 sext_i32_i64(local_tid_233481) -\n                                                 squot64(sext_i32_i64(virt_group_id_233493) *\n                                                         squot64(segred_group_sizze_214127,\n                                                                 segment_sizze_nonzzero_233478) +\n                                                         sext_i32_i64(local_tid_233481),\n                                                         n_p_203492 *\n                                                         s_n_m_203",
            "636) *\n                                                 (n_p_203492 * s_n_m_203636),\n                                                 s_n_m_203636) *\n                                         s_n_m_203636)] = tmp_233518;\n                \n                double tmp_233519;\n                \n                tmp_233519 = ((__local\n                               double *) red_arr_mem_233487)[(sext_i32_i64(local_tid_233481) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_233478 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_229988)[squot64(sext_i32_i64(virt_group_id_233493) *\n                                                squot64(segred_group_sizze_214127,\n                                                        segment_sizze_nonzzero_233478) +\n                                                sext_i32_i64(local_tid_233481),\n                                                n_p_203492 * s_n_m_203636) *\n                                        (s_n_m_203636 * n_p_203492) +\n                                        squot64(sext_i32_i64(virt_group_id_233493) *\n                                                squot64(segred_group_sizze_214127,\n                                                        segment_sizze_nonzzero_233478) +\n                                                sext_i32_i64(local_tid_233481) -\n                                                squot64(sext_i32_i64(virt_group_id_233493) *\n                                                        squot64(segred_group_sizze_214127,\n                                                                segment_sizze_nonzzero_233478) +\n                                                        sext_i32_i64(local_tid_233481),\n                                                        n_p_203492 *\n                                             ",
            "           s_n_m_203636) *\n                                                (n_p_203492 * s_n_m_203636),\n                                                s_n_m_203636) * s_n_m_203636 +\n                                        (sext_i32_i64(virt_group_id_233493) *\n                                         squot64(segred_group_sizze_214127,\n                                                 segment_sizze_nonzzero_233478) +\n                                         sext_i32_i64(local_tid_233481) -\n                                         squot64(sext_i32_i64(virt_group_id_233493) *\n                                                 squot64(segred_group_sizze_214127,\n                                                         segment_sizze_nonzzero_233478) +\n                                                 sext_i32_i64(local_tid_233481),\n                                                 n_p_203492 * s_n_m_203636) *\n                                         (n_p_203492 * s_n_m_203636) -\n                                         squot64(sext_i32_i64(virt_group_id_233493) *\n                                                 squot64(segred_group_sizze_214127,\n                                                         segment_sizze_nonzzero_233478) +\n                                                 sext_i32_i64(local_tid_233481) -\n                                                 squot64(sext_i32_i64(virt_group_id_233493) *\n                                                         squot64(segred_group_sizze_214127,\n                                                                 segment_sizze_nonzzero_233478) +\n                                                         sext_i32_i64(local_tid_233481),\n                                                         n_p_203492 *\n                                                         s_n_m_203636) *\n                                                 (n_p_203492 * s_n_m_203636),\n                                                 s_n_m_203636) *\n                ",
            "                         s_n_m_203636)] = tmp_233519;\n                \n                double tmp_233520;\n                \n                tmp_233520 = ((__local\n                               double *) red_arr_mem_233489)[(sext_i32_i64(local_tid_233481) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_233478 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_229993)[squot64(sext_i32_i64(virt_group_id_233493) *\n                                                squot64(segred_group_sizze_214127,\n                                                        segment_sizze_nonzzero_233478) +\n                                                sext_i32_i64(local_tid_233481),\n                                                n_p_203492 * s_n_m_203636) *\n                                        (s_n_m_203636 * n_p_203492) +\n                                        squot64(sext_i32_i64(virt_group_id_233493) *\n                                                squot64(segred_group_sizze_214127,\n                                                        segment_sizze_nonzzero_233478) +\n                                                sext_i32_i64(local_tid_233481) -\n                                                squot64(sext_i32_i64(virt_group_id_233493) *\n                                                        squot64(segred_group_sizze_214127,\n                                                                segment_sizze_nonzzero_233478) +\n                                                        sext_i32_i64(local_tid_233481),\n                                                        n_p_203492 *\n                                                        s_n_m_203636) *\n                                                (n_p_203492 * s_n_m_203636),\n                                                s_n_m_203636) ",
            "* s_n_m_203636 +\n                                        (sext_i32_i64(virt_group_id_233493) *\n                                         squot64(segred_group_sizze_214127,\n                                                 segment_sizze_nonzzero_233478) +\n                                         sext_i32_i64(local_tid_233481) -\n                                         squot64(sext_i32_i64(virt_group_id_233493) *\n                                                 squot64(segred_group_sizze_214127,\n                                                         segment_sizze_nonzzero_233478) +\n                                                 sext_i32_i64(local_tid_233481),\n                                                 n_p_203492 * s_n_m_203636) *\n                                         (n_p_203492 * s_n_m_203636) -\n                                         squot64(sext_i32_i64(virt_group_id_233493) *\n                                                 squot64(segred_group_sizze_214127,\n                                                         segment_sizze_nonzzero_233478) +\n                                                 sext_i32_i64(local_tid_233481) -\n                                                 squot64(sext_i32_i64(virt_group_id_233493) *\n                                                         squot64(segred_group_sizze_214127,\n                                                                 segment_sizze_nonzzero_233478) +\n                                                         sext_i32_i64(local_tid_233481),\n                                                         n_p_203492 *\n                                                         s_n_m_203636) *\n                                                 (n_p_203492 * s_n_m_203636),\n                                                 s_n_m_203636) *\n                                         s_n_m_203636)] = tmp_233520;\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_214127\n}\n__kernel void mainzisegred_small_214231(__global int *global_failure,\n                                        uint red_arr_mem_233603_backing_offset_0,\n                                        uint red_arr_mem_233601_backing_offset_1,\n                                        int64_t n_p_203492, int64_t q_s_203493,\n                                        int64_t partition_sizze_203577,\n                                        int64_t defunc_0_f_res_203631,\n                                        int64_t s_n_m_203636,\n                                        int64_t num_groups_214223,\n                                        int64_t segment_sizze_nonzzero_233594,\n                                        __global unsigned char *ext_mem_229264,\n                                        __global unsigned char *ext_mem_229265,\n                                        __global unsigned char *ext_mem_229362,\n                                        __global unsigned char *ext_mem_229363,\n                                        __global unsigned char *mem_229526,\n                                        __global unsigned char *mem_229531,\n                                        __global unsigned char *mem_229999,\n                                        __global unsigned char *mem_230004,\n                                        __global unsigned char *mem_230009,\n                                        __global unsigned char *mem_230014,\n                                        __global unsigned char *mem_230020,\n                                        __global unsigned char *mem_230025)\n{\n    #define segred_group_sizze_214222 (mainzisegred_group_sizze_212960)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_233603_backing_1 =\n                           &shared_mem[red_arr_mem_233603_backing_offset_0];\n    volatile unsig",
            "ned char *red_arr_mem_233601_backing_0 =\n                           &shared_mem[red_arr_mem_233601_backing_offset_1];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233596;\n    int32_t local_tid_233597;\n    int64_t group_sizze_233600;\n    int32_t wave_sizze_233599;\n    int32_t group_tid_233598;\n    \n    global_tid_233596 = get_global_id(0);\n    local_tid_233597 = get_local_id(0);\n    group_sizze_233600 = get_local_size(0);\n    wave_sizze_233599 = LOCKSTEP_WIDTH;\n    group_tid_233598 = get_group_id(0);\n    \n    int32_t phys_tid_214231 = global_tid_233596;\n    __local unsigned char *red_arr_mem_233601;\n    \n    red_arr_mem_233601 = (__local unsigned char *) red_arr_mem_233601_backing_0;\n    \n    __local unsigned char *red_arr_mem_233603;\n    \n    red_arr_mem_233603 = (__local unsigned char *) red_arr_mem_233603_backing_1;\n    \n    int32_t phys_group_id_233605;\n    \n    phys_group_id_233605 = get_group_id(0);\n    for (int32_t i_233606 = 0; i_233606 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577 * n_p_203492 *\n                                          s_n_m_203636,\n                                          squot64(segred_group_sizze_214222,\n                                                  segment_sizze_nonzzero_233594))) -\n                   phys_group_id_233605, sext_i64_i32(num_groups_214223));\n         i_233606++) {\n        int32_t virt_group_id_233607 = phys_group_id_233605 + i_233606 *\n                sext_i64_i32(num_groups_214223);\n        int64_t slice_233608 = s_n_m_203636;\n        int64_t slice_233609 = n_p_203492 * slice_233608;\n        int64_t slice_233610 = partition_sizze_203577 * slice_233609;\n        int64_t gtid_214227 = squot64(squot64(sext_i32_i64(local_tid_233597),\n                                              segment_sizze_nonzzero_233594) +\n                                      sext_i32_i64(virt_group_id_233607) *\n                                      squot64(segred_group_sizze_214222,\n          ",
            "                                    segment_sizze_nonzzero_233594),\n                                      slice_233609);\n        int64_t remnant_233611 = squot64(sext_i32_i64(local_tid_233597),\n                                         segment_sizze_nonzzero_233594) +\n                sext_i32_i64(virt_group_id_233607) *\n                squot64(segred_group_sizze_214222,\n                        segment_sizze_nonzzero_233594) - gtid_214227 *\n                slice_233609;\n        int64_t gtid_214228 = squot64(remnant_233611, slice_233608);\n        int64_t remnant_233612 = remnant_233611 - gtid_214228 * slice_233608;\n        int64_t gtid_214229 = remnant_233612;\n        int64_t remnant_233613 = remnant_233612 - gtid_214229;\n        int64_t gtid_214230 = srem64(sext_i32_i64(local_tid_233597),\n                                     q_s_203493);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_s_203493) && (((slt64(gtid_214227,\n                                                           partition_sizze_203577) &&\n                                                     slt64(gtid_214228,\n                                                           n_p_203492)) &&\n                                                    slt64(gtid_214229,\n                                                          s_n_m_203636)) &&\n                                                   slt64(sext_i32_i64(local_tid_233597),\n                                                         q_s_203493 *\n                                                         squot64(segred_group_sizze_214222,\n                                                                 segment_sizze_nonzzero_233594)))) {\n                int64_t x_214251;\n                \n                x_214251 = ((__global int64_t *) ext_mem_229264)[gtid_214227 *\n                                                                 n_p_203492 +\n                                                                 gtid_214228];",
            "\n                \n                int64_t x_214258;\n                \n                x_214258 = ((__global int64_t *) ext_mem_229363)[gtid_214227 *\n                                                                 (s_n_m_203636 *\n                                                                  n_p_203492) +\n                                                                 gtid_214228 *\n                                                                 s_n_m_203636 +\n                                                                 gtid_214229];\n                \n                double x_214259;\n                \n                x_214259 = ((__global double *) ext_mem_229362)[gtid_214227 *\n                                                                (s_n_m_203636 *\n                                                                 n_p_203492) +\n                                                                gtid_214228 *\n                                                                s_n_m_203636 +\n                                                                gtid_214229];\n                \n                double a11_214260;\n                \n                a11_214260 = ((__global double *) mem_229999)[gtid_214227 *\n                                                              (s_n_m_203636 *\n                                                               n_p_203492) +\n                                                              gtid_214228 *\n                                                              s_n_m_203636 +\n                                                              gtid_214229];\n                \n                double b11_214261;\n                \n                b11_214261 = ((__global double *) mem_230004)[gtid_214227 *\n                                                              (s_n_m_203636 *\n                                                               n_p_203492) +\n                                                              gtid_214228 *\n         ",
            "                                                     s_n_m_203636 +\n                                                              gtid_214229];\n                \n                double c11_214262;\n                \n                c11_214262 = ((__global double *) mem_230009)[gtid_214227 *\n                                                              (s_n_m_203636 *\n                                                               n_p_203492) +\n                                                              gtid_214228 *\n                                                              s_n_m_203636 +\n                                                              gtid_214229];\n                \n                int64_t defunc_0_m_fun_res_214263;\n                \n                defunc_0_m_fun_res_214263 = ((__global\n                                              int64_t *) mem_230014)[gtid_214227 *\n                                                                     (s_n_m_203636 *\n                                                                      n_p_203492) +\n                                                                     gtid_214228 *\n                                                                     s_n_m_203636 +\n                                                                     gtid_214229];\n                \n                bool cond_214265 = sle64(x_214251, gtid_214230);\n                int64_t defunc_0_f_res_214266;\n                \n                if (cond_214265) {\n                    defunc_0_f_res_214266 = (int64_t) 0;\n                } else {\n                    int64_t i_214267 = add64(gtid_214230, x_214258);\n                    int64_t defunc_0_add_arg_214268;\n                    \n                    defunc_0_add_arg_214268 = ((__global\n                                                int64_t *) ext_mem_229265)[gtid_214227 *\n                                                                           (defunc_0_f_res_203631 *\n                                 ",
            "                                           n_p_203492) +\n                                                                           gtid_214228 *\n                                                                           defunc_0_f_res_203631 +\n                                                                           i_214267];\n                    \n                    int64_t defunc_1_add_res_214269 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_214268);\n                    \n                    defunc_0_f_res_214266 = defunc_1_add_res_214269;\n                }\n                \n                double defunc_0_f_res_214270;\n                \n                if (cond_214265) {\n                    defunc_0_f_res_214270 = 0.0;\n                } else {\n                    int64_t i_214271 = add64(gtid_214230, x_214258);\n                    double defunc_0_add_arg_214272;\n                    \n                    defunc_0_add_arg_214272 = ((__global\n                                                double *) mem_229531)[gtid_214227 *\n                                                                      (defunc_0_f_res_203631 *\n                                                                       n_p_203492) +\n                                                                      gtid_214228 *\n                                                                      defunc_0_f_res_203631 +\n                                                                      i_214271];\n                    defunc_0_f_res_214270 = defunc_0_add_arg_214272;\n                }\n                \n                int64_t binop_p_214273 = sub64(defunc_0_f_res_214266,\n                                               defunc_0_m_fun_res_214263);\n                double defunc_0_f_res_214274 = sitofp_i64_f64(binop_p_214273);\n                double abs_res_214275 = fabs(defunc_0_f_res_214274);\n                double tmp1_214276 = abs_res_214275 / x_214259;\n         ",
            "       double x_214277 = tmp1_214276 * tmp1_214276;\n                double y_214278 = tmp1_214276 * x_214277;\n                double tmp2_214279 = 1.0 - y_214278;\n                double x_214280 = tmp2_214279 * tmp2_214279;\n                double tmp3_214281 = tmp2_214279 * x_214280;\n                double tmp4_214282 = defunc_0_f_res_214270 * tmp3_214281;\n                double defunc_1_f_res_214283 = defunc_0_f_res_214274 *\n                       tmp4_214282;\n                double defunc_0_f_res_214284;\n                \n                if (cond_214265) {\n                    defunc_0_f_res_214284 = 0.0;\n                } else {\n                    int64_t i_214285 = add64(gtid_214230, x_214258);\n                    double defunc_0_add_arg_214286;\n                    \n                    defunc_0_add_arg_214286 = ((__global\n                                                double *) mem_229526)[gtid_214227 *\n                                                                      (defunc_0_f_res_203631 *\n                                                                       n_p_203492) +\n                                                                      gtid_214228 *\n                                                                      defunc_0_f_res_203631 +\n                                                                      i_214285];\n                    defunc_0_f_res_214284 = defunc_0_add_arg_214286;\n                }\n                \n                double x_214287 = a11_214260 * tmp4_214282;\n                double y_214288 = b11_214261 * defunc_1_f_res_214283;\n                double x_214289 = x_214287 + y_214288;\n                double defunc_9_fit_fun_res_214290 = defunc_0_f_res_214284 *\n                       x_214289;\n                double x_214291 = b11_214261 * tmp4_214282;\n                double y_214292 = c11_214262 * defunc_1_f_res_214283;\n                double x_214293 = x_214291 + y_214292;\n                double defunc_9_slope_fun_res_214294 = d",
            "efunc_0_f_res_214284 *\n                       x_214293;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_233601)[sext_i32_i64(local_tid_233597)] =\n                        defunc_9_fit_fun_res_214290;\n                    ((__local\n                      double *) red_arr_mem_233603)[sext_i32_i64(local_tid_233597)] =\n                        defunc_9_slope_fun_res_214294;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_233601)[sext_i32_i64(local_tid_233597)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_233603)[sext_i32_i64(local_tid_233597)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_s_203493)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_214232;\n                double x_214233;\n                double x_214234;\n                double x_214235;\n                double x_233614;\n                double x_233615;\n                double x_233616;\n                double x_233617;\n                bool ltid_in_bounds_233620 =\n                     slt64(sext_i32_i64(local_tid_233597), q_s_203493 *\n                           squot64(segred_group_sizze_214222,\n                                   segment_sizze_nonzzero_233594));\n                int32_t skip_threads_233621;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_233620) {\n                        x_214234 = ((volatile __local\n                                     double *) red_arr_mem_233601)[sext_i32_i64(local_tid_233597)];\n                        x_214235 = ((volatile __local\n                                     double *) red_arr_mem_233603)[sext_i32_i64(l",
            "ocal_tid_233597)];\n                        if ((local_tid_233597 - squot32(local_tid_233597, 32) *\n                             32) == 0) {\n                            x_214232 = x_214234;\n                            x_214233 = x_214235;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_233621 = 1;\n                    while (slt32(skip_threads_233621, 32)) {\n                        bool thread_active_233622 = sle32(skip_threads_233621,\n                                                          local_tid_233597 -\n                                                          squot32(local_tid_233597,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_233620;\n                        \n                        if (thread_active_233622) {\n                            // read operands\n                            {\n                                x_214232 = ((volatile __local\n                                             double *) red_arr_mem_233601)[sext_i32_i64(local_tid_233597) -\n                                                                           sext_i32_i64(skip_threads_233621)];\n                                x_214233 = ((volatile __local\n                                             double *) red_arr_mem_233603)[sext_i32_i64(local_tid_233597) -\n                                                                           sext_i32_i64(skip_threads_233621)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_233623 =\n                                 slt64(srem64(sext_i32_i64(local_tid_233597),\n                                              q_s_203493),\n                                       sext_i32_i64(local_tid_233597) -\n                                    ",
            "   sext_i32_i64(local_tid_233597 -\n                                       skip_threads_233621));\n                            \n                            if (thread_active_233622 && inactive_233623) {\n                                x_214232 = x_214234;\n                                x_214233 = x_214235;\n                            }\n                            if (thread_active_233622) {\n                                if (!inactive_233623) {\n                                    double defunc_1_op_res_214236 = x_214232 +\n                                           x_214234;\n                                    double defunc_1_op_res_214237 = x_214233 +\n                                           x_214235;\n                                    \n                                    x_214232 = defunc_1_op_res_214236;\n                                    x_214233 = defunc_1_op_res_214237;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_233599, skip_threads_233621)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_233622) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_233601)[sext_i32_i64(local_tid_233597)] =\n                                    x_214232;\n                                x_214234 = x_214232;\n                                ((volatile __local\n                                  double *) red_arr_mem_233603)[sext_i32_i64(local_tid_233597)] =\n                                    x_214233;\n                                x_214235 = x_214233;\n                            }\n                        }\n                        if (sle32(wave_sizze_233599, skip_threads_233621)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                  ",
            "      skip_threads_233621 *= 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_233597 - squot32(local_tid_233597, 32) *\n                         32) == 31 && ltid_in_bounds_233620) {\n                        ((volatile __local\n                          double *) red_arr_mem_233601)[sext_i32_i64(squot32(local_tid_233597,\n                                                                             32))] =\n                            x_214232;\n                        ((volatile __local\n                          double *) red_arr_mem_233603)[sext_i32_i64(squot32(local_tid_233597,\n                                                                             32))] =\n                            x_214233;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n                {\n                    int32_t skip_threads_233624;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_233597, 32) == 0 &&\n                            ltid_in_bounds_233620) {\n                            x_233616 = ((volatile __local\n                                         double *) red_arr_mem_233601)[sext_i32_i64(local_tid_233597)];\n                            x_233617 = ((volatile __local\n                                         double *) red_arr_mem_233603)[sext_i32_i64(local_tid_233597)];\n                            if ((local_tid_233597 - squot32(local_tid_233597,\n                                                            32) * 32) == 0) {\n                                x_233614 = x_233616;\n                                x_233615 = x_233617;\n                            }\n                        }\n                    ",
            "}\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_233624 = 1;\n                        while (slt32(skip_threads_233624, 32)) {\n                            bool thread_active_233625 =\n                                 sle32(skip_threads_233624, local_tid_233597 -\n                                       squot32(local_tid_233597, 32) * 32) &&\n                                 (squot32(local_tid_233597, 32) == 0 &&\n                                  ltid_in_bounds_233620);\n                            \n                            if (thread_active_233625) {\n                                // read operands\n                                {\n                                    x_233614 = ((volatile __local\n                                                 double *) red_arr_mem_233601)[sext_i32_i64(local_tid_233597) -\n                                                                               sext_i32_i64(skip_threads_233624)];\n                                    x_233615 = ((volatile __local\n                                                 double *) red_arr_mem_233603)[sext_i32_i64(local_tid_233597) -\n                                                                               sext_i32_i64(skip_threads_233624)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_233626 =\n                                     slt64(srem64(sext_i32_i64(local_tid_233597 *\n                                                  32 + 32 - 1), q_s_203493),\n                                           sext_i32_i64(local_tid_233597 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_233597 -\n                                                         skip_threads_233624) *\n                                           32 + 32 ",
            "- 1));\n                                \n                                if (thread_active_233625 && inactive_233626) {\n                                    x_233614 = x_233616;\n                                    x_233615 = x_233617;\n                                }\n                                if (thread_active_233625) {\n                                    if (!inactive_233626) {\n                                        double defunc_1_op_res_233618 =\n                                               x_233614 + x_233616;\n                                        double defunc_1_op_res_233619 =\n                                               x_233615 + x_233617;\n                                        \n                                        x_233614 = defunc_1_op_res_233618;\n                                        x_233615 = defunc_1_op_res_233619;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_233599, skip_threads_233624)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_233625) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_233601)[sext_i32_i64(local_tid_233597)] =\n                                        x_233614;\n                                    x_233616 = x_233614;\n                                    ((volatile __local\n                                      double *) red_arr_mem_233603)[sext_i32_i64(local_tid_233597)] =\n                                        x_233615;\n                                    x_233617 = x_233615;\n                                }\n                            }\n                            if (sle32(wave_sizze_233599, skip_threads_233624)) {\n                                barrier(CLK_LOCAL_MEM_FE",
            "NCE);\n                            }\n                            skip_threads_233624 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_233627 = squot32(local_tid_233597, 32) == 0 ||\n                     !ltid_in_bounds_233620;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_233627) {\n                            x_214234 = x_214232;\n                            x_214235 = x_214233;\n                            x_214232 = ((__local\n                                         double *) red_arr_mem_233601)[sext_i32_i64(squot32(local_tid_233597,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_214233 = ((__local\n                                         double *) red_arr_mem_233603)[sext_i32_i64(squot32(local_tid_233597,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_233628 =\n                             slt64(srem64(sext_i32_i64(local_tid_233597),\n                                          q_s_203493),\n                                   sext_i32_i64(local_tid_233597) -\n                                   sext_i32_i64(squot32(local_tid_233597, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_233627) {\n                            if (inactive_233628) {\n                                x_214232 = x_214234;\n      ",
            "                          x_214233 = x_214235;\n                            }\n                        }\n                        if (!no_carry_in_233627) {\n                            if (!inactive_233628) {\n                                double defunc_1_op_res_214236 = x_214232 +\n                                       x_214234;\n                                double defunc_1_op_res_214237 = x_214233 +\n                                       x_214235;\n                                \n                                x_214232 = defunc_1_op_res_214236;\n                                x_214233 = defunc_1_op_res_214237;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_233627) {\n                            ((__local\n                              double *) red_arr_mem_233601)[sext_i32_i64(local_tid_233597)] =\n                                x_214232;\n                            ((__local\n                              double *) red_arr_mem_233603)[sext_i32_i64(local_tid_233597)] =\n                                x_214233;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_233597, 32) == 0 &&\n                        ltid_in_bounds_233620) {\n                        ((__local\n                          double *) red_arr_mem_233601)[sext_i32_i64(local_tid_233597)] =\n                            x_214234;\n                        ((__local\n                          double *) red_arr_mem_233603)[sext_i32_i64(local_tid_233597)] =\n                            x_214235;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // save final values of segments\n        {\n            if (",
            "slt64(sext_i32_i64(virt_group_id_233607) *\n                      squot64(segred_group_sizze_214222,\n                              segment_sizze_nonzzero_233594) +\n                      sext_i32_i64(local_tid_233597), partition_sizze_203577 *\n                      n_p_203492 * s_n_m_203636) &&\n                slt64(sext_i32_i64(local_tid_233597),\n                      squot64(segred_group_sizze_214222,\n                              segment_sizze_nonzzero_233594))) {\n                double tmp_233629;\n                \n                tmp_233629 = ((__local\n                               double *) red_arr_mem_233601)[(sext_i32_i64(local_tid_233597) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_233594 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230020)[squot64(sext_i32_i64(virt_group_id_233607) *\n                                                squot64(segred_group_sizze_214222,\n                                                        segment_sizze_nonzzero_233594) +\n                                                sext_i32_i64(local_tid_233597),\n                                                n_p_203492 * s_n_m_203636) *\n                                        (s_n_m_203636 * n_p_203492) +\n                                        squot64(sext_i32_i64(virt_group_id_233607) *\n                                                squot64(segred_group_sizze_214222,\n                                                        segment_sizze_nonzzero_233594) +\n                                                sext_i32_i64(local_tid_233597) -\n                                                squot64(sext_i32_i64(virt_group_id_233607) *\n                                                        squot64(segred_group_sizze_214222,\n                                                                se",
            "gment_sizze_nonzzero_233594) +\n                                                        sext_i32_i64(local_tid_233597),\n                                                        n_p_203492 *\n                                                        s_n_m_203636) *\n                                                (n_p_203492 * s_n_m_203636),\n                                                s_n_m_203636) * s_n_m_203636 +\n                                        (sext_i32_i64(virt_group_id_233607) *\n                                         squot64(segred_group_sizze_214222,\n                                                 segment_sizze_nonzzero_233594) +\n                                         sext_i32_i64(local_tid_233597) -\n                                         squot64(sext_i32_i64(virt_group_id_233607) *\n                                                 squot64(segred_group_sizze_214222,\n                                                         segment_sizze_nonzzero_233594) +\n                                                 sext_i32_i64(local_tid_233597),\n                                                 n_p_203492 * s_n_m_203636) *\n                                         (n_p_203492 * s_n_m_203636) -\n                                         squot64(sext_i32_i64(virt_group_id_233607) *\n                                                 squot64(segred_group_sizze_214222,\n                                                         segment_sizze_nonzzero_233594) +\n                                                 sext_i32_i64(local_tid_233597) -\n                                                 squot64(sext_i32_i64(virt_group_id_233607) *\n                                                         squot64(segred_group_sizze_214222,\n                                                                 segment_sizze_nonzzero_233594) +\n                                                         sext_i32_i64(local_tid_233597),\n                                                         n_p_203492 *",
            "\n                                                         s_n_m_203636) *\n                                                 (n_p_203492 * s_n_m_203636),\n                                                 s_n_m_203636) *\n                                         s_n_m_203636)] = tmp_233629;\n                \n                double tmp_233630;\n                \n                tmp_233630 = ((__local\n                               double *) red_arr_mem_233603)[(sext_i32_i64(local_tid_233597) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_233594 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230025)[squot64(sext_i32_i64(virt_group_id_233607) *\n                                                squot64(segred_group_sizze_214222,\n                                                        segment_sizze_nonzzero_233594) +\n                                                sext_i32_i64(local_tid_233597),\n                                                n_p_203492 * s_n_m_203636) *\n                                        (s_n_m_203636 * n_p_203492) +\n                                        squot64(sext_i32_i64(virt_group_id_233607) *\n                                                squot64(segred_group_sizze_214222,\n                                                        segment_sizze_nonzzero_233594) +\n                                                sext_i32_i64(local_tid_233597) -\n                                                squot64(sext_i32_i64(virt_group_id_233607) *\n                                                        squot64(segred_group_sizze_214222,\n                                                                segment_sizze_nonzzero_233594) +\n                                                        sext_i32_i64(local_tid_233597),\n                                               ",
            "         n_p_203492 *\n                                                        s_n_m_203636) *\n                                                (n_p_203492 * s_n_m_203636),\n                                                s_n_m_203636) * s_n_m_203636 +\n                                        (sext_i32_i64(virt_group_id_233607) *\n                                         squot64(segred_group_sizze_214222,\n                                                 segment_sizze_nonzzero_233594) +\n                                         sext_i32_i64(local_tid_233597) -\n                                         squot64(sext_i32_i64(virt_group_id_233607) *\n                                                 squot64(segred_group_sizze_214222,\n                                                         segment_sizze_nonzzero_233594) +\n                                                 sext_i32_i64(local_tid_233597),\n                                                 n_p_203492 * s_n_m_203636) *\n                                         (n_p_203492 * s_n_m_203636) -\n                                         squot64(sext_i32_i64(virt_group_id_233607) *\n                                                 squot64(segred_group_sizze_214222,\n                                                         segment_sizze_nonzzero_233594) +\n                                                 sext_i32_i64(local_tid_233597) -\n                                                 squot64(sext_i32_i64(virt_group_id_233607) *\n                                                         squot64(segred_group_sizze_214222,\n                                                                 segment_sizze_nonzzero_233594) +\n                                                         sext_i32_i64(local_tid_233597),\n                                                         n_p_203492 *\n                                                         s_n_m_203636) *\n                                                 (n_p_203492 * s_n_m_203636),\n              ",
            "                                   s_n_m_203636) *\n                                         s_n_m_203636)] = tmp_233630;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_214222\n}\n__kernel void mainzisegred_small_216784(__global int *global_failure,\n                                        uint red_arr_mem_233890_backing_offset_0,\n                                        uint red_arr_mem_233888_backing_offset_1,\n                                        uint red_arr_mem_233886_backing_offset_2,\n                                        uint red_arr_mem_233884_backing_offset_3,\n                                        uint red_arr_mem_233882_backing_offset_4,\n                                        int64_t n_p_203492, int64_t q_s_203493,\n                                        int64_t partition_sizze_203577,\n                                        int64_t defunc_0_f_res_203631,\n                                        int64_t s_n_m_203636,\n                                        int64_t num_groups_216773,\n                                        int64_t segment_sizze_nonzzero_233875,\n                                        __global unsigned char *ext_mem_229264,\n                                        __global unsigned char *ext_mem_229265,\n                                        __global unsigned char *ext_mem_229362,\n                                        __global unsigned char *ext_mem_229363,\n                                        __global unsigned char *mem_229531,\n                                        __global unsigned char *mem_230312,\n                                        __global unsigned char *mem_230322,\n                                        __global unsigned char *mem_230327,\n                                        __global unsigned char *mem_230332,\n                                        __global unsigned char *mem_2303",
            "37,\n                                        __global unsigned char *mem_230342)\n{\n    #define segred_group_sizze_216772 (mainzisegred_group_sizze_215512)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_233890_backing_4 =\n                           &shared_mem[red_arr_mem_233890_backing_offset_0];\n    volatile unsigned char *red_arr_mem_233888_backing_3 =\n                           &shared_mem[red_arr_mem_233888_backing_offset_1];\n    volatile unsigned char *red_arr_mem_233886_backing_2 =\n                           &shared_mem[red_arr_mem_233886_backing_offset_2];\n    volatile unsigned char *red_arr_mem_233884_backing_1 =\n                           &shared_mem[red_arr_mem_233884_backing_offset_3];\n    volatile unsigned char *red_arr_mem_233882_backing_0 =\n                           &shared_mem[red_arr_mem_233882_backing_offset_4];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233877;\n    int32_t local_tid_233878;\n    int64_t group_sizze_233881;\n    int32_t wave_sizze_233880;\n    int32_t group_tid_233879;\n    \n    global_tid_233877 = get_global_id(0);\n    local_tid_233878 = get_local_id(0);\n    group_sizze_233881 = get_local_size(0);\n    wave_sizze_233880 = LOCKSTEP_WIDTH;\n    group_tid_233879 = get_group_id(0);\n    \n    int32_t phys_tid_216784 = global_tid_233877;\n    __local unsigned char *red_arr_mem_233882;\n    \n    red_arr_mem_233882 = (__local unsigned char *) red_arr_mem_233882_backing_0;\n    \n    __local unsigned char *red_arr_mem_233884;\n    \n    red_arr_mem_233884 = (__local unsigned char *) red_arr_mem_233884_backing_1;\n    \n    __local unsigned char *red_arr_mem_233886;\n    \n    red_arr_mem_233886 = (__local unsigned char *) red_arr_mem_233886_backing_2;\n    \n    __local unsigned char *red_arr_mem_233888;\n    \n    red_arr_mem_233888 = (__local unsigned char *) red_arr_mem_233888_backing_3;\n    \n    __local unsigned char *red_arr_mem_23389",
            "0;\n    \n    red_arr_mem_233890 = (__local unsigned char *) red_arr_mem_233890_backing_4;\n    \n    int32_t phys_group_id_233892;\n    \n    phys_group_id_233892 = get_group_id(0);\n    for (int32_t i_233893 = 0; i_233893 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577 * n_p_203492 *\n                                          s_n_m_203636,\n                                          squot64(segred_group_sizze_216772,\n                                                  segment_sizze_nonzzero_233875))) -\n                   phys_group_id_233892, sext_i64_i32(num_groups_216773));\n         i_233893++) {\n        int32_t virt_group_id_233894 = phys_group_id_233892 + i_233893 *\n                sext_i64_i32(num_groups_216773);\n        int64_t slice_233895 = s_n_m_203636;\n        int64_t slice_233896 = n_p_203492 * slice_233895;\n        int64_t slice_233897 = partition_sizze_203577 * slice_233896;\n        int64_t gtid_216780 = squot64(squot64(sext_i32_i64(local_tid_233878),\n                                              segment_sizze_nonzzero_233875) +\n                                      sext_i32_i64(virt_group_id_233894) *\n                                      squot64(segred_group_sizze_216772,\n                                              segment_sizze_nonzzero_233875),\n                                      slice_233896);\n        int64_t remnant_233898 = squot64(sext_i32_i64(local_tid_233878),\n                                         segment_sizze_nonzzero_233875) +\n                sext_i32_i64(virt_group_id_233894) *\n                squot64(segred_group_sizze_216772,\n                        segment_sizze_nonzzero_233875) - gtid_216780 *\n                slice_233896;\n        int64_t gtid_216781 = squot64(remnant_233898, slice_233895);\n        int64_t remnant_233899 = remnant_233898 - gtid_216781 * slice_233895;\n        int64_t gtid_216782 = remnant_233899;\n        int64_t remnant_233900 = remnant_233899 - gtid_216782;\n        int64_t gtid_216783 = srem64(sext_i32_",
            "i64(local_tid_233878),\n                                     q_s_203493);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_s_203493) && (((slt64(gtid_216780,\n                                                           partition_sizze_203577) &&\n                                                     slt64(gtid_216781,\n                                                           n_p_203492)) &&\n                                                    slt64(gtid_216782,\n                                                          s_n_m_203636)) &&\n                                                   slt64(sext_i32_i64(local_tid_233878),\n                                                         q_s_203493 *\n                                                         squot64(segred_group_sizze_216772,\n                                                                 segment_sizze_nonzzero_233875)))) {\n                int64_t x_216808;\n                \n                x_216808 = ((__global int64_t *) ext_mem_229264)[gtid_216780 *\n                                                                 n_p_203492 +\n                                                                 gtid_216781];\n                \n                int64_t x_216812;\n                \n                x_216812 = ((__global int64_t *) ext_mem_229363)[gtid_216780 *\n                                                                 (s_n_m_203636 *\n                                                                  n_p_203492) +\n                                                                 gtid_216781 *\n                                                                 s_n_m_203636 +\n                                                                 gtid_216782];\n                \n                double x_216813;\n                \n                x_216813 = ((__global double *) ext_mem_229362)[gtid_216780 *\n                                                                (s_n_m_203636 *\n   ",
            "                                                              n_p_203492) +\n                                                                gtid_216781 *\n                                                                s_n_m_203636 +\n                                                                gtid_216782];\n                \n                int64_t defunc_0_m_fun_res_216814;\n                \n                defunc_0_m_fun_res_216814 = ((__global\n                                              int64_t *) mem_230312)[gtid_216780 *\n                                                                     (s_n_m_203636 *\n                                                                      n_p_203492) +\n                                                                     gtid_216781 *\n                                                                     s_n_m_203636 +\n                                                                     gtid_216782];\n                \n                bool cond_216816 = sle64(x_216808, gtid_216783);\n                int64_t defunc_0_f_res_216817;\n                \n                if (cond_216816) {\n                    defunc_0_f_res_216817 = (int64_t) 0;\n                } else {\n                    int64_t i_216818 = add64(gtid_216783, x_216812);\n                    int64_t defunc_0_add_arg_216819;\n                    \n                    defunc_0_add_arg_216819 = ((__global\n                                                int64_t *) ext_mem_229265)[gtid_216780 *\n                                                                           (defunc_0_f_res_203631 *\n                                                                            n_p_203492) +\n                                                                           gtid_216781 *\n                                                                           defunc_0_f_res_203631 +\n                                                                           i_216818];\n                    \n          ",
            "          int64_t defunc_1_add_res_216820 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_216819);\n                    \n                    defunc_0_f_res_216817 = defunc_1_add_res_216820;\n                }\n                \n                double defunc_0_f_res_216821;\n                \n                if (cond_216816) {\n                    defunc_0_f_res_216821 = 0.0;\n                } else {\n                    int64_t i_216822 = add64(gtid_216783, x_216812);\n                    double defunc_0_add_arg_216823;\n                    \n                    defunc_0_add_arg_216823 = ((__global\n                                                double *) mem_229531)[gtid_216780 *\n                                                                      (defunc_0_f_res_203631 *\n                                                                       n_p_203492) +\n                                                                      gtid_216781 *\n                                                                      defunc_0_f_res_203631 +\n                                                                      i_216822];\n                    defunc_0_f_res_216821 = defunc_0_add_arg_216823;\n                }\n                \n                int64_t binop_p_216824 = sub64(defunc_0_f_res_216817,\n                                               defunc_0_m_fun_res_216814);\n                double defunc_0_f_res_216825 = sitofp_i64_f64(binop_p_216824);\n                double abs_res_216826 = fabs(defunc_0_f_res_216825);\n                double tmp1_216827 = abs_res_216826 / x_216813;\n                double x_216828 = tmp1_216827 * tmp1_216827;\n                double y_216829 = tmp1_216827 * x_216828;\n                double tmp2_216830 = 1.0 - y_216829;\n                double x_216831 = tmp2_216830 * tmp2_216830;\n                double tmp3_216832 = tmp2_216830 * x_216831;\n                double w_j_216833 = defunc_0_f_res_216821 * tmp3_216832;\n    ",
            "            double xw_j_216834 = defunc_0_f_res_216825 * w_j_216833;\n                double x2w_j_216835 = defunc_0_f_res_216825 * xw_j_216834;\n                double x3w_j_216836 = defunc_0_f_res_216825 * x2w_j_216835;\n                double x4w_j_216837 = defunc_0_f_res_216825 * x3w_j_216836;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_233882)[sext_i32_i64(local_tid_233878)] =\n                        w_j_216833;\n                    ((__local\n                      double *) red_arr_mem_233884)[sext_i32_i64(local_tid_233878)] =\n                        xw_j_216834;\n                    ((__local\n                      double *) red_arr_mem_233886)[sext_i32_i64(local_tid_233878)] =\n                        x2w_j_216835;\n                    ((__local\n                      double *) red_arr_mem_233888)[sext_i32_i64(local_tid_233878)] =\n                        x3w_j_216836;\n                    ((__local\n                      double *) red_arr_mem_233890)[sext_i32_i64(local_tid_233878)] =\n                        x4w_j_216837;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_233882)[sext_i32_i64(local_tid_233878)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_233884)[sext_i32_i64(local_tid_233878)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_233886)[sext_i32_i64(local_tid_233878)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_233888)[sext_i32_i64(local_tid_233878)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_233890)[sext_i32_i64(local_tid_233878)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0,",
            " q_s_203493)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_216785;\n                double x_216786;\n                double x_216787;\n                double x_216788;\n                double x_216789;\n                double x_216790;\n                double x_216791;\n                double x_216792;\n                double x_216793;\n                double x_216794;\n                double x_233901;\n                double x_233902;\n                double x_233903;\n                double x_233904;\n                double x_233905;\n                double x_233906;\n                double x_233907;\n                double x_233908;\n                double x_233909;\n                double x_233910;\n                bool ltid_in_bounds_233916 =\n                     slt64(sext_i32_i64(local_tid_233878), q_s_203493 *\n                           squot64(segred_group_sizze_216772,\n                                   segment_sizze_nonzzero_233875));\n                int32_t skip_threads_233917;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_233916) {\n                        x_216790 = ((volatile __local\n                                     double *) red_arr_mem_233882)[sext_i32_i64(local_tid_233878)];\n                        x_216791 = ((volatile __local\n                                     double *) red_arr_mem_233884)[sext_i32_i64(local_tid_233878)];\n                        x_216792 = ((volatile __local\n                                     double *) red_arr_mem_233886)[sext_i32_i64(local_tid_233878)];\n                        x_216793 = ((volatile __local\n                                     double *) red_arr_mem_233888)[sext_i32_i64(local_tid_233878)];\n                        x_216794 = ((volatile __local\n                                     double *) red_arr_mem_233890)[sext_i32_i64(local_tid_233878)];\n                        if ((local_tid_233878 - squot32(l",
            "ocal_tid_233878, 32) *\n                             32) == 0) {\n                            x_216785 = x_216790;\n                            x_216786 = x_216791;\n                            x_216787 = x_216792;\n                            x_216788 = x_216793;\n                            x_216789 = x_216794;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_233917 = 1;\n                    while (slt32(skip_threads_233917, 32)) {\n                        bool thread_active_233918 = sle32(skip_threads_233917,\n                                                          local_tid_233878 -\n                                                          squot32(local_tid_233878,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_233916;\n                        \n                        if (thread_active_233918) {\n                            // read operands\n                            {\n                                x_216785 = ((volatile __local\n                                             double *) red_arr_mem_233882)[sext_i32_i64(local_tid_233878) -\n                                                                           sext_i32_i64(skip_threads_233917)];\n                                x_216786 = ((volatile __local\n                                             double *) red_arr_mem_233884)[sext_i32_i64(local_tid_233878) -\n                                                                           sext_i32_i64(skip_threads_233917)];\n                                x_216787 = ((volatile __local\n                                             double *) red_arr_mem_233886)[sext_i32_i64(local_tid_233878) -\n                                                                           sext_i32_i64(skip_threads_233917)];\n                                x_216788 = ((volatile __local\n         ",
            "                                    double *) red_arr_mem_233888)[sext_i32_i64(local_tid_233878) -\n                                                                           sext_i32_i64(skip_threads_233917)];\n                                x_216789 = ((volatile __local\n                                             double *) red_arr_mem_233890)[sext_i32_i64(local_tid_233878) -\n                                                                           sext_i32_i64(skip_threads_233917)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_233919 =\n                                 slt64(srem64(sext_i32_i64(local_tid_233878),\n                                              q_s_203493),\n                                       sext_i32_i64(local_tid_233878) -\n                                       sext_i32_i64(local_tid_233878 -\n                                       skip_threads_233917));\n                            \n                            if (thread_active_233918 && inactive_233919) {\n                                x_216785 = x_216790;\n                                x_216786 = x_216791;\n                                x_216787 = x_216792;\n                                x_216788 = x_216793;\n                                x_216789 = x_216794;\n                            }\n                            if (thread_active_233918) {\n                                if (!inactive_233919) {\n                                    double defunc_1_op_res_216795 = x_216785 +\n                                           x_216790;\n                                    double defunc_1_op_res_216796 = x_216786 +\n                                           x_216791;\n                                    double defunc_1_op_res_216797 = x_216787 +\n                                           x_216792;\n                                    double defunc_1_op_res_216798 = x_216788 +\n   ",
            "                                        x_216793;\n                                    double defunc_1_op_res_216799 = x_216789 +\n                                           x_216794;\n                                    \n                                    x_216785 = defunc_1_op_res_216795;\n                                    x_216786 = defunc_1_op_res_216796;\n                                    x_216787 = defunc_1_op_res_216797;\n                                    x_216788 = defunc_1_op_res_216798;\n                                    x_216789 = defunc_1_op_res_216799;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_233880, skip_threads_233917)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_233918) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_233882)[sext_i32_i64(local_tid_233878)] =\n                                    x_216785;\n                                x_216790 = x_216785;\n                                ((volatile __local\n                                  double *) red_arr_mem_233884)[sext_i32_i64(local_tid_233878)] =\n                                    x_216786;\n                                x_216791 = x_216786;\n                                ((volatile __local\n                                  double *) red_arr_mem_233886)[sext_i32_i64(local_tid_233878)] =\n                                    x_216787;\n                                x_216792 = x_216787;\n                                ((volatile __local\n                                  double *) red_arr_mem_233888)[sext_i32_i64(local_tid_233878)] =\n                                    x_216788;\n                                x_216793 = x_216788;\n                                ((volatile __local\n      ",
            "                            double *) red_arr_mem_233890)[sext_i32_i64(local_tid_233878)] =\n                                    x_216789;\n                                x_216794 = x_216789;\n                            }\n                        }\n                        if (sle32(wave_sizze_233880, skip_threads_233917)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_233917 *= 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_233878 - squot32(local_tid_233878, 32) *\n                         32) == 31 && ltid_in_bounds_233916) {\n                        ((volatile __local\n                          double *) red_arr_mem_233882)[sext_i32_i64(squot32(local_tid_233878,\n                                                                             32))] =\n                            x_216785;\n                        ((volatile __local\n                          double *) red_arr_mem_233884)[sext_i32_i64(squot32(local_tid_233878,\n                                                                             32))] =\n                            x_216786;\n                        ((volatile __local\n                          double *) red_arr_mem_233886)[sext_i32_i64(squot32(local_tid_233878,\n                                                                             32))] =\n                            x_216787;\n                        ((volatile __local\n                          double *) red_arr_mem_233888)[sext_i32_i64(squot32(local_tid_233878,\n                                                                             32))] =\n                            x_216788;\n                        ((volatile __local\n                          double *) red_arr_mem_233890)[sext_i32_i64(squot32(local_tid_233878,\n                                         ",
            "                                    32))] =\n                            x_216789;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n                {\n                    int32_t skip_threads_233920;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_233878, 32) == 0 &&\n                            ltid_in_bounds_233916) {\n                            x_233906 = ((volatile __local\n                                         double *) red_arr_mem_233882)[sext_i32_i64(local_tid_233878)];\n                            x_233907 = ((volatile __local\n                                         double *) red_arr_mem_233884)[sext_i32_i64(local_tid_233878)];\n                            x_233908 = ((volatile __local\n                                         double *) red_arr_mem_233886)[sext_i32_i64(local_tid_233878)];\n                            x_233909 = ((volatile __local\n                                         double *) red_arr_mem_233888)[sext_i32_i64(local_tid_233878)];\n                            x_233910 = ((volatile __local\n                                         double *) red_arr_mem_233890)[sext_i32_i64(local_tid_233878)];\n                            if ((local_tid_233878 - squot32(local_tid_233878,\n                                                            32) * 32) == 0) {\n                                x_233901 = x_233906;\n                                x_233902 = x_233907;\n                                x_233903 = x_233908;\n                                x_233904 = x_233909;\n                                x_233905 = x_233910;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_233920 = 1;\n     ",
            "                   while (slt32(skip_threads_233920, 32)) {\n                            bool thread_active_233921 =\n                                 sle32(skip_threads_233920, local_tid_233878 -\n                                       squot32(local_tid_233878, 32) * 32) &&\n                                 (squot32(local_tid_233878, 32) == 0 &&\n                                  ltid_in_bounds_233916);\n                            \n                            if (thread_active_233921) {\n                                // read operands\n                                {\n                                    x_233901 = ((volatile __local\n                                                 double *) red_arr_mem_233882)[sext_i32_i64(local_tid_233878) -\n                                                                               sext_i32_i64(skip_threads_233920)];\n                                    x_233902 = ((volatile __local\n                                                 double *) red_arr_mem_233884)[sext_i32_i64(local_tid_233878) -\n                                                                               sext_i32_i64(skip_threads_233920)];\n                                    x_233903 = ((volatile __local\n                                                 double *) red_arr_mem_233886)[sext_i32_i64(local_tid_233878) -\n                                                                               sext_i32_i64(skip_threads_233920)];\n                                    x_233904 = ((volatile __local\n                                                 double *) red_arr_mem_233888)[sext_i32_i64(local_tid_233878) -\n                                                                               sext_i32_i64(skip_threads_233920)];\n                                    x_233905 = ((volatile __local\n                                                 double *) red_arr_mem_233890)[sext_i32_i64(local_tid_233878) -\n                                                                               ",
            "sext_i32_i64(skip_threads_233920)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_233922 =\n                                     slt64(srem64(sext_i32_i64(local_tid_233878 *\n                                                  32 + 32 - 1), q_s_203493),\n                                           sext_i32_i64(local_tid_233878 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_233878 -\n                                                         skip_threads_233920) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_233921 && inactive_233922) {\n                                    x_233901 = x_233906;\n                                    x_233902 = x_233907;\n                                    x_233903 = x_233908;\n                                    x_233904 = x_233909;\n                                    x_233905 = x_233910;\n                                }\n                                if (thread_active_233921) {\n                                    if (!inactive_233922) {\n                                        double defunc_1_op_res_233911 =\n                                               x_233901 + x_233906;\n                                        double defunc_1_op_res_233912 =\n                                               x_233902 + x_233907;\n                                        double defunc_1_op_res_233913 =\n                                               x_233903 + x_233908;\n                                        double defunc_1_op_res_233914 =\n                                               x_233904 + x_233909;\n                                        double defunc_1_op_res_233915 =\n                                               x_233905 + x_233910;\n         ",
            "                               \n                                        x_233901 = defunc_1_op_res_233911;\n                                        x_233902 = defunc_1_op_res_233912;\n                                        x_233903 = defunc_1_op_res_233913;\n                                        x_233904 = defunc_1_op_res_233914;\n                                        x_233905 = defunc_1_op_res_233915;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_233880, skip_threads_233920)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_233921) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_233882)[sext_i32_i64(local_tid_233878)] =\n                                        x_233901;\n                                    x_233906 = x_233901;\n                                    ((volatile __local\n                                      double *) red_arr_mem_233884)[sext_i32_i64(local_tid_233878)] =\n                                        x_233902;\n                                    x_233907 = x_233902;\n                                    ((volatile __local\n                                      double *) red_arr_mem_233886)[sext_i32_i64(local_tid_233878)] =\n                                        x_233903;\n                                    x_233908 = x_233903;\n                                    ((volatile __local\n                                      double *) red_arr_mem_233888)[sext_i32_i64(local_tid_233878)] =\n                                        x_233904;\n                                    x_233909 = x_233904;\n                                    ((volatile __local\n                                      double *) red_arr_mem_233890)[s",
            "ext_i32_i64(local_tid_233878)] =\n                                        x_233905;\n                                    x_233910 = x_233905;\n                                }\n                            }\n                            if (sle32(wave_sizze_233880, skip_threads_233920)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_233920 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_233923 = squot32(local_tid_233878, 32) == 0 ||\n                     !ltid_in_bounds_233916;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_233923) {\n                            x_216790 = x_216785;\n                            x_216791 = x_216786;\n                            x_216792 = x_216787;\n                            x_216793 = x_216788;\n                            x_216794 = x_216789;\n                            x_216785 = ((__local\n                                         double *) red_arr_mem_233882)[sext_i32_i64(squot32(local_tid_233878,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_216786 = ((__local\n                                         double *) red_arr_mem_233884)[sext_i32_i64(squot32(local_tid_233878,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_216787 = ((__local\n                                         double *) red_arr_mem_233886)[sext_i32_i64(squot32(local_tid_233878,\n                   ",
            "                                                                         32)) -\n                                                                       (int64_t) 1];\n                            x_216788 = ((__local\n                                         double *) red_arr_mem_233888)[sext_i32_i64(squot32(local_tid_233878,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_216789 = ((__local\n                                         double *) red_arr_mem_233890)[sext_i32_i64(squot32(local_tid_233878,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_233924 =\n                             slt64(srem64(sext_i32_i64(local_tid_233878),\n                                          q_s_203493),\n                                   sext_i32_i64(local_tid_233878) -\n                                   sext_i32_i64(squot32(local_tid_233878, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_233923) {\n                            if (inactive_233924) {\n                                x_216785 = x_216790;\n                                x_216786 = x_216791;\n                                x_216787 = x_216792;\n                                x_216788 = x_216793;\n                                x_216789 = x_216794;\n                            }\n                        }\n                        if (!no_carry_in_233923) {\n                            if (!inactive_233924) {\n                                double defunc_1_op_res_216795 = x_216785 +\n                                       x_21",
            "6790;\n                                double defunc_1_op_res_216796 = x_216786 +\n                                       x_216791;\n                                double defunc_1_op_res_216797 = x_216787 +\n                                       x_216792;\n                                double defunc_1_op_res_216798 = x_216788 +\n                                       x_216793;\n                                double defunc_1_op_res_216799 = x_216789 +\n                                       x_216794;\n                                \n                                x_216785 = defunc_1_op_res_216795;\n                                x_216786 = defunc_1_op_res_216796;\n                                x_216787 = defunc_1_op_res_216797;\n                                x_216788 = defunc_1_op_res_216798;\n                                x_216789 = defunc_1_op_res_216799;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_233923) {\n                            ((__local\n                              double *) red_arr_mem_233882)[sext_i32_i64(local_tid_233878)] =\n                                x_216785;\n                            ((__local\n                              double *) red_arr_mem_233884)[sext_i32_i64(local_tid_233878)] =\n                                x_216786;\n                            ((__local\n                              double *) red_arr_mem_233886)[sext_i32_i64(local_tid_233878)] =\n                                x_216787;\n                            ((__local\n                              double *) red_arr_mem_233888)[sext_i32_i64(local_tid_233878)] =\n                                x_216788;\n                            ((__local\n                              double *) red_arr_mem_233890)[sext_i32_i64(local_tid_233878)] =\n                                x_216789;\n                        }\n                    }\n                }\n ",
            "               barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_233878, 32) == 0 &&\n                        ltid_in_bounds_233916) {\n                        ((__local\n                          double *) red_arr_mem_233882)[sext_i32_i64(local_tid_233878)] =\n                            x_216790;\n                        ((__local\n                          double *) red_arr_mem_233884)[sext_i32_i64(local_tid_233878)] =\n                            x_216791;\n                        ((__local\n                          double *) red_arr_mem_233886)[sext_i32_i64(local_tid_233878)] =\n                            x_216792;\n                        ((__local\n                          double *) red_arr_mem_233888)[sext_i32_i64(local_tid_233878)] =\n                            x_216793;\n                        ((__local\n                          double *) red_arr_mem_233890)[sext_i32_i64(local_tid_233878)] =\n                            x_216794;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // save final values of segments\n        {\n            if (slt64(sext_i32_i64(virt_group_id_233894) *\n                      squot64(segred_group_sizze_216772,\n                              segment_sizze_nonzzero_233875) +\n                      sext_i32_i64(local_tid_233878), partition_sizze_203577 *\n                      n_p_203492 * s_n_m_203636) &&\n                slt64(sext_i32_i64(local_tid_233878),\n                      squot64(segred_group_sizze_216772,\n                              segment_sizze_nonzzero_233875))) {\n                double tmp_233925;\n                \n                tmp_233925 = ((__local\n                               double *) red_arr_mem_233882)[(sext_i32_i64(local_tid_233878) +\n                                                              (int64_t) 1) *\n          ",
            "                                                   segment_sizze_nonzzero_233875 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230322)[squot64(sext_i32_i64(virt_group_id_233894) *\n                                                squot64(segred_group_sizze_216772,\n                                                        segment_sizze_nonzzero_233875) +\n                                                sext_i32_i64(local_tid_233878),\n                                                n_p_203492 * s_n_m_203636) *\n                                        (s_n_m_203636 * n_p_203492) +\n                                        squot64(sext_i32_i64(virt_group_id_233894) *\n                                                squot64(segred_group_sizze_216772,\n                                                        segment_sizze_nonzzero_233875) +\n                                                sext_i32_i64(local_tid_233878) -\n                                                squot64(sext_i32_i64(virt_group_id_233894) *\n                                                        squot64(segred_group_sizze_216772,\n                                                                segment_sizze_nonzzero_233875) +\n                                                        sext_i32_i64(local_tid_233878),\n                                                        n_p_203492 *\n                                                        s_n_m_203636) *\n                                                (n_p_203492 * s_n_m_203636),\n                                                s_n_m_203636) * s_n_m_203636 +\n                                        (sext_i32_i64(virt_group_id_233894) *\n                                         squot64(segred_group_sizze_216772,\n                                                 segment_sizze_nonzzero_233875) +\n                                         sext_i32_i64(local_tid_233878) -\n                 ",
            "                        squot64(sext_i32_i64(virt_group_id_233894) *\n                                                 squot64(segred_group_sizze_216772,\n                                                         segment_sizze_nonzzero_233875) +\n                                                 sext_i32_i64(local_tid_233878),\n                                                 n_p_203492 * s_n_m_203636) *\n                                         (n_p_203492 * s_n_m_203636) -\n                                         squot64(sext_i32_i64(virt_group_id_233894) *\n                                                 squot64(segred_group_sizze_216772,\n                                                         segment_sizze_nonzzero_233875) +\n                                                 sext_i32_i64(local_tid_233878) -\n                                                 squot64(sext_i32_i64(virt_group_id_233894) *\n                                                         squot64(segred_group_sizze_216772,\n                                                                 segment_sizze_nonzzero_233875) +\n                                                         sext_i32_i64(local_tid_233878),\n                                                         n_p_203492 *\n                                                         s_n_m_203636) *\n                                                 (n_p_203492 * s_n_m_203636),\n                                                 s_n_m_203636) *\n                                         s_n_m_203636)] = tmp_233925;\n                \n                double tmp_233926;\n                \n                tmp_233926 = ((__local\n                               double *) red_arr_mem_233884)[(sext_i32_i64(local_tid_233878) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_233875 -\n                                                             (int64_t) 1];\n        ",
            "        ((__global\n                  double *) mem_230327)[squot64(sext_i32_i64(virt_group_id_233894) *\n                                                squot64(segred_group_sizze_216772,\n                                                        segment_sizze_nonzzero_233875) +\n                                                sext_i32_i64(local_tid_233878),\n                                                n_p_203492 * s_n_m_203636) *\n                                        (s_n_m_203636 * n_p_203492) +\n                                        squot64(sext_i32_i64(virt_group_id_233894) *\n                                                squot64(segred_group_sizze_216772,\n                                                        segment_sizze_nonzzero_233875) +\n                                                sext_i32_i64(local_tid_233878) -\n                                                squot64(sext_i32_i64(virt_group_id_233894) *\n                                                        squot64(segred_group_sizze_216772,\n                                                                segment_sizze_nonzzero_233875) +\n                                                        sext_i32_i64(local_tid_233878),\n                                                        n_p_203492 *\n                                                        s_n_m_203636) *\n                                                (n_p_203492 * s_n_m_203636),\n                                                s_n_m_203636) * s_n_m_203636 +\n                                        (sext_i32_i64(virt_group_id_233894) *\n                                         squot64(segred_group_sizze_216772,\n                                                 segment_sizze_nonzzero_233875) +\n                                         sext_i32_i64(local_tid_233878) -\n                                         squot64(sext_i32_i64(virt_group_id_233894) *\n                                                 squot64(segred_group_sizze_216772,\n             ",
            "                                            segment_sizze_nonzzero_233875) +\n                                                 sext_i32_i64(local_tid_233878),\n                                                 n_p_203492 * s_n_m_203636) *\n                                         (n_p_203492 * s_n_m_203636) -\n                                         squot64(sext_i32_i64(virt_group_id_233894) *\n                                                 squot64(segred_group_sizze_216772,\n                                                         segment_sizze_nonzzero_233875) +\n                                                 sext_i32_i64(local_tid_233878) -\n                                                 squot64(sext_i32_i64(virt_group_id_233894) *\n                                                         squot64(segred_group_sizze_216772,\n                                                                 segment_sizze_nonzzero_233875) +\n                                                         sext_i32_i64(local_tid_233878),\n                                                         n_p_203492 *\n                                                         s_n_m_203636) *\n                                                 (n_p_203492 * s_n_m_203636),\n                                                 s_n_m_203636) *\n                                         s_n_m_203636)] = tmp_233926;\n                \n                double tmp_233927;\n                \n                tmp_233927 = ((__local\n                               double *) red_arr_mem_233886)[(sext_i32_i64(local_tid_233878) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_233875 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230332)[squot64(sext_i32_i64(virt_group_id_233894) *\n                                                squot64(segred",
            "_group_sizze_216772,\n                                                        segment_sizze_nonzzero_233875) +\n                                                sext_i32_i64(local_tid_233878),\n                                                n_p_203492 * s_n_m_203636) *\n                                        (s_n_m_203636 * n_p_203492) +\n                                        squot64(sext_i32_i64(virt_group_id_233894) *\n                                                squot64(segred_group_sizze_216772,\n                                                        segment_sizze_nonzzero_233875) +\n                                                sext_i32_i64(local_tid_233878) -\n                                                squot64(sext_i32_i64(virt_group_id_233894) *\n                                                        squot64(segred_group_sizze_216772,\n                                                                segment_sizze_nonzzero_233875) +\n                                                        sext_i32_i64(local_tid_233878),\n                                                        n_p_203492 *\n                                                        s_n_m_203636) *\n                                                (n_p_203492 * s_n_m_203636),\n                                                s_n_m_203636) * s_n_m_203636 +\n                                        (sext_i32_i64(virt_group_id_233894) *\n                                         squot64(segred_group_sizze_216772,\n                                                 segment_sizze_nonzzero_233875) +\n                                         sext_i32_i64(local_tid_233878) -\n                                         squot64(sext_i32_i64(virt_group_id_233894) *\n                                                 squot64(segred_group_sizze_216772,\n                                                         segment_sizze_nonzzero_233875) +\n                                                 sext_i32_i64(local_tid_233878),\n        ",
            "                                         n_p_203492 * s_n_m_203636) *\n                                         (n_p_203492 * s_n_m_203636) -\n                                         squot64(sext_i32_i64(virt_group_id_233894) *\n                                                 squot64(segred_group_sizze_216772,\n                                                         segment_sizze_nonzzero_233875) +\n                                                 sext_i32_i64(local_tid_233878) -\n                                                 squot64(sext_i32_i64(virt_group_id_233894) *\n                                                         squot64(segred_group_sizze_216772,\n                                                                 segment_sizze_nonzzero_233875) +\n                                                         sext_i32_i64(local_tid_233878),\n                                                         n_p_203492 *\n                                                         s_n_m_203636) *\n                                                 (n_p_203492 * s_n_m_203636),\n                                                 s_n_m_203636) *\n                                         s_n_m_203636)] = tmp_233927;\n                \n                double tmp_233928;\n                \n                tmp_233928 = ((__local\n                               double *) red_arr_mem_233888)[(sext_i32_i64(local_tid_233878) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_233875 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230337)[squot64(sext_i32_i64(virt_group_id_233894) *\n                                                squot64(segred_group_sizze_216772,\n                                                        segment_sizze_nonzzero_233875) +\n                                                sext_i32",
            "_i64(local_tid_233878),\n                                                n_p_203492 * s_n_m_203636) *\n                                        (s_n_m_203636 * n_p_203492) +\n                                        squot64(sext_i32_i64(virt_group_id_233894) *\n                                                squot64(segred_group_sizze_216772,\n                                                        segment_sizze_nonzzero_233875) +\n                                                sext_i32_i64(local_tid_233878) -\n                                                squot64(sext_i32_i64(virt_group_id_233894) *\n                                                        squot64(segred_group_sizze_216772,\n                                                                segment_sizze_nonzzero_233875) +\n                                                        sext_i32_i64(local_tid_233878),\n                                                        n_p_203492 *\n                                                        s_n_m_203636) *\n                                                (n_p_203492 * s_n_m_203636),\n                                                s_n_m_203636) * s_n_m_203636 +\n                                        (sext_i32_i64(virt_group_id_233894) *\n                                         squot64(segred_group_sizze_216772,\n                                                 segment_sizze_nonzzero_233875) +\n                                         sext_i32_i64(local_tid_233878) -\n                                         squot64(sext_i32_i64(virt_group_id_233894) *\n                                                 squot64(segred_group_sizze_216772,\n                                                         segment_sizze_nonzzero_233875) +\n                                                 sext_i32_i64(local_tid_233878),\n                                                 n_p_203492 * s_n_m_203636) *\n                                         (n_p_203492 * s_n_m_203636) -\n                         ",
            "                squot64(sext_i32_i64(virt_group_id_233894) *\n                                                 squot64(segred_group_sizze_216772,\n                                                         segment_sizze_nonzzero_233875) +\n                                                 sext_i32_i64(local_tid_233878) -\n                                                 squot64(sext_i32_i64(virt_group_id_233894) *\n                                                         squot64(segred_group_sizze_216772,\n                                                                 segment_sizze_nonzzero_233875) +\n                                                         sext_i32_i64(local_tid_233878),\n                                                         n_p_203492 *\n                                                         s_n_m_203636) *\n                                                 (n_p_203492 * s_n_m_203636),\n                                                 s_n_m_203636) *\n                                         s_n_m_203636)] = tmp_233928;\n                \n                double tmp_233929;\n                \n                tmp_233929 = ((__local\n                               double *) red_arr_mem_233890)[(sext_i32_i64(local_tid_233878) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_233875 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230342)[squot64(sext_i32_i64(virt_group_id_233894) *\n                                                squot64(segred_group_sizze_216772,\n                                                        segment_sizze_nonzzero_233875) +\n                                                sext_i32_i64(local_tid_233878),\n                                                n_p_203492 * s_n_m_203636) *\n                                        (s_n_m_203636 * n_p_20349",
            "2) +\n                                        squot64(sext_i32_i64(virt_group_id_233894) *\n                                                squot64(segred_group_sizze_216772,\n                                                        segment_sizze_nonzzero_233875) +\n                                                sext_i32_i64(local_tid_233878) -\n                                                squot64(sext_i32_i64(virt_group_id_233894) *\n                                                        squot64(segred_group_sizze_216772,\n                                                                segment_sizze_nonzzero_233875) +\n                                                        sext_i32_i64(local_tid_233878),\n                                                        n_p_203492 *\n                                                        s_n_m_203636) *\n                                                (n_p_203492 * s_n_m_203636),\n                                                s_n_m_203636) * s_n_m_203636 +\n                                        (sext_i32_i64(virt_group_id_233894) *\n                                         squot64(segred_group_sizze_216772,\n                                                 segment_sizze_nonzzero_233875) +\n                                         sext_i32_i64(local_tid_233878) -\n                                         squot64(sext_i32_i64(virt_group_id_233894) *\n                                                 squot64(segred_group_sizze_216772,\n                                                         segment_sizze_nonzzero_233875) +\n                                                 sext_i32_i64(local_tid_233878),\n                                                 n_p_203492 * s_n_m_203636) *\n                                         (n_p_203492 * s_n_m_203636) -\n                                         squot64(sext_i32_i64(virt_group_id_233894) *\n                                                 squot64(segred_group_sizze_216772,\n                     ",
            "                                    segment_sizze_nonzzero_233875) +\n                                                 sext_i32_i64(local_tid_233878) -\n                                                 squot64(sext_i32_i64(virt_group_id_233894) *\n                                                         squot64(segred_group_sizze_216772,\n                                                                 segment_sizze_nonzzero_233875) +\n                                                         sext_i32_i64(local_tid_233878),\n                                                         n_p_203492 *\n                                                         s_n_m_203636) *\n                                                 (n_p_203492 * s_n_m_203636),\n                                                 s_n_m_203636) *\n                                         s_n_m_203636)] = tmp_233929;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_216772\n}\n__kernel void mainzisegred_small_216907(__global int *global_failure,\n                                        uint red_arr_mem_234028_backing_offset_0,\n                                        uint red_arr_mem_234026_backing_offset_1,\n                                        int64_t n_p_203492, int64_t q_s_203493,\n                                        int64_t partition_sizze_203577,\n                                        int64_t defunc_0_f_res_203631,\n                                        int64_t s_n_m_203636,\n                                        int64_t num_groups_216899,\n                                        int64_t segment_sizze_nonzzero_234019,\n                                        __global unsigned char *ext_mem_229264,\n                                        __global unsigned char *ext_mem_229265,\n                                        __global unsigned char *ext_mem_229362,\n                   ",
            "                     __global unsigned char *ext_mem_229363,\n                                        __global unsigned char *mem_229526,\n                                        __global unsigned char *mem_229531,\n                                        __global unsigned char *mem_230348,\n                                        __global unsigned char *mem_230353,\n                                        __global unsigned char *mem_230358,\n                                        __global unsigned char *mem_230363,\n                                        __global unsigned char *mem_230368,\n                                        __global unsigned char *mem_230373,\n                                        __global unsigned char *mem_230379,\n                                        __global unsigned char *mem_230384)\n{\n    #define segred_group_sizze_216898 (mainzisegred_group_sizze_215343)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_234028_backing_1 =\n                           &shared_mem[red_arr_mem_234028_backing_offset_0];\n    volatile unsigned char *red_arr_mem_234026_backing_0 =\n                           &shared_mem[red_arr_mem_234026_backing_offset_1];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234021;\n    int32_t local_tid_234022;\n    int64_t group_sizze_234025;\n    int32_t wave_sizze_234024;\n    int32_t group_tid_234023;\n    \n    global_tid_234021 = get_global_id(0);\n    local_tid_234022 = get_local_id(0);\n    group_sizze_234025 = get_local_size(0);\n    wave_sizze_234024 = LOCKSTEP_WIDTH;\n    group_tid_234023 = get_group_id(0);\n    \n    int32_t phys_tid_216907 = global_tid_234021;\n    __local unsigned char *red_arr_mem_234026;\n    \n    red_arr_mem_234026 = (__local unsigned char *) red_arr_mem_234026_backing_0;\n    \n    __local unsigned char *red_arr_mem_234028;\n    \n    red_arr_mem_234028 = (__local unsigned char *) red_arr_mem_234028_bac",
            "king_1;\n    \n    int32_t phys_group_id_234030;\n    \n    phys_group_id_234030 = get_group_id(0);\n    for (int32_t i_234031 = 0; i_234031 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577 * n_p_203492 *\n                                          s_n_m_203636,\n                                          squot64(segred_group_sizze_216898,\n                                                  segment_sizze_nonzzero_234019))) -\n                   phys_group_id_234030, sext_i64_i32(num_groups_216899));\n         i_234031++) {\n        int32_t virt_group_id_234032 = phys_group_id_234030 + i_234031 *\n                sext_i64_i32(num_groups_216899);\n        int64_t slice_234033 = s_n_m_203636;\n        int64_t slice_234034 = n_p_203492 * slice_234033;\n        int64_t slice_234035 = partition_sizze_203577 * slice_234034;\n        int64_t gtid_216903 = squot64(squot64(sext_i32_i64(local_tid_234022),\n                                              segment_sizze_nonzzero_234019) +\n                                      sext_i32_i64(virt_group_id_234032) *\n                                      squot64(segred_group_sizze_216898,\n                                              segment_sizze_nonzzero_234019),\n                                      slice_234034);\n        int64_t remnant_234036 = squot64(sext_i32_i64(local_tid_234022),\n                                         segment_sizze_nonzzero_234019) +\n                sext_i32_i64(virt_group_id_234032) *\n                squot64(segred_group_sizze_216898,\n                        segment_sizze_nonzzero_234019) - gtid_216903 *\n                slice_234034;\n        int64_t gtid_216904 = squot64(remnant_234036, slice_234033);\n        int64_t remnant_234037 = remnant_234036 - gtid_216904 * slice_234033;\n        int64_t gtid_216905 = remnant_234037;\n        int64_t remnant_234038 = remnant_234037 - gtid_216905;\n        int64_t gtid_216906 = srem64(sext_i32_i64(local_tid_234022),\n                                     q_s_203493);\n        ",
            "\n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_s_203493) && (((slt64(gtid_216903,\n                                                           partition_sizze_203577) &&\n                                                     slt64(gtid_216904,\n                                                           n_p_203492)) &&\n                                                    slt64(gtid_216905,\n                                                          s_n_m_203636)) &&\n                                                   slt64(sext_i32_i64(local_tid_234022),\n                                                         q_s_203493 *\n                                                         squot64(segred_group_sizze_216898,\n                                                                 segment_sizze_nonzzero_234019)))) {\n                int64_t x_216929;\n                \n                x_216929 = ((__global int64_t *) ext_mem_229264)[gtid_216903 *\n                                                                 n_p_203492 +\n                                                                 gtid_216904];\n                \n                int64_t x_216938;\n                \n                x_216938 = ((__global int64_t *) ext_mem_229363)[gtid_216903 *\n                                                                 (s_n_m_203636 *\n                                                                  n_p_203492) +\n                                                                 gtid_216904 *\n                                                                 s_n_m_203636 +\n                                                                 gtid_216905];\n                \n                double x_216939;\n                \n                x_216939 = ((__global double *) ext_mem_229362)[gtid_216903 *\n                                                                (s_n_m_203636 *\n                                                                 n_p_203492) +\n     ",
            "                                                           gtid_216904 *\n                                                                s_n_m_203636 +\n                                                                gtid_216905];\n                \n                double a12_216940;\n                \n                a12_216940 = ((__global double *) mem_230348)[gtid_216903 *\n                                                              (s_n_m_203636 *\n                                                               n_p_203492) +\n                                                              gtid_216904 *\n                                                              s_n_m_203636 +\n                                                              gtid_216905];\n                \n                double b12_216941;\n                \n                b12_216941 = ((__global double *) mem_230353)[gtid_216903 *\n                                                              (s_n_m_203636 *\n                                                               n_p_203492) +\n                                                              gtid_216904 *\n                                                              s_n_m_203636 +\n                                                              gtid_216905];\n                \n                double c12_216942;\n                \n                c12_216942 = ((__global double *) mem_230358)[gtid_216903 *\n                                                              (s_n_m_203636 *\n                                                               n_p_203492) +\n                                                              gtid_216904 *\n                                                              s_n_m_203636 +\n                                                              gtid_216905];\n                \n                double b2_216943;\n                \n                b2_216943 = ((__global double *) mem_230363)[gtid_216903 *\n                                        ",
            "                     (s_n_m_203636 *\n                                                              n_p_203492) +\n                                                             gtid_216904 *\n                                                             s_n_m_203636 +\n                                                             gtid_216905];\n                \n                double c2_216944;\n                \n                c2_216944 = ((__global double *) mem_230368)[gtid_216903 *\n                                                             (s_n_m_203636 *\n                                                              n_p_203492) +\n                                                             gtid_216904 *\n                                                             s_n_m_203636 +\n                                                             gtid_216905];\n                \n                int64_t defunc_0_m_fun_res_216945;\n                \n                defunc_0_m_fun_res_216945 = ((__global\n                                              int64_t *) mem_230373)[gtid_216903 *\n                                                                     (s_n_m_203636 *\n                                                                      n_p_203492) +\n                                                                     gtid_216904 *\n                                                                     s_n_m_203636 +\n                                                                     gtid_216905];\n                \n                bool cond_216947 = sle64(x_216929, gtid_216906);\n                int64_t defunc_0_f_res_216948;\n                \n                if (cond_216947) {\n                    defunc_0_f_res_216948 = (int64_t) 0;\n                } else {\n                    int64_t i_216949 = add64(gtid_216906, x_216938);\n                    int64_t defunc_0_add_arg_216950;\n                    \n                    defunc_0_add_arg_216950 = ((__global\n                                  ",
            "              int64_t *) ext_mem_229265)[gtid_216903 *\n                                                                           (defunc_0_f_res_203631 *\n                                                                            n_p_203492) +\n                                                                           gtid_216904 *\n                                                                           defunc_0_f_res_203631 +\n                                                                           i_216949];\n                    \n                    int64_t defunc_1_add_res_216951 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_216950);\n                    \n                    defunc_0_f_res_216948 = defunc_1_add_res_216951;\n                }\n                \n                double defunc_0_f_res_216952;\n                \n                if (cond_216947) {\n                    defunc_0_f_res_216952 = 0.0;\n                } else {\n                    int64_t i_216953 = add64(gtid_216906, x_216938);\n                    double defunc_0_add_arg_216954;\n                    \n                    defunc_0_add_arg_216954 = ((__global\n                                                double *) mem_229531)[gtid_216903 *\n                                                                      (defunc_0_f_res_203631 *\n                                                                       n_p_203492) +\n                                                                      gtid_216904 *\n                                                                      defunc_0_f_res_203631 +\n                                                                      i_216953];\n                    defunc_0_f_res_216952 = defunc_0_add_arg_216954;\n                }\n                \n                int64_t binop_p_216955 = sub64(defunc_0_f_res_216948,\n                                               defunc_0_m_fun_res_216945);\n                double defunc_0_f",
            "_res_216956 = sitofp_i64_f64(binop_p_216955);\n                double abs_res_216957 = fabs(defunc_0_f_res_216956);\n                double tmp1_216958 = abs_res_216957 / x_216939;\n                double x_216959 = tmp1_216958 * tmp1_216958;\n                double y_216960 = tmp1_216958 * x_216959;\n                double tmp2_216961 = 1.0 - y_216960;\n                double x_216962 = tmp2_216961 * tmp2_216961;\n                double tmp3_216963 = tmp2_216961 * x_216962;\n                double tmp4_216964 = defunc_0_f_res_216952 * tmp3_216963;\n                double defunc_1_f_res_216965 = defunc_0_f_res_216956 *\n                       tmp4_216964;\n                double defunc_1_f_res_216966 = defunc_0_f_res_216956 *\n                       defunc_1_f_res_216965;\n                double defunc_0_f_res_216967;\n                \n                if (cond_216947) {\n                    defunc_0_f_res_216967 = 0.0;\n                } else {\n                    int64_t i_216968 = add64(gtid_216906, x_216938);\n                    double defunc_0_add_arg_216969;\n                    \n                    defunc_0_add_arg_216969 = ((__global\n                                                double *) mem_229526)[gtid_216903 *\n                                                                      (defunc_0_f_res_203631 *\n                                                                       n_p_203492) +\n                                                                      gtid_216904 *\n                                                                      defunc_0_f_res_203631 +\n                                                                      i_216968];\n                    defunc_0_f_res_216967 = defunc_0_add_arg_216969;\n                }\n                \n                double x_216970 = a12_216940 * tmp4_216964;\n                double y_216971 = b12_216941 * defunc_1_f_res_216965;\n                double x_216972 = x_216970 + y_216971;\n                double y_216973 = c12_216942 *",
            " defunc_1_f_res_216966;\n                double x_216974 = x_216972 + y_216973;\n                double defunc_9_fit_fun_res_216975 = defunc_0_f_res_216967 *\n                       x_216974;\n                double x_216976 = b12_216941 * tmp4_216964;\n                double y_216977 = b2_216943 * defunc_1_f_res_216965;\n                double x_216978 = x_216976 + y_216977;\n                double y_216979 = c2_216944 * defunc_1_f_res_216966;\n                double x_216980 = x_216978 + y_216979;\n                double defunc_9_slope_fun_res_216981 = defunc_0_f_res_216967 *\n                       x_216980;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_234026)[sext_i32_i64(local_tid_234022)] =\n                        defunc_9_fit_fun_res_216975;\n                    ((__local\n                      double *) red_arr_mem_234028)[sext_i32_i64(local_tid_234022)] =\n                        defunc_9_slope_fun_res_216981;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_234026)[sext_i32_i64(local_tid_234022)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_234028)[sext_i32_i64(local_tid_234022)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_s_203493)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_216908;\n                double x_216909;\n                double x_216910;\n                double x_216911;\n                double x_234039;\n                double x_234040;\n                double x_234041;\n                double x_234042;\n                bool ltid_in_bounds_234045 =\n                     slt64(sext_i32_i64(local_tid_234022), q_s_203493 *\n                           squot64(segred_g",
            "roup_sizze_216898,\n                                   segment_sizze_nonzzero_234019));\n                int32_t skip_threads_234046;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_234045) {\n                        x_216910 = ((volatile __local\n                                     double *) red_arr_mem_234026)[sext_i32_i64(local_tid_234022)];\n                        x_216911 = ((volatile __local\n                                     double *) red_arr_mem_234028)[sext_i32_i64(local_tid_234022)];\n                        if ((local_tid_234022 - squot32(local_tid_234022, 32) *\n                             32) == 0) {\n                            x_216908 = x_216910;\n                            x_216909 = x_216911;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_234046 = 1;\n                    while (slt32(skip_threads_234046, 32)) {\n                        bool thread_active_234047 = sle32(skip_threads_234046,\n                                                          local_tid_234022 -\n                                                          squot32(local_tid_234022,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_234045;\n                        \n                        if (thread_active_234047) {\n                            // read operands\n                            {\n                                x_216908 = ((volatile __local\n                                             double *) red_arr_mem_234026)[sext_i32_i64(local_tid_234022) -\n                                                                           sext_i32_i64(skip_threads_234046)];\n                                x_216909 = ((volatile __local\n                                             double *) red_arr_mem_234028)[sext_i32_i64(l",
            "ocal_tid_234022) -\n                                                                           sext_i32_i64(skip_threads_234046)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_234048 =\n                                 slt64(srem64(sext_i32_i64(local_tid_234022),\n                                              q_s_203493),\n                                       sext_i32_i64(local_tid_234022) -\n                                       sext_i32_i64(local_tid_234022 -\n                                       skip_threads_234046));\n                            \n                            if (thread_active_234047 && inactive_234048) {\n                                x_216908 = x_216910;\n                                x_216909 = x_216911;\n                            }\n                            if (thread_active_234047) {\n                                if (!inactive_234048) {\n                                    double defunc_1_op_res_216912 = x_216908 +\n                                           x_216910;\n                                    double defunc_1_op_res_216913 = x_216909 +\n                                           x_216911;\n                                    \n                                    x_216908 = defunc_1_op_res_216912;\n                                    x_216909 = defunc_1_op_res_216913;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_234024, skip_threads_234046)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_234047) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_234026)[sext_i32_i64(local_tid_234022)] =\n                             ",
            "       x_216908;\n                                x_216910 = x_216908;\n                                ((volatile __local\n                                  double *) red_arr_mem_234028)[sext_i32_i64(local_tid_234022)] =\n                                    x_216909;\n                                x_216911 = x_216909;\n                            }\n                        }\n                        if (sle32(wave_sizze_234024, skip_threads_234046)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_234046 *= 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_234022 - squot32(local_tid_234022, 32) *\n                         32) == 31 && ltid_in_bounds_234045) {\n                        ((volatile __local\n                          double *) red_arr_mem_234026)[sext_i32_i64(squot32(local_tid_234022,\n                                                                             32))] =\n                            x_216908;\n                        ((volatile __local\n                          double *) red_arr_mem_234028)[sext_i32_i64(squot32(local_tid_234022,\n                                                                             32))] =\n                            x_216909;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n                {\n                    int32_t skip_threads_234049;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_234022, 32) == 0 &&\n                            ltid_in_bounds_234045) {\n                            x_234041 = ((volatile __local\n                                         double *) ",
            "red_arr_mem_234026)[sext_i32_i64(local_tid_234022)];\n                            x_234042 = ((volatile __local\n                                         double *) red_arr_mem_234028)[sext_i32_i64(local_tid_234022)];\n                            if ((local_tid_234022 - squot32(local_tid_234022,\n                                                            32) * 32) == 0) {\n                                x_234039 = x_234041;\n                                x_234040 = x_234042;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_234049 = 1;\n                        while (slt32(skip_threads_234049, 32)) {\n                            bool thread_active_234050 =\n                                 sle32(skip_threads_234049, local_tid_234022 -\n                                       squot32(local_tid_234022, 32) * 32) &&\n                                 (squot32(local_tid_234022, 32) == 0 &&\n                                  ltid_in_bounds_234045);\n                            \n                            if (thread_active_234050) {\n                                // read operands\n                                {\n                                    x_234039 = ((volatile __local\n                                                 double *) red_arr_mem_234026)[sext_i32_i64(local_tid_234022) -\n                                                                               sext_i32_i64(skip_threads_234049)];\n                                    x_234040 = ((volatile __local\n                                                 double *) red_arr_mem_234028)[sext_i32_i64(local_tid_234022) -\n                                                                               sext_i32_i64(skip_threads_234049)];\n                                }\n                            }\n                            // perform operation\n                            {\n ",
            "                               bool inactive_234051 =\n                                     slt64(srem64(sext_i32_i64(local_tid_234022 *\n                                                  32 + 32 - 1), q_s_203493),\n                                           sext_i32_i64(local_tid_234022 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_234022 -\n                                                         skip_threads_234049) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_234050 && inactive_234051) {\n                                    x_234039 = x_234041;\n                                    x_234040 = x_234042;\n                                }\n                                if (thread_active_234050) {\n                                    if (!inactive_234051) {\n                                        double defunc_1_op_res_234043 =\n                                               x_234039 + x_234041;\n                                        double defunc_1_op_res_234044 =\n                                               x_234040 + x_234042;\n                                        \n                                        x_234039 = defunc_1_op_res_234043;\n                                        x_234040 = defunc_1_op_res_234044;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_234024, skip_threads_234049)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_234050) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_234026)[sext_i32_i64(local_tid_234022)] =\n                   ",
            "                     x_234039;\n                                    x_234041 = x_234039;\n                                    ((volatile __local\n                                      double *) red_arr_mem_234028)[sext_i32_i64(local_tid_234022)] =\n                                        x_234040;\n                                    x_234042 = x_234040;\n                                }\n                            }\n                            if (sle32(wave_sizze_234024, skip_threads_234049)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_234049 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_234052 = squot32(local_tid_234022, 32) == 0 ||\n                     !ltid_in_bounds_234045;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_234052) {\n                            x_216910 = x_216908;\n                            x_216911 = x_216909;\n                            x_216908 = ((__local\n                                         double *) red_arr_mem_234026)[sext_i32_i64(squot32(local_tid_234022,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_216909 = ((__local\n                                         double *) red_arr_mem_234028)[sext_i32_i64(squot32(local_tid_234022,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n  ",
            "                      bool inactive_234053 =\n                             slt64(srem64(sext_i32_i64(local_tid_234022),\n                                          q_s_203493),\n                                   sext_i32_i64(local_tid_234022) -\n                                   sext_i32_i64(squot32(local_tid_234022, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_234052) {\n                            if (inactive_234053) {\n                                x_216908 = x_216910;\n                                x_216909 = x_216911;\n                            }\n                        }\n                        if (!no_carry_in_234052) {\n                            if (!inactive_234053) {\n                                double defunc_1_op_res_216912 = x_216908 +\n                                       x_216910;\n                                double defunc_1_op_res_216913 = x_216909 +\n                                       x_216911;\n                                \n                                x_216908 = defunc_1_op_res_216912;\n                                x_216909 = defunc_1_op_res_216913;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_234052) {\n                            ((__local\n                              double *) red_arr_mem_234026)[sext_i32_i64(local_tid_234022)] =\n                                x_216908;\n                            ((__local\n                              double *) red_arr_mem_234028)[sext_i32_i64(local_tid_234022)] =\n                                x_216909;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_234022, 32) == 0 &&\n                        ltid_in_bou",
            "nds_234045) {\n                        ((__local\n                          double *) red_arr_mem_234026)[sext_i32_i64(local_tid_234022)] =\n                            x_216910;\n                        ((__local\n                          double *) red_arr_mem_234028)[sext_i32_i64(local_tid_234022)] =\n                            x_216911;\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_234032) *\n                      squot64(segred_group_sizze_216898,\n                              segment_sizze_nonzzero_234019) +\n                      sext_i32_i64(local_tid_234022), partition_sizze_203577 *\n                      n_p_203492 * s_n_m_203636) &&\n                slt64(sext_i32_i64(local_tid_234022),\n                      squot64(segred_group_sizze_216898,\n                              segment_sizze_nonzzero_234019))) {\n                double tmp_234054;\n                \n                tmp_234054 = ((__local\n                               double *) red_arr_mem_234026)[(sext_i32_i64(local_tid_234022) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_234019 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230379)[squot64(sext_i32_i64(virt_group_id_234032) *\n                                                squot64(segred_group_sizze_216898,\n                                                        segment_sizze_nonzzero_234019) +\n                                                sext_i32_i64(local_tid_234022),\n                                                n_p_203492 * s_n_m_203636) *\n                                        (s_n_m_203636 * n_p_203492) +\n                                   ",
            "     squot64(sext_i32_i64(virt_group_id_234032) *\n                                                squot64(segred_group_sizze_216898,\n                                                        segment_sizze_nonzzero_234019) +\n                                                sext_i32_i64(local_tid_234022) -\n                                                squot64(sext_i32_i64(virt_group_id_234032) *\n                                                        squot64(segred_group_sizze_216898,\n                                                                segment_sizze_nonzzero_234019) +\n                                                        sext_i32_i64(local_tid_234022),\n                                                        n_p_203492 *\n                                                        s_n_m_203636) *\n                                                (n_p_203492 * s_n_m_203636),\n                                                s_n_m_203636) * s_n_m_203636 +\n                                        (sext_i32_i64(virt_group_id_234032) *\n                                         squot64(segred_group_sizze_216898,\n                                                 segment_sizze_nonzzero_234019) +\n                                         sext_i32_i64(local_tid_234022) -\n                                         squot64(sext_i32_i64(virt_group_id_234032) *\n                                                 squot64(segred_group_sizze_216898,\n                                                         segment_sizze_nonzzero_234019) +\n                                                 sext_i32_i64(local_tid_234022),\n                                                 n_p_203492 * s_n_m_203636) *\n                                         (n_p_203492 * s_n_m_203636) -\n                                         squot64(sext_i32_i64(virt_group_id_234032) *\n                                                 squot64(segred_group_sizze_216898,\n                                                         segm",
            "ent_sizze_nonzzero_234019) +\n                                                 sext_i32_i64(local_tid_234022) -\n                                                 squot64(sext_i32_i64(virt_group_id_234032) *\n                                                         squot64(segred_group_sizze_216898,\n                                                                 segment_sizze_nonzzero_234019) +\n                                                         sext_i32_i64(local_tid_234022),\n                                                         n_p_203492 *\n                                                         s_n_m_203636) *\n                                                 (n_p_203492 * s_n_m_203636),\n                                                 s_n_m_203636) *\n                                         s_n_m_203636)] = tmp_234054;\n                \n                double tmp_234055;\n                \n                tmp_234055 = ((__local\n                               double *) red_arr_mem_234028)[(sext_i32_i64(local_tid_234022) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_234019 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230384)[squot64(sext_i32_i64(virt_group_id_234032) *\n                                                squot64(segred_group_sizze_216898,\n                                                        segment_sizze_nonzzero_234019) +\n                                                sext_i32_i64(local_tid_234022),\n                                                n_p_203492 * s_n_m_203636) *\n                                        (s_n_m_203636 * n_p_203492) +\n                                        squot64(sext_i32_i64(virt_group_id_234032) *\n                                                squot64(segred_group_sizze_216898,\n                                 ",
            "                       segment_sizze_nonzzero_234019) +\n                                                sext_i32_i64(local_tid_234022) -\n                                                squot64(sext_i32_i64(virt_group_id_234032) *\n                                                        squot64(segred_group_sizze_216898,\n                                                                segment_sizze_nonzzero_234019) +\n                                                        sext_i32_i64(local_tid_234022),\n                                                        n_p_203492 *\n                                                        s_n_m_203636) *\n                                                (n_p_203492 * s_n_m_203636),\n                                                s_n_m_203636) * s_n_m_203636 +\n                                        (sext_i32_i64(virt_group_id_234032) *\n                                         squot64(segred_group_sizze_216898,\n                                                 segment_sizze_nonzzero_234019) +\n                                         sext_i32_i64(local_tid_234022) -\n                                         squot64(sext_i32_i64(virt_group_id_234032) *\n                                                 squot64(segred_group_sizze_216898,\n                                                         segment_sizze_nonzzero_234019) +\n                                                 sext_i32_i64(local_tid_234022),\n                                                 n_p_203492 * s_n_m_203636) *\n                                         (n_p_203492 * s_n_m_203636) -\n                                         squot64(sext_i32_i64(virt_group_id_234032) *\n                                                 squot64(segred_group_sizze_216898,\n                                                         segment_sizze_nonzzero_234019) +\n                                                 sext_i32_i64(local_tid_234022) -\n                                                 squot6",
            "4(sext_i32_i64(virt_group_id_234032) *\n                                                         squot64(segred_group_sizze_216898,\n                                                                 segment_sizze_nonzzero_234019) +\n                                                         sext_i32_i64(local_tid_234022),\n                                                         n_p_203492 *\n                                                         s_n_m_203636) *\n                                                 (n_p_203492 * s_n_m_203636),\n                                                 s_n_m_203636) *\n                                         s_n_m_203636)] = tmp_234055;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_216898\n}\n__kernel void mainzisegred_small_218631(__global int *global_failure,\n                                        uint red_arr_mem_234233_backing_offset_0,\n                                        int64_t n_p_203492,\n                                        int64_t partition_sizze_203577,\n                                        int64_t C_len_203634,\n                                        int64_t num_groups_218626,\n                                        int64_t segment_sizze_nonzzero_234226,\n                                        __global unsigned char *mem_230500,\n                                        __global unsigned char *mem_230511)\n{\n    #define segred_group_sizze_218625 (mainzisegred_group_sizze_218608)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_234233_backing_0 =\n                           &shared_mem[red_arr_mem_234233_backing_offset_0];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234228;\n    int32_t local_tid_234229;\n    int64_t group_sizze_234232;\n    int32_t wave_sizze_234231;\n ",
            "   int32_t group_tid_234230;\n    \n    global_tid_234228 = get_global_id(0);\n    local_tid_234229 = get_local_id(0);\n    group_sizze_234232 = get_local_size(0);\n    wave_sizze_234231 = LOCKSTEP_WIDTH;\n    group_tid_234230 = get_group_id(0);\n    \n    int32_t phys_tid_218631 = global_tid_234228;\n    __local unsigned char *red_arr_mem_234233;\n    \n    red_arr_mem_234233 = (__local unsigned char *) red_arr_mem_234233_backing_0;\n    \n    int32_t phys_group_id_234235;\n    \n    phys_group_id_234235 = get_group_id(0);\n    for (int32_t i_234236 = 0; i_234236 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577,\n                                          squot64(segred_group_sizze_218625,\n                                                  segment_sizze_nonzzero_234226))) -\n                   phys_group_id_234235, sext_i64_i32(num_groups_218626));\n         i_234236++) {\n        int32_t virt_group_id_234237 = phys_group_id_234235 + i_234236 *\n                sext_i64_i32(num_groups_218626);\n        int64_t slice_234238 = partition_sizze_203577;\n        int64_t gtid_218629 = squot64(sext_i32_i64(local_tid_234229),\n                                      segment_sizze_nonzzero_234226) +\n                sext_i32_i64(virt_group_id_234237) *\n                squot64(segred_group_sizze_218625,\n                        segment_sizze_nonzzero_234226);\n        int64_t remnant_234239 = squot64(sext_i32_i64(local_tid_234229),\n                                         segment_sizze_nonzzero_234226) +\n                sext_i32_i64(virt_group_id_234237) *\n                squot64(segred_group_sizze_218625,\n                        segment_sizze_nonzzero_234226) - gtid_218629;\n        int64_t gtid_218630 = srem64(sext_i32_i64(local_tid_234229),\n                                     n_p_203492);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, n_p_203492) && (slt64(gtid_218629,\n                                                         partition_",
            "sizze_203577) &&\n                                                   slt64(sext_i32_i64(local_tid_234229),\n                                                         n_p_203492 *\n                                                         squot64(segred_group_sizze_218625,\n                                                                 segment_sizze_nonzzero_234226)))) {\n                double x_218636;\n                \n                x_218636 = ((__global double *) mem_230500)[gtid_218629 *\n                                                            C_len_203634 +\n                                                            gtid_218630];\n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_234233)[sext_i32_i64(local_tid_234229)] =\n                        x_218636;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_234233)[sext_i32_i64(local_tid_234229)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, n_p_203492)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_218632;\n                double x_218633;\n                double x_234240;\n                double x_234241;\n                bool ltid_in_bounds_234243 =\n                     slt64(sext_i32_i64(local_tid_234229), n_p_203492 *\n                           squot64(segred_group_sizze_218625,\n                                   segment_sizze_nonzzero_234226));\n                int32_t skip_threads_234244;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_234243) {\n                        x_218633 = ((volatile __local\n                                     double *) red_arr_mem_234233)[sext_i32_i64(local_tid_234229)];\n                     ",
            "   if ((local_tid_234229 - squot32(local_tid_234229, 32) *\n                             32) == 0) {\n                            x_218632 = x_218633;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_234244 = 1;\n                    while (slt32(skip_threads_234244, 32)) {\n                        bool thread_active_234245 = sle32(skip_threads_234244,\n                                                          local_tid_234229 -\n                                                          squot32(local_tid_234229,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_234243;\n                        \n                        if (thread_active_234245) {\n                            // read operands\n                            {\n                                x_218632 = ((volatile __local\n                                             double *) red_arr_mem_234233)[sext_i32_i64(local_tid_234229) -\n                                                                           sext_i32_i64(skip_threads_234244)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_234246 =\n                                 slt64(srem64(sext_i32_i64(local_tid_234229),\n                                              n_p_203492),\n                                       sext_i32_i64(local_tid_234229) -\n                                       sext_i32_i64(local_tid_234229 -\n                                       skip_threads_234244));\n                            \n                            if (thread_active_234245 && inactive_234246) {\n                                x_218632 = x_218633;\n                            }\n                            if (thread_active_234245) {\n                              ",
            "  if (!inactive_234246) {\n                                    double defunc_1_op_res_218634 = x_218632 +\n                                           x_218633;\n                                    \n                                    x_218632 = defunc_1_op_res_218634;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_234231, skip_threads_234244)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_234245) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_234233)[sext_i32_i64(local_tid_234229)] =\n                                    x_218632;\n                                x_218633 = x_218632;\n                            }\n                        }\n                        if (sle32(wave_sizze_234231, skip_threads_234244)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_234244 *= 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_234229 - squot32(local_tid_234229, 32) *\n                         32) == 31 && ltid_in_bounds_234243) {\n                        ((volatile __local\n                          double *) red_arr_mem_234233)[sext_i32_i64(squot32(local_tid_234229,\n                                                                             32))] =\n                            x_218632;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n                {\n                    int32_t skip_threads_234247;\n           ",
            "         \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_234229, 32) == 0 &&\n                            ltid_in_bounds_234243) {\n                            x_234241 = ((volatile __local\n                                         double *) red_arr_mem_234233)[sext_i32_i64(local_tid_234229)];\n                            if ((local_tid_234229 - squot32(local_tid_234229,\n                                                            32) * 32) == 0) {\n                                x_234240 = x_234241;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_234247 = 1;\n                        while (slt32(skip_threads_234247, 32)) {\n                            bool thread_active_234248 =\n                                 sle32(skip_threads_234247, local_tid_234229 -\n                                       squot32(local_tid_234229, 32) * 32) &&\n                                 (squot32(local_tid_234229, 32) == 0 &&\n                                  ltid_in_bounds_234243);\n                            \n                            if (thread_active_234248) {\n                                // read operands\n                                {\n                                    x_234240 = ((volatile __local\n                                                 double *) red_arr_mem_234233)[sext_i32_i64(local_tid_234229) -\n                                                                               sext_i32_i64(skip_threads_234247)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_234249 =\n                                     slt64(srem64(sext_i32_i64(local_tid_234229 *\n                                                  32 + 32 - ",
            "1), n_p_203492),\n                                           sext_i32_i64(local_tid_234229 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_234229 -\n                                                         skip_threads_234247) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_234248 && inactive_234249) {\n                                    x_234240 = x_234241;\n                                }\n                                if (thread_active_234248) {\n                                    if (!inactive_234249) {\n                                        double defunc_1_op_res_234242 =\n                                               x_234240 + x_234241;\n                                        \n                                        x_234240 = defunc_1_op_res_234242;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_234231, skip_threads_234247)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_234248) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_234233)[sext_i32_i64(local_tid_234229)] =\n                                        x_234240;\n                                    x_234241 = x_234240;\n                                }\n                            }\n                            if (sle32(wave_sizze_234231, skip_threads_234247)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_234247 *= 2;\n                        }\n                    }\n                }\n                barrier",
            "(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_234250 = squot32(local_tid_234229, 32) == 0 ||\n                     !ltid_in_bounds_234243;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_234250) {\n                            x_218633 = x_218632;\n                            x_218632 = ((__local\n                                         double *) red_arr_mem_234233)[sext_i32_i64(squot32(local_tid_234229,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_234251 =\n                             slt64(srem64(sext_i32_i64(local_tid_234229),\n                                          n_p_203492),\n                                   sext_i32_i64(local_tid_234229) -\n                                   sext_i32_i64(squot32(local_tid_234229, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_234250) {\n                            if (inactive_234251) {\n                                x_218632 = x_218633;\n                            }\n                        }\n                        if (!no_carry_in_234250) {\n                            if (!inactive_234251) {\n                                double defunc_1_op_res_218634 = x_218632 +\n                                       x_218633;\n                                \n                                x_218632 = defunc_1_op_res_218634;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_234250) {\n ",
            "                           ((__local\n                              double *) red_arr_mem_234233)[sext_i32_i64(local_tid_234229)] =\n                                x_218632;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_234229, 32) == 0 &&\n                        ltid_in_bounds_234243) {\n                        ((__local\n                          double *) red_arr_mem_234233)[sext_i32_i64(local_tid_234229)] =\n                            x_218633;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // save final values of segments\n        {\n            if (slt64(sext_i32_i64(virt_group_id_234237) *\n                      squot64(segred_group_sizze_218625,\n                              segment_sizze_nonzzero_234226) +\n                      sext_i32_i64(local_tid_234229), partition_sizze_203577) &&\n                slt64(sext_i32_i64(local_tid_234229),\n                      squot64(segred_group_sizze_218625,\n                              segment_sizze_nonzzero_234226))) {\n                double tmp_234252;\n                \n                tmp_234252 = ((__local\n                               double *) red_arr_mem_234233)[(sext_i32_i64(local_tid_234229) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_234226 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230511)[sext_i32_i64(virt_group_id_234237) *\n                                        squot64(segred_group_sizze_218625,\n                                                segment_sizze_nonzzero_234226) +\n                                        ",
            "sext_i32_i64(local_tid_234229)] =\n                    tmp_234252;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_218625\n}\n__kernel void mainzisegred_small_218762(__global int *global_failure,\n                                        uint red_arr_mem_234414_backing_offset_0,\n                                        int64_t n_p_203492,\n                                        int64_t partition_sizze_203577,\n                                        int64_t lifted_single_ma_l_arg_204134,\n                                        int64_t num_groups_218757,\n                                        int64_t segment_sizze_nonzzero_234407,\n                                        __global unsigned char *mem_230517,\n                                        __global unsigned char *mem_230528)\n{\n    #define segred_group_sizze_218756 (mainzisegred_group_sizze_218739)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_234414_backing_0 =\n                           &shared_mem[red_arr_mem_234414_backing_offset_0];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234409;\n    int32_t local_tid_234410;\n    int64_t group_sizze_234413;\n    int32_t wave_sizze_234412;\n    int32_t group_tid_234411;\n    \n    global_tid_234409 = get_global_id(0);\n    local_tid_234410 = get_local_id(0);\n    group_sizze_234413 = get_local_size(0);\n    wave_sizze_234412 = LOCKSTEP_WIDTH;\n    group_tid_234411 = get_group_id(0);\n    \n    int32_t phys_tid_218762 = global_tid_234409;\n    __local unsigned char *red_arr_mem_234414;\n    \n    red_arr_mem_234414 = (__local unsigned char *) red_arr_mem_234414_backing_0;\n    \n    int32_t phys_group_id_234416;\n    \n    phys_group_id_234416 = get_group_id(0);\n    for (int32_t i_234417 = 0; i_234417 <\n         sdiv_up32(sext_i64_i32(sd",
            "iv_up64(partition_sizze_203577,\n                                          squot64(segred_group_sizze_218756,\n                                                  segment_sizze_nonzzero_234407))) -\n                   phys_group_id_234416, sext_i64_i32(num_groups_218757));\n         i_234417++) {\n        int32_t virt_group_id_234418 = phys_group_id_234416 + i_234417 *\n                sext_i64_i32(num_groups_218757);\n        int64_t slice_234419 = partition_sizze_203577;\n        int64_t gtid_218760 = squot64(sext_i32_i64(local_tid_234410),\n                                      segment_sizze_nonzzero_234407) +\n                sext_i32_i64(virt_group_id_234418) *\n                squot64(segred_group_sizze_218756,\n                        segment_sizze_nonzzero_234407);\n        int64_t remnant_234420 = squot64(sext_i32_i64(local_tid_234410),\n                                         segment_sizze_nonzzero_234407) +\n                sext_i32_i64(virt_group_id_234418) *\n                squot64(segred_group_sizze_218756,\n                        segment_sizze_nonzzero_234407) - gtid_218760;\n        int64_t gtid_218761 = srem64(sext_i32_i64(local_tid_234410),\n                                     n_p_203492);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, n_p_203492) && (slt64(gtid_218760,\n                                                         partition_sizze_203577) &&\n                                                   slt64(sext_i32_i64(local_tid_234410),\n                                                         n_p_203492 *\n                                                         squot64(segred_group_sizze_218756,\n                                                                 segment_sizze_nonzzero_234407)))) {\n                double x_218767;\n                \n                x_218767 = ((__global double *) mem_230517)[gtid_218760 *\n                                                            lifted_single_ma_l_arg_204134 +\n      ",
            "                                                      gtid_218761];\n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_234414)[sext_i32_i64(local_tid_234410)] =\n                        x_218767;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_234414)[sext_i32_i64(local_tid_234410)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, n_p_203492)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_218763;\n                double x_218764;\n                double x_234421;\n                double x_234422;\n                bool ltid_in_bounds_234424 =\n                     slt64(sext_i32_i64(local_tid_234410), n_p_203492 *\n                           squot64(segred_group_sizze_218756,\n                                   segment_sizze_nonzzero_234407));\n                int32_t skip_threads_234425;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_234424) {\n                        x_218764 = ((volatile __local\n                                     double *) red_arr_mem_234414)[sext_i32_i64(local_tid_234410)];\n                        if ((local_tid_234410 - squot32(local_tid_234410, 32) *\n                             32) == 0) {\n                            x_218763 = x_218764;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_234425 = 1;\n                    while (slt32(skip_threads_234425, 32)) {\n                        bool thread_active_234426 = sle32(skip_threads_234425,\n                                                          local_tid_234410 -\n               ",
            "                                           squot32(local_tid_234410,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_234424;\n                        \n                        if (thread_active_234426) {\n                            // read operands\n                            {\n                                x_218763 = ((volatile __local\n                                             double *) red_arr_mem_234414)[sext_i32_i64(local_tid_234410) -\n                                                                           sext_i32_i64(skip_threads_234425)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_234427 =\n                                 slt64(srem64(sext_i32_i64(local_tid_234410),\n                                              n_p_203492),\n                                       sext_i32_i64(local_tid_234410) -\n                                       sext_i32_i64(local_tid_234410 -\n                                       skip_threads_234425));\n                            \n                            if (thread_active_234426 && inactive_234427) {\n                                x_218763 = x_218764;\n                            }\n                            if (thread_active_234426) {\n                                if (!inactive_234427) {\n                                    double defunc_1_op_res_218765 = x_218763 +\n                                           x_218764;\n                                    \n                                    x_218763 = defunc_1_op_res_218765;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_234412, skip_threads_234425)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_234426) {\n     ",
            "                       // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_234414)[sext_i32_i64(local_tid_234410)] =\n                                    x_218763;\n                                x_218764 = x_218763;\n                            }\n                        }\n                        if (sle32(wave_sizze_234412, skip_threads_234425)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_234425 *= 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_234410 - squot32(local_tid_234410, 32) *\n                         32) == 31 && ltid_in_bounds_234424) {\n                        ((volatile __local\n                          double *) red_arr_mem_234414)[sext_i32_i64(squot32(local_tid_234410,\n                                                                             32))] =\n                            x_218763;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n                {\n                    int32_t skip_threads_234428;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_234410, 32) == 0 &&\n                            ltid_in_bounds_234424) {\n                            x_234422 = ((volatile __local\n                                         double *) red_arr_mem_234414)[sext_i32_i64(local_tid_234410)];\n                            if ((local_tid_234410 - squot32(local_tid_234410,\n                                                            32) * 32) == 0) {\n                                x_234421 = x_234422;\n",
            "                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_234428 = 1;\n                        while (slt32(skip_threads_234428, 32)) {\n                            bool thread_active_234429 =\n                                 sle32(skip_threads_234428, local_tid_234410 -\n                                       squot32(local_tid_234410, 32) * 32) &&\n                                 (squot32(local_tid_234410, 32) == 0 &&\n                                  ltid_in_bounds_234424);\n                            \n                            if (thread_active_234429) {\n                                // read operands\n                                {\n                                    x_234421 = ((volatile __local\n                                                 double *) red_arr_mem_234414)[sext_i32_i64(local_tid_234410) -\n                                                                               sext_i32_i64(skip_threads_234428)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_234430 =\n                                     slt64(srem64(sext_i32_i64(local_tid_234410 *\n                                                  32 + 32 - 1), n_p_203492),\n                                           sext_i32_i64(local_tid_234410 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_234410 -\n                                                         skip_threads_234428) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_234429 && inactive_234430) {\n                                    x_234421 = x_234422;\n                                }\n       ",
            "                         if (thread_active_234429) {\n                                    if (!inactive_234430) {\n                                        double defunc_1_op_res_234423 =\n                                               x_234421 + x_234422;\n                                        \n                                        x_234421 = defunc_1_op_res_234423;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_234412, skip_threads_234428)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_234429) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_234414)[sext_i32_i64(local_tid_234410)] =\n                                        x_234421;\n                                    x_234422 = x_234421;\n                                }\n                            }\n                            if (sle32(wave_sizze_234412, skip_threads_234428)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_234428 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_234431 = squot32(local_tid_234410, 32) == 0 ||\n                     !ltid_in_bounds_234424;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_234431) {\n                            x_218764 = x_218763;\n                            x_218763 = ((__local\n                                         double *) red_arr_mem_234414)[sext_i32_i64(squot32(local_tid_234",
            "410,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_234432 =\n                             slt64(srem64(sext_i32_i64(local_tid_234410),\n                                          n_p_203492),\n                                   sext_i32_i64(local_tid_234410) -\n                                   sext_i32_i64(squot32(local_tid_234410, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_234431) {\n                            if (inactive_234432) {\n                                x_218763 = x_218764;\n                            }\n                        }\n                        if (!no_carry_in_234431) {\n                            if (!inactive_234432) {\n                                double defunc_1_op_res_218765 = x_218763 +\n                                       x_218764;\n                                \n                                x_218763 = defunc_1_op_res_218765;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_234431) {\n                            ((__local\n                              double *) red_arr_mem_234414)[sext_i32_i64(local_tid_234410)] =\n                                x_218763;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_234410, 32) == 0 &&\n                        ltid_in_bounds_234424) {\n                        ((__local\n                          double *) red_arr_mem_234414)[sext_i32_i64",
            "(local_tid_234410)] =\n                            x_218764;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // save final values of segments\n        {\n            if (slt64(sext_i32_i64(virt_group_id_234418) *\n                      squot64(segred_group_sizze_218756,\n                              segment_sizze_nonzzero_234407) +\n                      sext_i32_i64(local_tid_234410), partition_sizze_203577) &&\n                slt64(sext_i32_i64(local_tid_234410),\n                      squot64(segred_group_sizze_218756,\n                              segment_sizze_nonzzero_234407))) {\n                double tmp_234433;\n                \n                tmp_234433 = ((__local\n                               double *) red_arr_mem_234414)[(sext_i32_i64(local_tid_234410) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_234407 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230528)[sext_i32_i64(virt_group_id_234418) *\n                                        squot64(segred_group_sizze_218756,\n                                                segment_sizze_nonzzero_234407) +\n                                        sext_i32_i64(local_tid_234410)] =\n                    tmp_234433;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_218756\n}\n__kernel void mainzisegred_small_218893(__global int *global_failure,\n                                        uint red_arr_mem_234595_backing_offset_0,\n                                        int64_t partition_sizze_203577,\n                                        int64_t dyn_lifted_single_ma_l_arg_204144,\n     ",
            "                                   int64_t num_groups_218888,\n                                        int64_t segment_sizze_nonzzero_234588,\n                                        __global unsigned char *mem_230534,\n                                        __global unsigned char *mem_230545)\n{\n    #define segred_group_sizze_218887 (mainzisegred_group_sizze_218870)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_234595_backing_0 =\n                           &shared_mem[red_arr_mem_234595_backing_offset_0];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234590;\n    int32_t local_tid_234591;\n    int64_t group_sizze_234594;\n    int32_t wave_sizze_234593;\n    int32_t group_tid_234592;\n    \n    global_tid_234590 = get_global_id(0);\n    local_tid_234591 = get_local_id(0);\n    group_sizze_234594 = get_local_size(0);\n    wave_sizze_234593 = LOCKSTEP_WIDTH;\n    group_tid_234592 = get_group_id(0);\n    \n    int32_t phys_tid_218893 = global_tid_234590;\n    __local unsigned char *red_arr_mem_234595;\n    \n    red_arr_mem_234595 = (__local unsigned char *) red_arr_mem_234595_backing_0;\n    \n    int32_t phys_group_id_234597;\n    \n    phys_group_id_234597 = get_group_id(0);\n    for (int32_t i_234598 = 0; i_234598 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577,\n                                          squot64(segred_group_sizze_218887,\n                                                  segment_sizze_nonzzero_234588))) -\n                   phys_group_id_234597, sext_i64_i32(num_groups_218888));\n         i_234598++) {\n        int32_t virt_group_id_234599 = phys_group_id_234597 + i_234598 *\n                sext_i64_i32(num_groups_218888);\n        int64_t slice_234600 = partition_sizze_203577;\n        int64_t gtid_218891 = squot64(sext_i32_i64(local_tid_234591),\n                                      segment_sizze_nonzzero_234588) +\n                sext",
            "_i32_i64(virt_group_id_234599) *\n                squot64(segred_group_sizze_218887,\n                        segment_sizze_nonzzero_234588);\n        int64_t remnant_234601 = squot64(sext_i32_i64(local_tid_234591),\n                                         segment_sizze_nonzzero_234588) +\n                sext_i32_i64(virt_group_id_234599) *\n                squot64(segred_group_sizze_218887,\n                        segment_sizze_nonzzero_234588) - gtid_218891;\n        int64_t gtid_218892 = srem64(sext_i32_i64(local_tid_234591),\n                                     (int64_t) 3);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, (int64_t) 3) && (slt64(gtid_218891,\n                                                          partition_sizze_203577) &&\n                                                    slt64(sext_i32_i64(local_tid_234591),\n                                                          (int64_t) 3 *\n                                                          squot64(segred_group_sizze_218887,\n                                                                  segment_sizze_nonzzero_234588)))) {\n                double x_218898;\n                \n                x_218898 = ((__global double *) mem_230534)[gtid_218891 *\n                                                            dyn_lifted_single_ma_l_arg_204144 +\n                                                            gtid_218892];\n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_234595)[sext_i32_i64(local_tid_234591)] =\n                        x_218898;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_234595)[sext_i32_i64(local_tid_234591)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, (int64_t) 3",
            ")) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_218894;\n                double x_218895;\n                double x_234602;\n                double x_234603;\n                bool ltid_in_bounds_234605 =\n                     slt64(sext_i32_i64(local_tid_234591), (int64_t) 3 *\n                           squot64(segred_group_sizze_218887,\n                                   segment_sizze_nonzzero_234588));\n                int32_t skip_threads_234606;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_234605) {\n                        x_218895 = ((volatile __local\n                                     double *) red_arr_mem_234595)[sext_i32_i64(local_tid_234591)];\n                        if ((local_tid_234591 - squot32(local_tid_234591, 32) *\n                             32) == 0) {\n                            x_218894 = x_218895;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_234606 = 1;\n                    while (slt32(skip_threads_234606, 32)) {\n                        bool thread_active_234607 = sle32(skip_threads_234606,\n                                                          local_tid_234591 -\n                                                          squot32(local_tid_234591,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_234605;\n                        \n                        if (thread_active_234607) {\n                            // read operands\n                            {\n                                x_218894 = ((volatile __local\n                                             double *) red_arr_mem_234595)[sext_i32_i64(local_tid_234591) -\n                                                                           sext_i32_i64(skip_t",
            "hreads_234606)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_234608 =\n                                 slt64(srem64(sext_i32_i64(local_tid_234591),\n                                              (int64_t) 3),\n                                       sext_i32_i64(local_tid_234591) -\n                                       sext_i32_i64(local_tid_234591 -\n                                       skip_threads_234606));\n                            \n                            if (thread_active_234607 && inactive_234608) {\n                                x_218894 = x_218895;\n                            }\n                            if (thread_active_234607) {\n                                if (!inactive_234608) {\n                                    double defunc_1_op_res_218896 = x_218894 +\n                                           x_218895;\n                                    \n                                    x_218894 = defunc_1_op_res_218896;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_234593, skip_threads_234606)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_234607) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_234595)[sext_i32_i64(local_tid_234591)] =\n                                    x_218894;\n                                x_218895 = x_218894;\n                            }\n                        }\n                        if (sle32(wave_sizze_234593, skip_threads_234606)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_234606 *= 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_234591 - squot32(local_tid_234591, 32) *\n                         32) == 31 && ltid_in_bounds_234605) {\n                        ((volatile __local\n                          double *) red_arr_mem_234595)[sext_i32_i64(squot32(local_tid_234591,\n                                                                             32))] =\n                            x_218894;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n                {\n                    int32_t skip_threads_234609;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_234591, 32) == 0 &&\n                            ltid_in_bounds_234605) {\n                            x_234603 = ((volatile __local\n                                         double *) red_arr_mem_234595)[sext_i32_i64(local_tid_234591)];\n                            if ((local_tid_234591 - squot32(local_tid_234591,\n                                                            32) * 32) == 0) {\n                                x_234602 = x_234603;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_234609 = 1;\n                        while (slt32(skip_threads_234609, 32)) {\n                            bool thread_active_234610 =\n                                 sle32(skip_threads_234609, local_tid_234591 -\n                                       squot32(local_tid_234591, 32) * 32) &&\n                                 (squot32(local_tid_234591, 32) == 0 &&\n                                  ltid_in_bounds",
            "_234605);\n                            \n                            if (thread_active_234610) {\n                                // read operands\n                                {\n                                    x_234602 = ((volatile __local\n                                                 double *) red_arr_mem_234595)[sext_i32_i64(local_tid_234591) -\n                                                                               sext_i32_i64(skip_threads_234609)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_234611 =\n                                     slt64(srem64(sext_i32_i64(local_tid_234591 *\n                                                  32 + 32 - 1), (int64_t) 3),\n                                           sext_i32_i64(local_tid_234591 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_234591 -\n                                                         skip_threads_234609) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_234610 && inactive_234611) {\n                                    x_234602 = x_234603;\n                                }\n                                if (thread_active_234610) {\n                                    if (!inactive_234611) {\n                                        double defunc_1_op_res_234604 =\n                                               x_234602 + x_234603;\n                                        \n                                        x_234602 = defunc_1_op_res_234604;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_234593, skip_threads_234609)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n",
            "                            }\n                            if (thread_active_234610) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_234595)[sext_i32_i64(local_tid_234591)] =\n                                        x_234602;\n                                    x_234603 = x_234602;\n                                }\n                            }\n                            if (sle32(wave_sizze_234593, skip_threads_234609)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_234609 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_234612 = squot32(local_tid_234591, 32) == 0 ||\n                     !ltid_in_bounds_234605;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_234612) {\n                            x_218895 = x_218894;\n                            x_218894 = ((__local\n                                         double *) red_arr_mem_234595)[sext_i32_i64(squot32(local_tid_234591,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_234613 =\n                             slt64(srem64(sext_i32_i64(local_tid_234591),\n                                          (int64_t) 3),\n                                   sext_i32_i64(local_tid_234591) -\n                                   sext_i32_i64(squot32(local_tid_234",
            "591, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_234612) {\n                            if (inactive_234613) {\n                                x_218894 = x_218895;\n                            }\n                        }\n                        if (!no_carry_in_234612) {\n                            if (!inactive_234613) {\n                                double defunc_1_op_res_218896 = x_218894 +\n                                       x_218895;\n                                \n                                x_218894 = defunc_1_op_res_218896;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_234612) {\n                            ((__local\n                              double *) red_arr_mem_234595)[sext_i32_i64(local_tid_234591)] =\n                                x_218894;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_234591, 32) == 0 &&\n                        ltid_in_bounds_234605) {\n                        ((__local\n                          double *) red_arr_mem_234595)[sext_i32_i64(local_tid_234591)] =\n                            x_218895;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // save final values of segments\n        {\n            if (slt64(sext_i32_i64(virt_group_id_234599) *\n                      squot64(segred_group_sizze_218887,\n                              segment_sizze_nonzzero_234588) +\n                      sext_i32_i64(local_tid_234591), partition_sizze_203577) &&\n                slt64(sext_i32_i64(local_tid_234591),\n                      squot64(segred_gro",
            "up_sizze_218887,\n                              segment_sizze_nonzzero_234588))) {\n                double tmp_234614;\n                \n                tmp_234614 = ((__local\n                               double *) red_arr_mem_234595)[(sext_i32_i64(local_tid_234591) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_234588 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230545)[sext_i32_i64(virt_group_id_234599) *\n                                        squot64(segred_group_sizze_218887,\n                                                segment_sizze_nonzzero_234588) +\n                                        sext_i32_i64(local_tid_234591)] =\n                    tmp_234614;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_218887\n}\n__kernel void mainzisegred_small_219515(__global int *global_failure,\n                                        uint red_arr_mem_234810_backing_offset_0,\n                                        int64_t n_203490, int64_t q_l_203495,\n                                        int64_t jump_t_203500,\n                                        int64_t partition_sizze_203577,\n                                        int64_t l_n_m_203643, int64_t i_203670,\n                                        int64_t num_groups_219509,\n                                        int64_t ctx_param_ext_229488,\n                                        int64_t ctx_param_ext_229489,\n                                        int64_t ctx_param_ext_229491,\n                                        int64_t segment_sizze_nonzzero_234803,\n                                        __global unsigned char *ext_mem_229411,\n                                        __gl",
            "obal unsigned char *ext_mem_229412,\n                                        __global\n                                        unsigned char *mem_param_229493,\n                                        __global unsigned char *mem_230596)\n{\n    #define segred_group_sizze_219508 (mainzisegred_group_sizze_219260)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_234810_backing_0 =\n                           &shared_mem[red_arr_mem_234810_backing_offset_0];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234805;\n    int32_t local_tid_234806;\n    int64_t group_sizze_234809;\n    int32_t wave_sizze_234808;\n    int32_t group_tid_234807;\n    \n    global_tid_234805 = get_global_id(0);\n    local_tid_234806 = get_local_id(0);\n    group_sizze_234809 = get_local_size(0);\n    wave_sizze_234808 = LOCKSTEP_WIDTH;\n    group_tid_234807 = get_group_id(0);\n    \n    int32_t phys_tid_219515 = global_tid_234805;\n    __local unsigned char *red_arr_mem_234810;\n    \n    red_arr_mem_234810 = (__local unsigned char *) red_arr_mem_234810_backing_0;\n    \n    int32_t phys_group_id_234812;\n    \n    phys_group_id_234812 = get_group_id(0);\n    for (int32_t i_234813 = 0; i_234813 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577 * l_n_m_203643,\n                                          squot64(segred_group_sizze_219508,\n                                                  segment_sizze_nonzzero_234803))) -\n                   phys_group_id_234812, sext_i64_i32(num_groups_219509));\n         i_234813++) {\n        int32_t virt_group_id_234814 = phys_group_id_234812 + i_234813 *\n                sext_i64_i32(num_groups_219509);\n        int64_t slice_234815 = l_n_m_203643;\n        int64_t slice_234816 = partition_sizze_203577 * slice_234815;\n        int64_t gtid_219512 = squot64(squot64(sext_i32_i64(local_tid_234806),\n                                              segment_sizze_nonzzer",
            "o_234803) +\n                                      sext_i32_i64(virt_group_id_234814) *\n                                      squot64(segred_group_sizze_219508,\n                                              segment_sizze_nonzzero_234803),\n                                      slice_234815);\n        int64_t remnant_234817 = squot64(sext_i32_i64(local_tid_234806),\n                                         segment_sizze_nonzzero_234803) +\n                sext_i32_i64(virt_group_id_234814) *\n                squot64(segred_group_sizze_219508,\n                        segment_sizze_nonzzero_234803) - gtid_219512 *\n                slice_234815;\n        int64_t gtid_219513 = remnant_234817;\n        int64_t remnant_234818 = remnant_234817 - gtid_219513;\n        int64_t gtid_219514 = srem64(sext_i32_i64(local_tid_234806),\n                                     q_l_203495);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_l_203495) && ((slt64(gtid_219512,\n                                                          partition_sizze_203577) &&\n                                                    slt64(gtid_219513,\n                                                          l_n_m_203643)) &&\n                                                   slt64(sext_i32_i64(local_tid_234806),\n                                                         q_l_203495 *\n                                                         squot64(segred_group_sizze_219508,\n                                                                 segment_sizze_nonzzero_234803)))) {\n                int64_t x_219523;\n                \n                x_219523 = ((__global int64_t *) ext_mem_229412)[gtid_219512 *\n                                                                 l_n_m_203643 +\n                                                                 gtid_219513];\n                \n                double x_219524;\n                \n                x_219524 = ((__global double *) ext_mem_",
            "229411)[gtid_219512 *\n                                                                l_n_m_203643 +\n                                                                gtid_219513];\n                \n                int64_t binop_y_228694 = mul64(jump_t_203500, gtid_219513);\n                int64_t binop_y_228695 = smin64(i_203670, binop_y_228694);\n                int64_t index_primexp_228696 = add64((int64_t) 1,\n                                                     binop_y_228695);\n                bool cond_219527 = sle64(n_203490, gtid_219514);\n                int64_t defunc_0_f_res_219528;\n                \n                if (cond_219527) {\n                    defunc_0_f_res_219528 = (int64_t) 0;\n                } else {\n                    int64_t i_219529 = add64(gtid_219514, x_219523);\n                    int64_t defunc_1_add_res_219530 = add64((int64_t) 1,\n                                                            i_219529);\n                    \n                    defunc_0_f_res_219528 = defunc_1_add_res_219530;\n                }\n                \n                double defunc_0_f_res_219531;\n                \n                if (cond_219527) {\n                    defunc_0_f_res_219531 = 0.0;\n                } else {\n                    int64_t i_219532 = add64(gtid_219514, x_219523);\n                    double defunc_0_add_arg_219533;\n                    \n                    defunc_0_add_arg_219533 = ((__global\n                                                double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                                            (gtid_219512 *\n                                                                             ctx_param_ext_229489 +\n                                                                             i_219532 *\n                                                                             ctx_param_ext_229491)];\n                    defunc_0_f_res_219531 = defunc_0_add_arg_219533;\n              ",
            "  }\n                \n                int64_t binop_p_219534 = sub64(defunc_0_f_res_219528,\n                                               index_primexp_228696);\n                double defunc_0_f_res_219535 = sitofp_i64_f64(binop_p_219534);\n                double abs_res_219536 = fabs(defunc_0_f_res_219535);\n                double tmp1_219537 = abs_res_219536 / x_219524;\n                double x_219538 = tmp1_219537 * tmp1_219537;\n                double y_219539 = tmp1_219537 * x_219538;\n                double tmp2_219540 = 1.0 - y_219539;\n                double x_219541 = tmp2_219540 * tmp2_219540;\n                double tmp3_219542 = tmp2_219540 * x_219541;\n                double w_j_219543 = defunc_0_f_res_219531 * tmp3_219542;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_234810)[sext_i32_i64(local_tid_234806)] =\n                        w_j_219543;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_234810)[sext_i32_i64(local_tid_234806)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_l_203495)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_219516;\n                double x_219517;\n                double x_234819;\n                double x_234820;\n                bool ltid_in_bounds_234822 =\n                     slt64(sext_i32_i64(local_tid_234806), q_l_203495 *\n                           squot64(segred_group_sizze_219508,\n                                   segment_sizze_nonzzero_234803));\n                int32_t skip_threads_234823;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_234822) {\n                        x_219517 = ((volatile __local\n    ",
            "                                 double *) red_arr_mem_234810)[sext_i32_i64(local_tid_234806)];\n                        if ((local_tid_234806 - squot32(local_tid_234806, 32) *\n                             32) == 0) {\n                            x_219516 = x_219517;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_234823 = 1;\n                    while (slt32(skip_threads_234823, 32)) {\n                        bool thread_active_234824 = sle32(skip_threads_234823,\n                                                          local_tid_234806 -\n                                                          squot32(local_tid_234806,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_234822;\n                        \n                        if (thread_active_234824) {\n                            // read operands\n                            {\n                                x_219516 = ((volatile __local\n                                             double *) red_arr_mem_234810)[sext_i32_i64(local_tid_234806) -\n                                                                           sext_i32_i64(skip_threads_234823)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_234825 =\n                                 slt64(srem64(sext_i32_i64(local_tid_234806),\n                                              q_l_203495),\n                                       sext_i32_i64(local_tid_234806) -\n                                       sext_i32_i64(local_tid_234806 -\n                                       skip_threads_234823));\n                            \n                            if (thread_active_234824 && inactive_234825) {\n                                x_219516 = x_219517;",
            "\n                            }\n                            if (thread_active_234824) {\n                                if (!inactive_234825) {\n                                    double defunc_1_op_res_219518 = x_219516 +\n                                           x_219517;\n                                    \n                                    x_219516 = defunc_1_op_res_219518;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_234808, skip_threads_234823)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_234824) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_234810)[sext_i32_i64(local_tid_234806)] =\n                                    x_219516;\n                                x_219517 = x_219516;\n                            }\n                        }\n                        if (sle32(wave_sizze_234808, skip_threads_234823)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_234823 *= 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_234806 - squot32(local_tid_234806, 32) *\n                         32) == 31 && ltid_in_bounds_234822) {\n                        ((volatile __local\n                          double *) red_arr_mem_234810)[sext_i32_i64(squot32(local_tid_234806,\n                                                                             32))] =\n                            x_219516;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // scan the first block, after which offset",
            " 'i' contains carry-in for block 'i+1'\n                {\n                    int32_t skip_threads_234826;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_234806, 32) == 0 &&\n                            ltid_in_bounds_234822) {\n                            x_234820 = ((volatile __local\n                                         double *) red_arr_mem_234810)[sext_i32_i64(local_tid_234806)];\n                            if ((local_tid_234806 - squot32(local_tid_234806,\n                                                            32) * 32) == 0) {\n                                x_234819 = x_234820;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_234826 = 1;\n                        while (slt32(skip_threads_234826, 32)) {\n                            bool thread_active_234827 =\n                                 sle32(skip_threads_234826, local_tid_234806 -\n                                       squot32(local_tid_234806, 32) * 32) &&\n                                 (squot32(local_tid_234806, 32) == 0 &&\n                                  ltid_in_bounds_234822);\n                            \n                            if (thread_active_234827) {\n                                // read operands\n                                {\n                                    x_234819 = ((volatile __local\n                                                 double *) red_arr_mem_234810)[sext_i32_i64(local_tid_234806) -\n                                                                               sext_i32_i64(skip_threads_234826)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_234828 =\n                         ",
            "            slt64(srem64(sext_i32_i64(local_tid_234806 *\n                                                  32 + 32 - 1), q_l_203495),\n                                           sext_i32_i64(local_tid_234806 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_234806 -\n                                                         skip_threads_234826) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_234827 && inactive_234828) {\n                                    x_234819 = x_234820;\n                                }\n                                if (thread_active_234827) {\n                                    if (!inactive_234828) {\n                                        double defunc_1_op_res_234821 =\n                                               x_234819 + x_234820;\n                                        \n                                        x_234819 = defunc_1_op_res_234821;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_234808, skip_threads_234826)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_234827) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_234810)[sext_i32_i64(local_tid_234806)] =\n                                        x_234819;\n                                    x_234820 = x_234819;\n                                }\n                            }\n                            if (sle32(wave_sizze_234808, skip_threads_234826)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                          ",
            "  skip_threads_234826 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_234829 = squot32(local_tid_234806, 32) == 0 ||\n                     !ltid_in_bounds_234822;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_234829) {\n                            x_219517 = x_219516;\n                            x_219516 = ((__local\n                                         double *) red_arr_mem_234810)[sext_i32_i64(squot32(local_tid_234806,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_234830 =\n                             slt64(srem64(sext_i32_i64(local_tid_234806),\n                                          q_l_203495),\n                                   sext_i32_i64(local_tid_234806) -\n                                   sext_i32_i64(squot32(local_tid_234806, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_234829) {\n                            if (inactive_234830) {\n                                x_219516 = x_219517;\n                            }\n                        }\n                        if (!no_carry_in_234829) {\n                            if (!inactive_234830) {\n                                double defunc_1_op_res_219518 = x_219516 +\n                                       x_219517;\n                                \n                                x_219516 = defunc_1_op_res_219518;\n                            }\n                        }\n                    }",
            "\n                    // write final result\n                    {\n                        if (!no_carry_in_234829) {\n                            ((__local\n                              double *) red_arr_mem_234810)[sext_i32_i64(local_tid_234806)] =\n                                x_219516;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_234806, 32) == 0 &&\n                        ltid_in_bounds_234822) {\n                        ((__local\n                          double *) red_arr_mem_234810)[sext_i32_i64(local_tid_234806)] =\n                            x_219517;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // save final values of segments\n        {\n            if (slt64(sext_i32_i64(virt_group_id_234814) *\n                      squot64(segred_group_sizze_219508,\n                              segment_sizze_nonzzero_234803) +\n                      sext_i32_i64(local_tid_234806), partition_sizze_203577 *\n                      l_n_m_203643) && slt64(sext_i32_i64(local_tid_234806),\n                                             squot64(segred_group_sizze_219508,\n                                                     segment_sizze_nonzzero_234803))) {\n                double tmp_234831;\n                \n                tmp_234831 = ((__local\n                               double *) red_arr_mem_234810)[(sext_i32_i64(local_tid_234806) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_234803 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230596)[squot64(sext_i32_i64(virt_group_id_234814) *\n    ",
            "                                            squot64(segred_group_sizze_219508,\n                                                        segment_sizze_nonzzero_234803) +\n                                                sext_i32_i64(local_tid_234806),\n                                                l_n_m_203643) * l_n_m_203643 +\n                                        (sext_i32_i64(virt_group_id_234814) *\n                                         squot64(segred_group_sizze_219508,\n                                                 segment_sizze_nonzzero_234803) +\n                                         sext_i32_i64(local_tid_234806) -\n                                         squot64(sext_i32_i64(virt_group_id_234814) *\n                                                 squot64(segred_group_sizze_219508,\n                                                         segment_sizze_nonzzero_234803) +\n                                                 sext_i32_i64(local_tid_234806),\n                                                 l_n_m_203643) *\n                                         l_n_m_203643)] = tmp_234831;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_219508\n}\n__kernel void mainzisegred_small_219564(__global int *global_failure,\n                                        uint red_arr_mem_234892_backing_offset_0,\n                                        int64_t n_203490, int64_t q_l_203495,\n                                        int64_t jump_t_203500,\n                                        int64_t partition_sizze_203577,\n                                        int64_t l_n_m_203643, int64_t i_203670,\n                                        int64_t num_groups_219558,\n                                        int64_t ctx_param_ext_229488,\n                                        int64_t ctx_param_ext_229489,\n                                       ",
            " int64_t ctx_param_ext_229491,\n                                        int64_t segment_sizze_nonzzero_234885,\n                                        __global unsigned char *ext_mem_229411,\n                                        __global unsigned char *ext_mem_229412,\n                                        __global\n                                        unsigned char *mem_param_229493,\n                                        __global unsigned char *mem_230551,\n                                        __global unsigned char *mem_230601,\n                                        __global unsigned char *mem_230606)\n{\n    #define segred_group_sizze_219557 (mainzisegred_group_sizze_219193)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_234892_backing_0 =\n                           &shared_mem[red_arr_mem_234892_backing_offset_0];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234887;\n    int32_t local_tid_234888;\n    int64_t group_sizze_234891;\n    int32_t wave_sizze_234890;\n    int32_t group_tid_234889;\n    \n    global_tid_234887 = get_global_id(0);\n    local_tid_234888 = get_local_id(0);\n    group_sizze_234891 = get_local_size(0);\n    wave_sizze_234890 = LOCKSTEP_WIDTH;\n    group_tid_234889 = get_group_id(0);\n    \n    int32_t phys_tid_219564 = global_tid_234887;\n    __local unsigned char *red_arr_mem_234892;\n    \n    red_arr_mem_234892 = (__local unsigned char *) red_arr_mem_234892_backing_0;\n    \n    int32_t phys_group_id_234894;\n    \n    phys_group_id_234894 = get_group_id(0);\n    for (int32_t i_234895 = 0; i_234895 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577 * l_n_m_203643,\n                                          squot64(segred_group_sizze_219557,\n                                                  segment_sizze_nonzzero_234885))) -\n                   phys_group_id_234894, sext_i64_i32(num_groups_219558));\n         i_234895++",
            ") {\n        int32_t virt_group_id_234896 = phys_group_id_234894 + i_234895 *\n                sext_i64_i32(num_groups_219558);\n        int64_t slice_234897 = l_n_m_203643;\n        int64_t slice_234898 = partition_sizze_203577 * slice_234897;\n        int64_t gtid_219561 = squot64(squot64(sext_i32_i64(local_tid_234888),\n                                              segment_sizze_nonzzero_234885) +\n                                      sext_i32_i64(virt_group_id_234896) *\n                                      squot64(segred_group_sizze_219557,\n                                              segment_sizze_nonzzero_234885),\n                                      slice_234897);\n        int64_t remnant_234899 = squot64(sext_i32_i64(local_tid_234888),\n                                         segment_sizze_nonzzero_234885) +\n                sext_i32_i64(virt_group_id_234896) *\n                squot64(segred_group_sizze_219557,\n                        segment_sizze_nonzzero_234885) - gtid_219561 *\n                slice_234897;\n        int64_t gtid_219562 = remnant_234899;\n        int64_t remnant_234900 = remnant_234899 - gtid_219562;\n        int64_t gtid_219563 = srem64(sext_i32_i64(local_tid_234888),\n                                     q_l_203495);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_l_203495) && ((slt64(gtid_219561,\n                                                          partition_sizze_203577) &&\n                                                    slt64(gtid_219562,\n                                                          l_n_m_203643)) &&\n                                                   slt64(sext_i32_i64(local_tid_234888),\n                                                         q_l_203495 *\n                                                         squot64(segred_group_sizze_219557,\n                                                                 segment_sizze_nonzzero_234885)))) {\n                int64_t x_",
            "219574;\n                \n                x_219574 = ((__global int64_t *) ext_mem_229412)[gtid_219561 *\n                                                                 l_n_m_203643 +\n                                                                 gtid_219562];\n                \n                double x_219575;\n                \n                x_219575 = ((__global double *) ext_mem_229411)[gtid_219561 *\n                                                                l_n_m_203643 +\n                                                                gtid_219562];\n                \n                int64_t binop_y_228689 = mul64(jump_t_203500, gtid_219562);\n                int64_t binop_y_228690 = smin64(i_203670, binop_y_228689);\n                int64_t index_primexp_228691 = add64((int64_t) 1,\n                                                     binop_y_228690);\n                double a0_219577;\n                \n                a0_219577 = ((__global double *) mem_230601)[gtid_219561 *\n                                                             l_n_m_203643 +\n                                                             gtid_219562];\n                \n                bool cond_219579 = sle64(n_203490, gtid_219563);\n                int64_t defunc_0_f_res_219580;\n                \n                if (cond_219579) {\n                    defunc_0_f_res_219580 = (int64_t) 0;\n                } else {\n                    int64_t i_219581 = add64(gtid_219563, x_219574);\n                    int64_t defunc_1_add_res_219582 = add64((int64_t) 1,\n                                                            i_219581);\n                    \n                    defunc_0_f_res_219580 = defunc_1_add_res_219582;\n                }\n                \n                double defunc_0_f_res_219583;\n                \n                if (cond_219579) {\n                    defunc_0_f_res_219583 = 0.0;\n                } else {\n                    int64_t i_219584 = add64(gtid_219563, x_219574);\n            ",
            "        double defunc_0_add_arg_219585;\n                    \n                    defunc_0_add_arg_219585 = ((__global\n                                                double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                                            (gtid_219561 *\n                                                                             ctx_param_ext_229489 +\n                                                                             i_219584 *\n                                                                             ctx_param_ext_229491)];\n                    defunc_0_f_res_219583 = defunc_0_add_arg_219585;\n                }\n                \n                int64_t binop_p_219586 = sub64(defunc_0_f_res_219580,\n                                               index_primexp_228691);\n                double defunc_0_f_res_219587 = sitofp_i64_f64(binop_p_219586);\n                double abs_res_219588 = fabs(defunc_0_f_res_219587);\n                double tmp1_219589 = abs_res_219588 / x_219575;\n                double x_219590 = tmp1_219589 * tmp1_219589;\n                double y_219591 = tmp1_219589 * x_219590;\n                double tmp2_219592 = 1.0 - y_219591;\n                double x_219593 = tmp2_219592 * tmp2_219592;\n                double tmp3_219594 = tmp2_219592 * x_219593;\n                double tmp4_219595 = defunc_0_f_res_219583 * tmp3_219594;\n                double defunc_0_f_res_219596;\n                \n                if (cond_219579) {\n                    defunc_0_f_res_219596 = 0.0;\n                } else {\n                    int64_t i_219597 = add64(gtid_219563, x_219574);\n                    double defunc_0_add_arg_219598;\n                    \n                    defunc_0_add_arg_219598 = ((__global\n                                                double *) mem_230551)[gtid_219561 *\n                                                                      n_203490 +\n                                           ",
            "                           i_219597];\n                    defunc_0_f_res_219596 = defunc_0_add_arg_219598;\n                }\n                \n                double x_219599 = a0_219577 * tmp4_219595;\n                double defunc_9_fit_fun_res_219600 = defunc_0_f_res_219596 *\n                       x_219599;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_234892)[sext_i32_i64(local_tid_234888)] =\n                        defunc_9_fit_fun_res_219600;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_234892)[sext_i32_i64(local_tid_234888)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_l_203495)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_219565;\n                double x_219566;\n                double x_234901;\n                double x_234902;\n                bool ltid_in_bounds_234904 =\n                     slt64(sext_i32_i64(local_tid_234888), q_l_203495 *\n                           squot64(segred_group_sizze_219557,\n                                   segment_sizze_nonzzero_234885));\n                int32_t skip_threads_234905;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_234904) {\n                        x_219566 = ((volatile __local\n                                     double *) red_arr_mem_234892)[sext_i32_i64(local_tid_234888)];\n                        if ((local_tid_234888 - squot32(local_tid_234888, 32) *\n                             32) == 0) {\n                            x_219565 = x_219566;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                ",
            "{\n                    skip_threads_234905 = 1;\n                    while (slt32(skip_threads_234905, 32)) {\n                        bool thread_active_234906 = sle32(skip_threads_234905,\n                                                          local_tid_234888 -\n                                                          squot32(local_tid_234888,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_234904;\n                        \n                        if (thread_active_234906) {\n                            // read operands\n                            {\n                                x_219565 = ((volatile __local\n                                             double *) red_arr_mem_234892)[sext_i32_i64(local_tid_234888) -\n                                                                           sext_i32_i64(skip_threads_234905)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_234907 =\n                                 slt64(srem64(sext_i32_i64(local_tid_234888),\n                                              q_l_203495),\n                                       sext_i32_i64(local_tid_234888) -\n                                       sext_i32_i64(local_tid_234888 -\n                                       skip_threads_234905));\n                            \n                            if (thread_active_234906 && inactive_234907) {\n                                x_219565 = x_219566;\n                            }\n                            if (thread_active_234906) {\n                                if (!inactive_234907) {\n                                    double defunc_1_op_res_219567 = x_219565 +\n                                           x_219566;\n                                    \n                                    x_219565 = defunc_1_op_res_219567;\n                             ",
            "   }\n                            }\n                        }\n                        if (sle32(wave_sizze_234890, skip_threads_234905)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_234906) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_234892)[sext_i32_i64(local_tid_234888)] =\n                                    x_219565;\n                                x_219566 = x_219565;\n                            }\n                        }\n                        if (sle32(wave_sizze_234890, skip_threads_234905)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_234905 *= 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_234888 - squot32(local_tid_234888, 32) *\n                         32) == 31 && ltid_in_bounds_234904) {\n                        ((volatile __local\n                          double *) red_arr_mem_234892)[sext_i32_i64(squot32(local_tid_234888,\n                                                                             32))] =\n                            x_219565;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n                {\n                    int32_t skip_threads_234908;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_234888, 32) == 0 &&\n                            ltid_in_bounds_234904) {\n                            x_234902 = ((volatile __local\n                                  ",
            "       double *) red_arr_mem_234892)[sext_i32_i64(local_tid_234888)];\n                            if ((local_tid_234888 - squot32(local_tid_234888,\n                                                            32) * 32) == 0) {\n                                x_234901 = x_234902;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_234908 = 1;\n                        while (slt32(skip_threads_234908, 32)) {\n                            bool thread_active_234909 =\n                                 sle32(skip_threads_234908, local_tid_234888 -\n                                       squot32(local_tid_234888, 32) * 32) &&\n                                 (squot32(local_tid_234888, 32) == 0 &&\n                                  ltid_in_bounds_234904);\n                            \n                            if (thread_active_234909) {\n                                // read operands\n                                {\n                                    x_234901 = ((volatile __local\n                                                 double *) red_arr_mem_234892)[sext_i32_i64(local_tid_234888) -\n                                                                               sext_i32_i64(skip_threads_234908)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_234910 =\n                                     slt64(srem64(sext_i32_i64(local_tid_234888 *\n                                                  32 + 32 - 1), q_l_203495),\n                                           sext_i32_i64(local_tid_234888 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_234888 -\n                                                         skip_threads",
            "_234908) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_234909 && inactive_234910) {\n                                    x_234901 = x_234902;\n                                }\n                                if (thread_active_234909) {\n                                    if (!inactive_234910) {\n                                        double defunc_1_op_res_234903 =\n                                               x_234901 + x_234902;\n                                        \n                                        x_234901 = defunc_1_op_res_234903;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_234890, skip_threads_234908)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_234909) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_234892)[sext_i32_i64(local_tid_234888)] =\n                                        x_234901;\n                                    x_234902 = x_234901;\n                                }\n                            }\n                            if (sle32(wave_sizze_234890, skip_threads_234908)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_234908 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_234911 = squot32(local_tid_234888, 32) == 0 ||\n                     !ltid_in_bounds_234904;\n                \n                // carry-in for every block except the first\n                {\n                    // read operan",
            "ds\n                    {\n                        if (!no_carry_in_234911) {\n                            x_219566 = x_219565;\n                            x_219565 = ((__local\n                                         double *) red_arr_mem_234892)[sext_i32_i64(squot32(local_tid_234888,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_234912 =\n                             slt64(srem64(sext_i32_i64(local_tid_234888),\n                                          q_l_203495),\n                                   sext_i32_i64(local_tid_234888) -\n                                   sext_i32_i64(squot32(local_tid_234888, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_234911) {\n                            if (inactive_234912) {\n                                x_219565 = x_219566;\n                            }\n                        }\n                        if (!no_carry_in_234911) {\n                            if (!inactive_234912) {\n                                double defunc_1_op_res_219567 = x_219565 +\n                                       x_219566;\n                                \n                                x_219565 = defunc_1_op_res_219567;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_234911) {\n                            ((__local\n                              double *) red_arr_mem_234892)[sext_i32_i64(local_tid_234888)] =\n                                x_219565;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n          ",
            "      // restore correct values for first block\n                {\n                    if (squot32(local_tid_234888, 32) == 0 &&\n                        ltid_in_bounds_234904) {\n                        ((__local\n                          double *) red_arr_mem_234892)[sext_i32_i64(local_tid_234888)] =\n                            x_219566;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // save final values of segments\n        {\n            if (slt64(sext_i32_i64(virt_group_id_234896) *\n                      squot64(segred_group_sizze_219557,\n                              segment_sizze_nonzzero_234885) +\n                      sext_i32_i64(local_tid_234888), partition_sizze_203577 *\n                      l_n_m_203643) && slt64(sext_i32_i64(local_tid_234888),\n                                             squot64(segred_group_sizze_219557,\n                                                     segment_sizze_nonzzero_234885))) {\n                double tmp_234913;\n                \n                tmp_234913 = ((__local\n                               double *) red_arr_mem_234892)[(sext_i32_i64(local_tid_234888) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_234885 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230606)[squot64(sext_i32_i64(virt_group_id_234896) *\n                                                squot64(segred_group_sizze_219557,\n                                                        segment_sizze_nonzzero_234885) +\n                                                sext_i32_i64(local_tid_234888),\n                                                l_n_m_203643) * l_n_m_203643 +\n                                        (sext_i32_i64(virt_group_id_234896) *\n       ",
            "                                  squot64(segred_group_sizze_219557,\n                                                 segment_sizze_nonzzero_234885) +\n                                         sext_i32_i64(local_tid_234888) -\n                                         squot64(sext_i32_i64(virt_group_id_234896) *\n                                                 squot64(segred_group_sizze_219557,\n                                                         segment_sizze_nonzzero_234885) +\n                                                 sext_i32_i64(local_tid_234888),\n                                                 l_n_m_203643) *\n                                         l_n_m_203643)] = tmp_234913;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_219557\n}\n__kernel void mainzisegred_small_220344(__global int *global_failure,\n                                        uint red_arr_mem_235022_backing_offset_0,\n                                        uint red_arr_mem_235020_backing_offset_1,\n                                        uint red_arr_mem_235018_backing_offset_2,\n                                        int64_t n_203490, int64_t q_l_203495,\n                                        int64_t jump_t_203500,\n                                        int64_t partition_sizze_203577,\n                                        int64_t l_n_m_203643, int64_t i_203670,\n                                        int64_t num_groups_220336,\n                                        int64_t ctx_param_ext_229488,\n                                        int64_t ctx_param_ext_229489,\n                                        int64_t ctx_param_ext_229491,\n                                        int64_t segment_sizze_nonzzero_235011,\n                                        __global unsigned char *ext_mem_229411,\n                                        __global unsigned ",
            "char *ext_mem_229412,\n                                        __global\n                                        unsigned char *mem_param_229493,\n                                        __global unsigned char *mem_230676,\n                                        __global unsigned char *mem_230680,\n                                        __global unsigned char *mem_230684)\n{\n    #define segred_group_sizze_220335 (mainzisegred_group_sizze_220012)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_235022_backing_2 =\n                           &shared_mem[red_arr_mem_235022_backing_offset_0];\n    volatile unsigned char *red_arr_mem_235020_backing_1 =\n                           &shared_mem[red_arr_mem_235020_backing_offset_1];\n    volatile unsigned char *red_arr_mem_235018_backing_0 =\n                           &shared_mem[red_arr_mem_235018_backing_offset_2];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235013;\n    int32_t local_tid_235014;\n    int64_t group_sizze_235017;\n    int32_t wave_sizze_235016;\n    int32_t group_tid_235015;\n    \n    global_tid_235013 = get_global_id(0);\n    local_tid_235014 = get_local_id(0);\n    group_sizze_235017 = get_local_size(0);\n    wave_sizze_235016 = LOCKSTEP_WIDTH;\n    group_tid_235015 = get_group_id(0);\n    \n    int32_t phys_tid_220344 = global_tid_235013;\n    __local unsigned char *red_arr_mem_235018;\n    \n    red_arr_mem_235018 = (__local unsigned char *) red_arr_mem_235018_backing_0;\n    \n    __local unsigned char *red_arr_mem_235020;\n    \n    red_arr_mem_235020 = (__local unsigned char *) red_arr_mem_235020_backing_1;\n    \n    __local unsigned char *red_arr_mem_235022;\n    \n    red_arr_mem_235022 = (__local unsigned char *) red_arr_mem_235022_backing_2;\n    \n    int32_t phys_group_id_235024;\n    \n    phys_group_id_235024 = get_group_id(0);\n    for (int32_t i_235025 = 0; i_235025 <\n         sdiv_up32(sext_i64_i32(sdiv_",
            "up64(partition_sizze_203577 * l_n_m_203643,\n                                          squot64(segred_group_sizze_220335,\n                                                  segment_sizze_nonzzero_235011))) -\n                   phys_group_id_235024, sext_i64_i32(num_groups_220336));\n         i_235025++) {\n        int32_t virt_group_id_235026 = phys_group_id_235024 + i_235025 *\n                sext_i64_i32(num_groups_220336);\n        int64_t slice_235027 = l_n_m_203643;\n        int64_t slice_235028 = partition_sizze_203577 * slice_235027;\n        int64_t gtid_220341 = squot64(squot64(sext_i32_i64(local_tid_235014),\n                                              segment_sizze_nonzzero_235011) +\n                                      sext_i32_i64(virt_group_id_235026) *\n                                      squot64(segred_group_sizze_220335,\n                                              segment_sizze_nonzzero_235011),\n                                      slice_235027);\n        int64_t remnant_235029 = squot64(sext_i32_i64(local_tid_235014),\n                                         segment_sizze_nonzzero_235011) +\n                sext_i32_i64(virt_group_id_235026) *\n                squot64(segred_group_sizze_220335,\n                        segment_sizze_nonzzero_235011) - gtid_220341 *\n                slice_235027;\n        int64_t gtid_220342 = remnant_235029;\n        int64_t remnant_235030 = remnant_235029 - gtid_220342;\n        int64_t gtid_220343 = srem64(sext_i32_i64(local_tid_235014),\n                                     q_l_203495);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_l_203495) && ((slt64(gtid_220341,\n                                                          partition_sizze_203577) &&\n                                                    slt64(gtid_220342,\n                                                          l_n_m_203643)) &&\n                                                   slt64(sext_i32_i64(local_ti",
            "d_235014),\n                                                         q_l_203495 *\n                                                         squot64(segred_group_sizze_220335,\n                                                                 segment_sizze_nonzzero_235011)))) {\n                int64_t x_220358;\n                \n                x_220358 = ((__global int64_t *) ext_mem_229412)[gtid_220341 *\n                                                                 l_n_m_203643 +\n                                                                 gtid_220342];\n                \n                double x_220359;\n                \n                x_220359 = ((__global double *) ext_mem_229411)[gtid_220341 *\n                                                                l_n_m_203643 +\n                                                                gtid_220342];\n                \n                int64_t binop_y_228704 = mul64(jump_t_203500, gtid_220342);\n                int64_t binop_y_228705 = smin64(i_203670, binop_y_228704);\n                int64_t index_primexp_228706 = add64((int64_t) 1,\n                                                     binop_y_228705);\n                bool cond_220362 = sle64(n_203490, gtid_220343);\n                int64_t defunc_0_f_res_220363;\n                \n                if (cond_220362) {\n                    defunc_0_f_res_220363 = (int64_t) 0;\n                } else {\n                    int64_t i_220364 = add64(gtid_220343, x_220358);\n                    int64_t defunc_1_add_res_220365 = add64((int64_t) 1,\n                                                            i_220364);\n                    \n                    defunc_0_f_res_220363 = defunc_1_add_res_220365;\n                }\n                \n                double defunc_0_f_res_220366;\n                \n                if (cond_220362) {\n                    defunc_0_f_res_220366 = 0.0;\n                } else {\n                    int64_t i_220367 = add64(gtid_220343, x_220358);\n      ",
            "              double defunc_0_add_arg_220368;\n                    \n                    defunc_0_add_arg_220368 = ((__global\n                                                double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                                            (gtid_220341 *\n                                                                             ctx_param_ext_229489 +\n                                                                             i_220367 *\n                                                                             ctx_param_ext_229491)];\n                    defunc_0_f_res_220366 = defunc_0_add_arg_220368;\n                }\n                \n                int64_t binop_p_220369 = sub64(defunc_0_f_res_220363,\n                                               index_primexp_228706);\n                double defunc_0_f_res_220370 = sitofp_i64_f64(binop_p_220369);\n                double abs_res_220371 = fabs(defunc_0_f_res_220370);\n                double tmp1_220372 = abs_res_220371 / x_220359;\n                double x_220373 = tmp1_220372 * tmp1_220372;\n                double y_220374 = tmp1_220372 * x_220373;\n                double tmp2_220375 = 1.0 - y_220374;\n                double x_220376 = tmp2_220375 * tmp2_220375;\n                double tmp3_220377 = tmp2_220375 * x_220376;\n                double w_j_220378 = defunc_0_f_res_220366 * tmp3_220377;\n                double xw_j_220379 = defunc_0_f_res_220370 * w_j_220378;\n                double x2w_j_220380 = defunc_0_f_res_220370 * xw_j_220379;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_235018)[sext_i32_i64(local_tid_235014)] =\n                        w_j_220378;\n                    ((__local\n                      double *) red_arr_mem_235020)[sext_i32_i64(local_tid_235014)] =\n                 ",
            "       xw_j_220379;\n                    ((__local\n                      double *) red_arr_mem_235022)[sext_i32_i64(local_tid_235014)] =\n                        x2w_j_220380;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_235018)[sext_i32_i64(local_tid_235014)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_235020)[sext_i32_i64(local_tid_235014)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_235022)[sext_i32_i64(local_tid_235014)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_l_203495)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_220345;\n                double x_220346;\n                double x_220347;\n                double x_220348;\n                double x_220349;\n                double x_220350;\n                double x_235031;\n                double x_235032;\n                double x_235033;\n                double x_235034;\n                double x_235035;\n                double x_235036;\n                bool ltid_in_bounds_235040 =\n                     slt64(sext_i32_i64(local_tid_235014), q_l_203495 *\n                           squot64(segred_group_sizze_220335,\n                                   segment_sizze_nonzzero_235011));\n                int32_t skip_threads_235041;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_235040) {\n                        x_220348 = ((volatile __local\n                                     double *) red_arr_mem_235018)[sext_i32_i64(local_tid_235014)];\n                        x_220349 = ((volatile __local\n                                     double *) red_arr_mem_235020)[sext_i32_i64(local_tid_235014)];\n                        x_220350 = ((volatile __local\n                         ",
            "            double *) red_arr_mem_235022)[sext_i32_i64(local_tid_235014)];\n                        if ((local_tid_235014 - squot32(local_tid_235014, 32) *\n                             32) == 0) {\n                            x_220345 = x_220348;\n                            x_220346 = x_220349;\n                            x_220347 = x_220350;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_235041 = 1;\n                    while (slt32(skip_threads_235041, 32)) {\n                        bool thread_active_235042 = sle32(skip_threads_235041,\n                                                          local_tid_235014 -\n                                                          squot32(local_tid_235014,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_235040;\n                        \n                        if (thread_active_235042) {\n                            // read operands\n                            {\n                                x_220345 = ((volatile __local\n                                             double *) red_arr_mem_235018)[sext_i32_i64(local_tid_235014) -\n                                                                           sext_i32_i64(skip_threads_235041)];\n                                x_220346 = ((volatile __local\n                                             double *) red_arr_mem_235020)[sext_i32_i64(local_tid_235014) -\n                                                                           sext_i32_i64(skip_threads_235041)];\n                                x_220347 = ((volatile __local\n                                             double *) red_arr_mem_235022)[sext_i32_i64(local_tid_235014) -\n                                                                           sext_i32_i64(skip_threads_235041)];\n                            }\n       ",
            "                 }\n                        // perform operation\n                        {\n                            bool inactive_235043 =\n                                 slt64(srem64(sext_i32_i64(local_tid_235014),\n                                              q_l_203495),\n                                       sext_i32_i64(local_tid_235014) -\n                                       sext_i32_i64(local_tid_235014 -\n                                       skip_threads_235041));\n                            \n                            if (thread_active_235042 && inactive_235043) {\n                                x_220345 = x_220348;\n                                x_220346 = x_220349;\n                                x_220347 = x_220350;\n                            }\n                            if (thread_active_235042) {\n                                if (!inactive_235043) {\n                                    double defunc_1_op_res_220351 = x_220345 +\n                                           x_220348;\n                                    double defunc_1_op_res_220352 = x_220346 +\n                                           x_220349;\n                                    double defunc_1_op_res_220353 = x_220347 +\n                                           x_220350;\n                                    \n                                    x_220345 = defunc_1_op_res_220351;\n                                    x_220346 = defunc_1_op_res_220352;\n                                    x_220347 = defunc_1_op_res_220353;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_235016, skip_threads_235041)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_235042) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  doub",
            "le *) red_arr_mem_235018)[sext_i32_i64(local_tid_235014)] =\n                                    x_220345;\n                                x_220348 = x_220345;\n                                ((volatile __local\n                                  double *) red_arr_mem_235020)[sext_i32_i64(local_tid_235014)] =\n                                    x_220346;\n                                x_220349 = x_220346;\n                                ((volatile __local\n                                  double *) red_arr_mem_235022)[sext_i32_i64(local_tid_235014)] =\n                                    x_220347;\n                                x_220350 = x_220347;\n                            }\n                        }\n                        if (sle32(wave_sizze_235016, skip_threads_235041)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_235041 *= 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_235014 - squot32(local_tid_235014, 32) *\n                         32) == 31 && ltid_in_bounds_235040) {\n                        ((volatile __local\n                          double *) red_arr_mem_235018)[sext_i32_i64(squot32(local_tid_235014,\n                                                                             32))] =\n                            x_220345;\n                        ((volatile __local\n                          double *) red_arr_mem_235020)[sext_i32_i64(squot32(local_tid_235014,\n                                                                             32))] =\n                            x_220346;\n                        ((volatile __local\n                          double *) red_arr_mem_235022)[sext_i32_i64(squot32(local_tid_235014,\n                                                                             32))] =\n              ",
            "              x_220347;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n                {\n                    int32_t skip_threads_235044;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_235014, 32) == 0 &&\n                            ltid_in_bounds_235040) {\n                            x_235034 = ((volatile __local\n                                         double *) red_arr_mem_235018)[sext_i32_i64(local_tid_235014)];\n                            x_235035 = ((volatile __local\n                                         double *) red_arr_mem_235020)[sext_i32_i64(local_tid_235014)];\n                            x_235036 = ((volatile __local\n                                         double *) red_arr_mem_235022)[sext_i32_i64(local_tid_235014)];\n                            if ((local_tid_235014 - squot32(local_tid_235014,\n                                                            32) * 32) == 0) {\n                                x_235031 = x_235034;\n                                x_235032 = x_235035;\n                                x_235033 = x_235036;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_235044 = 1;\n                        while (slt32(skip_threads_235044, 32)) {\n                            bool thread_active_235045 =\n                                 sle32(skip_threads_235044, local_tid_235014 -\n                                       squot32(local_tid_235014, 32) * 32) &&\n                                 (squot32(local_tid_235014, 32) == 0 &&\n                                  ltid_in_bounds_235040);\n                            \n                            if (thread_active_235045) {\n",
            "                                // read operands\n                                {\n                                    x_235031 = ((volatile __local\n                                                 double *) red_arr_mem_235018)[sext_i32_i64(local_tid_235014) -\n                                                                               sext_i32_i64(skip_threads_235044)];\n                                    x_235032 = ((volatile __local\n                                                 double *) red_arr_mem_235020)[sext_i32_i64(local_tid_235014) -\n                                                                               sext_i32_i64(skip_threads_235044)];\n                                    x_235033 = ((volatile __local\n                                                 double *) red_arr_mem_235022)[sext_i32_i64(local_tid_235014) -\n                                                                               sext_i32_i64(skip_threads_235044)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_235046 =\n                                     slt64(srem64(sext_i32_i64(local_tid_235014 *\n                                                  32 + 32 - 1), q_l_203495),\n                                           sext_i32_i64(local_tid_235014 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_235014 -\n                                                         skip_threads_235044) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_235045 && inactive_235046) {\n                                    x_235031 = x_235034;\n                                    x_235032 = x_235035;\n                                    x_235033 = x_235036;\n                                }\n                 ",
            "               if (thread_active_235045) {\n                                    if (!inactive_235046) {\n                                        double defunc_1_op_res_235037 =\n                                               x_235031 + x_235034;\n                                        double defunc_1_op_res_235038 =\n                                               x_235032 + x_235035;\n                                        double defunc_1_op_res_235039 =\n                                               x_235033 + x_235036;\n                                        \n                                        x_235031 = defunc_1_op_res_235037;\n                                        x_235032 = defunc_1_op_res_235038;\n                                        x_235033 = defunc_1_op_res_235039;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_235016, skip_threads_235044)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_235045) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_235018)[sext_i32_i64(local_tid_235014)] =\n                                        x_235031;\n                                    x_235034 = x_235031;\n                                    ((volatile __local\n                                      double *) red_arr_mem_235020)[sext_i32_i64(local_tid_235014)] =\n                                        x_235032;\n                                    x_235035 = x_235032;\n                                    ((volatile __local\n                                      double *) red_arr_mem_235022)[sext_i32_i64(local_tid_235014)] =\n                                        x_235033;\n                                    x_235036 = x_235033;\n      ",
            "                          }\n                            }\n                            if (sle32(wave_sizze_235016, skip_threads_235044)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_235044 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_235047 = squot32(local_tid_235014, 32) == 0 ||\n                     !ltid_in_bounds_235040;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_235047) {\n                            x_220348 = x_220345;\n                            x_220349 = x_220346;\n                            x_220350 = x_220347;\n                            x_220345 = ((__local\n                                         double *) red_arr_mem_235018)[sext_i32_i64(squot32(local_tid_235014,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_220346 = ((__local\n                                         double *) red_arr_mem_235020)[sext_i32_i64(squot32(local_tid_235014,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_220347 = ((__local\n                                         double *) red_arr_mem_235022)[sext_i32_i64(squot32(local_tid_235014,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform ",
            "operation\n                    {\n                        bool inactive_235048 =\n                             slt64(srem64(sext_i32_i64(local_tid_235014),\n                                          q_l_203495),\n                                   sext_i32_i64(local_tid_235014) -\n                                   sext_i32_i64(squot32(local_tid_235014, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_235047) {\n                            if (inactive_235048) {\n                                x_220345 = x_220348;\n                                x_220346 = x_220349;\n                                x_220347 = x_220350;\n                            }\n                        }\n                        if (!no_carry_in_235047) {\n                            if (!inactive_235048) {\n                                double defunc_1_op_res_220351 = x_220345 +\n                                       x_220348;\n                                double defunc_1_op_res_220352 = x_220346 +\n                                       x_220349;\n                                double defunc_1_op_res_220353 = x_220347 +\n                                       x_220350;\n                                \n                                x_220345 = defunc_1_op_res_220351;\n                                x_220346 = defunc_1_op_res_220352;\n                                x_220347 = defunc_1_op_res_220353;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_235047) {\n                            ((__local\n                              double *) red_arr_mem_235018)[sext_i32_i64(local_tid_235014)] =\n                                x_220345;\n                            ((__local\n                              double *) red_arr_mem_235020)[sext_i32_i64(local_tid_235014)] =\n                                x_220346;\n       ",
            "                     ((__local\n                              double *) red_arr_mem_235022)[sext_i32_i64(local_tid_235014)] =\n                                x_220347;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_235014, 32) == 0 &&\n                        ltid_in_bounds_235040) {\n                        ((__local\n                          double *) red_arr_mem_235018)[sext_i32_i64(local_tid_235014)] =\n                            x_220348;\n                        ((__local\n                          double *) red_arr_mem_235020)[sext_i32_i64(local_tid_235014)] =\n                            x_220349;\n                        ((__local\n                          double *) red_arr_mem_235022)[sext_i32_i64(local_tid_235014)] =\n                            x_220350;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // save final values of segments\n        {\n            if (slt64(sext_i32_i64(virt_group_id_235026) *\n                      squot64(segred_group_sizze_220335,\n                              segment_sizze_nonzzero_235011) +\n                      sext_i32_i64(local_tid_235014), partition_sizze_203577 *\n                      l_n_m_203643) && slt64(sext_i32_i64(local_tid_235014),\n                                             squot64(segred_group_sizze_220335,\n                                                     segment_sizze_nonzzero_235011))) {\n                double tmp_235049;\n                \n                tmp_235049 = ((__local\n                               double *) red_arr_mem_235018)[(sext_i32_i64(local_tid_235014) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero",
            "_235011 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230676)[squot64(sext_i32_i64(virt_group_id_235026) *\n                                                squot64(segred_group_sizze_220335,\n                                                        segment_sizze_nonzzero_235011) +\n                                                sext_i32_i64(local_tid_235014),\n                                                l_n_m_203643) * l_n_m_203643 +\n                                        (sext_i32_i64(virt_group_id_235026) *\n                                         squot64(segred_group_sizze_220335,\n                                                 segment_sizze_nonzzero_235011) +\n                                         sext_i32_i64(local_tid_235014) -\n                                         squot64(sext_i32_i64(virt_group_id_235026) *\n                                                 squot64(segred_group_sizze_220335,\n                                                         segment_sizze_nonzzero_235011) +\n                                                 sext_i32_i64(local_tid_235014),\n                                                 l_n_m_203643) *\n                                         l_n_m_203643)] = tmp_235049;\n                \n                double tmp_235050;\n                \n                tmp_235050 = ((__local\n                               double *) red_arr_mem_235020)[(sext_i32_i64(local_tid_235014) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_235011 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230680)[squot64(sext_i32_i64(virt_group_id_235026) *\n                                                squot64(segred_group_sizze_220335,\n                                           ",
            "             segment_sizze_nonzzero_235011) +\n                                                sext_i32_i64(local_tid_235014),\n                                                l_n_m_203643) * l_n_m_203643 +\n                                        (sext_i32_i64(virt_group_id_235026) *\n                                         squot64(segred_group_sizze_220335,\n                                                 segment_sizze_nonzzero_235011) +\n                                         sext_i32_i64(local_tid_235014) -\n                                         squot64(sext_i32_i64(virt_group_id_235026) *\n                                                 squot64(segred_group_sizze_220335,\n                                                         segment_sizze_nonzzero_235011) +\n                                                 sext_i32_i64(local_tid_235014),\n                                                 l_n_m_203643) *\n                                         l_n_m_203643)] = tmp_235050;\n                \n                double tmp_235051;\n                \n                tmp_235051 = ((__local\n                               double *) red_arr_mem_235022)[(sext_i32_i64(local_tid_235014) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_235011 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230684)[squot64(sext_i32_i64(virt_group_id_235026) *\n                                                squot64(segred_group_sizze_220335,\n                                                        segment_sizze_nonzzero_235011) +\n                                                sext_i32_i64(local_tid_235014),\n                                                l_n_m_203643) * l_n_m_203643 +\n                                        (sext_i32_i64(virt_group_id_235026) *\n                                        ",
            " squot64(segred_group_sizze_220335,\n                                                 segment_sizze_nonzzero_235011) +\n                                         sext_i32_i64(local_tid_235014) -\n                                         squot64(sext_i32_i64(virt_group_id_235026) *\n                                                 squot64(segred_group_sizze_220335,\n                                                         segment_sizze_nonzzero_235011) +\n                                                 sext_i32_i64(local_tid_235014),\n                                                 l_n_m_203643) *\n                                         l_n_m_203643)] = tmp_235051;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_220335\n}\n__kernel void mainzisegred_small_220413(__global int *global_failure,\n                                        uint red_arr_mem_235130_backing_offset_0,\n                                        uint red_arr_mem_235128_backing_offset_1,\n                                        int64_t n_203490, int64_t q_l_203495,\n                                        int64_t jump_t_203500,\n                                        int64_t partition_sizze_203577,\n                                        int64_t l_n_m_203643, int64_t i_203670,\n                                        int64_t num_groups_220406,\n                                        int64_t ctx_param_ext_229488,\n                                        int64_t ctx_param_ext_229489,\n                                        int64_t ctx_param_ext_229491,\n                                        int64_t segment_sizze_nonzzero_235121,\n                                        __global unsigned char *ext_mem_229411,\n                                        __global unsigned char *ext_mem_229412,\n                                        __global\n                                        unsi",
            "gned char *mem_param_229493,\n                                        __global unsigned char *mem_230551,\n                                        __global unsigned char *mem_230689,\n                                        __global unsigned char *mem_230693,\n                                        __global unsigned char *mem_230697,\n                                        __global unsigned char *mem_230702,\n                                        __global unsigned char *mem_230706)\n{\n    #define segred_group_sizze_220405 (mainzisegred_group_sizze_219918)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_235130_backing_1 =\n                           &shared_mem[red_arr_mem_235130_backing_offset_0];\n    volatile unsigned char *red_arr_mem_235128_backing_0 =\n                           &shared_mem[red_arr_mem_235128_backing_offset_1];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235123;\n    int32_t local_tid_235124;\n    int64_t group_sizze_235127;\n    int32_t wave_sizze_235126;\n    int32_t group_tid_235125;\n    \n    global_tid_235123 = get_global_id(0);\n    local_tid_235124 = get_local_id(0);\n    group_sizze_235127 = get_local_size(0);\n    wave_sizze_235126 = LOCKSTEP_WIDTH;\n    group_tid_235125 = get_group_id(0);\n    \n    int32_t phys_tid_220413 = global_tid_235123;\n    __local unsigned char *red_arr_mem_235128;\n    \n    red_arr_mem_235128 = (__local unsigned char *) red_arr_mem_235128_backing_0;\n    \n    __local unsigned char *red_arr_mem_235130;\n    \n    red_arr_mem_235130 = (__local unsigned char *) red_arr_mem_235130_backing_1;\n    \n    int32_t phys_group_id_235132;\n    \n    phys_group_id_235132 = get_group_id(0);\n    for (int32_t i_235133 = 0; i_235133 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577 * l_n_m_203643,\n                                          squot64(segred_group_sizze_220405,\n                                        ",
            "          segment_sizze_nonzzero_235121))) -\n                   phys_group_id_235132, sext_i64_i32(num_groups_220406));\n         i_235133++) {\n        int32_t virt_group_id_235134 = phys_group_id_235132 + i_235133 *\n                sext_i64_i32(num_groups_220406);\n        int64_t slice_235135 = l_n_m_203643;\n        int64_t slice_235136 = partition_sizze_203577 * slice_235135;\n        int64_t gtid_220410 = squot64(squot64(sext_i32_i64(local_tid_235124),\n                                              segment_sizze_nonzzero_235121) +\n                                      sext_i32_i64(virt_group_id_235134) *\n                                      squot64(segred_group_sizze_220405,\n                                              segment_sizze_nonzzero_235121),\n                                      slice_235135);\n        int64_t remnant_235137 = squot64(sext_i32_i64(local_tid_235124),\n                                         segment_sizze_nonzzero_235121) +\n                sext_i32_i64(virt_group_id_235134) *\n                squot64(segred_group_sizze_220405,\n                        segment_sizze_nonzzero_235121) - gtid_220410 *\n                slice_235135;\n        int64_t gtid_220411 = remnant_235137;\n        int64_t remnant_235138 = remnant_235137 - gtid_220411;\n        int64_t gtid_220412 = srem64(sext_i32_i64(local_tid_235124),\n                                     q_l_203495);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_l_203495) && ((slt64(gtid_220410,\n                                                          partition_sizze_203577) &&\n                                                    slt64(gtid_220411,\n                                                          l_n_m_203643)) &&\n                                                   slt64(sext_i32_i64(local_tid_235124),\n                                                         q_l_203495 *\n                                                         squot64(segred_group_si",
            "zze_220405,\n                                                                 segment_sizze_nonzzero_235121)))) {\n                int64_t x_220428;\n                \n                x_220428 = ((__global int64_t *) ext_mem_229412)[gtid_220410 *\n                                                                 l_n_m_203643 +\n                                                                 gtid_220411];\n                \n                double x_220429;\n                \n                x_220429 = ((__global double *) ext_mem_229411)[gtid_220410 *\n                                                                l_n_m_203643 +\n                                                                gtid_220411];\n                \n                int64_t binop_y_228699 = mul64(jump_t_203500, gtid_220411);\n                int64_t binop_y_228700 = smin64(i_203670, binop_y_228699);\n                int64_t index_primexp_228701 = add64((int64_t) 1,\n                                                     binop_y_228700);\n                double a11_220431;\n                \n                a11_220431 = ((__global double *) mem_230689)[gtid_220410 *\n                                                              l_n_m_203643 +\n                                                              gtid_220411];\n                \n                double b11_220432;\n                \n                b11_220432 = ((__global double *) mem_230693)[gtid_220410 *\n                                                              l_n_m_203643 +\n                                                              gtid_220411];\n                \n                double c11_220433;\n                \n                c11_220433 = ((__global double *) mem_230697)[gtid_220410 *\n                                                              l_n_m_203643 +\n                                                              gtid_220411];\n                \n                bool cond_220435 = sle64(n_203490, gtid_220412);\n                int64_t defunc_0_",
            "f_res_220436;\n                \n                if (cond_220435) {\n                    defunc_0_f_res_220436 = (int64_t) 0;\n                } else {\n                    int64_t i_220437 = add64(gtid_220412, x_220428);\n                    int64_t defunc_1_add_res_220438 = add64((int64_t) 1,\n                                                            i_220437);\n                    \n                    defunc_0_f_res_220436 = defunc_1_add_res_220438;\n                }\n                \n                double defunc_0_f_res_220439;\n                \n                if (cond_220435) {\n                    defunc_0_f_res_220439 = 0.0;\n                } else {\n                    int64_t i_220440 = add64(gtid_220412, x_220428);\n                    double defunc_0_add_arg_220441;\n                    \n                    defunc_0_add_arg_220441 = ((__global\n                                                double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                                            (gtid_220410 *\n                                                                             ctx_param_ext_229489 +\n                                                                             i_220440 *\n                                                                             ctx_param_ext_229491)];\n                    defunc_0_f_res_220439 = defunc_0_add_arg_220441;\n                }\n                \n                int64_t binop_p_220442 = sub64(defunc_0_f_res_220436,\n                                               index_primexp_228701);\n                double defunc_0_f_res_220443 = sitofp_i64_f64(binop_p_220442);\n                double abs_res_220444 = fabs(defunc_0_f_res_220443);\n                double tmp1_220445 = abs_res_220444 / x_220429;\n                double x_220446 = tmp1_220445 * tmp1_220445;\n                double y_220447 = tmp1_220445 * x_220446;\n                double tmp2_220448 = 1.0 - y_220447;\n                double x_220449 = tm",
            "p2_220448 * tmp2_220448;\n                double tmp3_220450 = tmp2_220448 * x_220449;\n                double tmp4_220451 = defunc_0_f_res_220439 * tmp3_220450;\n                double defunc_1_f_res_220452 = defunc_0_f_res_220443 *\n                       tmp4_220451;\n                double defunc_0_f_res_220453;\n                \n                if (cond_220435) {\n                    defunc_0_f_res_220453 = 0.0;\n                } else {\n                    int64_t i_220454 = add64(gtid_220412, x_220428);\n                    double defunc_0_add_arg_220455;\n                    \n                    defunc_0_add_arg_220455 = ((__global\n                                                double *) mem_230551)[gtid_220410 *\n                                                                      n_203490 +\n                                                                      i_220454];\n                    defunc_0_f_res_220453 = defunc_0_add_arg_220455;\n                }\n                \n                double x_220456 = a11_220431 * tmp4_220451;\n                double y_220457 = b11_220432 * defunc_1_f_res_220452;\n                double x_220458 = x_220456 + y_220457;\n                double defunc_9_fit_fun_res_220459 = defunc_0_f_res_220453 *\n                       x_220458;\n                double x_220460 = b11_220432 * tmp4_220451;\n                double y_220461 = c11_220433 * defunc_1_f_res_220452;\n                double x_220462 = x_220460 + y_220461;\n                double defunc_9_slope_fun_res_220463 = defunc_0_f_res_220453 *\n                       x_220462;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_235128)[sext_i32_i64(local_tid_235124)] =\n                        defunc_9_fit_fun_res_220459;\n                    ((__local\n                      double *) red_arr_mem_235130)[sext_i32_i64(local_tid_23512",
            "4)] =\n                        defunc_9_slope_fun_res_220463;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_235128)[sext_i32_i64(local_tid_235124)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_235130)[sext_i32_i64(local_tid_235124)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_l_203495)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_220414;\n                double x_220415;\n                double x_220416;\n                double x_220417;\n                double x_235139;\n                double x_235140;\n                double x_235141;\n                double x_235142;\n                bool ltid_in_bounds_235145 =\n                     slt64(sext_i32_i64(local_tid_235124), q_l_203495 *\n                           squot64(segred_group_sizze_220405,\n                                   segment_sizze_nonzzero_235121));\n                int32_t skip_threads_235146;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_235145) {\n                        x_220416 = ((volatile __local\n                                     double *) red_arr_mem_235128)[sext_i32_i64(local_tid_235124)];\n                        x_220417 = ((volatile __local\n                                     double *) red_arr_mem_235130)[sext_i32_i64(local_tid_235124)];\n                        if ((local_tid_235124 - squot32(local_tid_235124, 32) *\n                             32) == 0) {\n                            x_220414 = x_220416;\n                            x_220415 = x_220417;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_235146 = 1;\n                    while (slt32(skip_threads",
            "_235146, 32)) {\n                        bool thread_active_235147 = sle32(skip_threads_235146,\n                                                          local_tid_235124 -\n                                                          squot32(local_tid_235124,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_235145;\n                        \n                        if (thread_active_235147) {\n                            // read operands\n                            {\n                                x_220414 = ((volatile __local\n                                             double *) red_arr_mem_235128)[sext_i32_i64(local_tid_235124) -\n                                                                           sext_i32_i64(skip_threads_235146)];\n                                x_220415 = ((volatile __local\n                                             double *) red_arr_mem_235130)[sext_i32_i64(local_tid_235124) -\n                                                                           sext_i32_i64(skip_threads_235146)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_235148 =\n                                 slt64(srem64(sext_i32_i64(local_tid_235124),\n                                              q_l_203495),\n                                       sext_i32_i64(local_tid_235124) -\n                                       sext_i32_i64(local_tid_235124 -\n                                       skip_threads_235146));\n                            \n                            if (thread_active_235147 && inactive_235148) {\n                                x_220414 = x_220416;\n                                x_220415 = x_220417;\n                            }\n                            if (thread_active_235147) {\n                                if (!inactive_235148) {\n                           ",
            "         double defunc_1_op_res_220418 = x_220414 +\n                                           x_220416;\n                                    double defunc_1_op_res_220419 = x_220415 +\n                                           x_220417;\n                                    \n                                    x_220414 = defunc_1_op_res_220418;\n                                    x_220415 = defunc_1_op_res_220419;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_235126, skip_threads_235146)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_235147) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_235128)[sext_i32_i64(local_tid_235124)] =\n                                    x_220414;\n                                x_220416 = x_220414;\n                                ((volatile __local\n                                  double *) red_arr_mem_235130)[sext_i32_i64(local_tid_235124)] =\n                                    x_220415;\n                                x_220417 = x_220415;\n                            }\n                        }\n                        if (sle32(wave_sizze_235126, skip_threads_235146)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_235146 *= 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_235124 - squot32(local_tid_235124, 32) *\n                         32) == 31 && ltid_in_bounds_235145) {\n                        ((volatile __local\n                          double *) red_arr_mem_235128)[sext_i32_i64(squot32(local",
            "_tid_235124,\n                                                                             32))] =\n                            x_220414;\n                        ((volatile __local\n                          double *) red_arr_mem_235130)[sext_i32_i64(squot32(local_tid_235124,\n                                                                             32))] =\n                            x_220415;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n                {\n                    int32_t skip_threads_235149;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_235124, 32) == 0 &&\n                            ltid_in_bounds_235145) {\n                            x_235141 = ((volatile __local\n                                         double *) red_arr_mem_235128)[sext_i32_i64(local_tid_235124)];\n                            x_235142 = ((volatile __local\n                                         double *) red_arr_mem_235130)[sext_i32_i64(local_tid_235124)];\n                            if ((local_tid_235124 - squot32(local_tid_235124,\n                                                            32) * 32) == 0) {\n                                x_235139 = x_235141;\n                                x_235140 = x_235142;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_235149 = 1;\n                        while (slt32(skip_threads_235149, 32)) {\n                            bool thread_active_235150 =\n                                 sle32(skip_threads_235149, local_tid_235124 -\n                                       squot32(local_tid_235124, 32) * 32) &&\n                                 (squot32(local_tid_23512",
            "4, 32) == 0 &&\n                                  ltid_in_bounds_235145);\n                            \n                            if (thread_active_235150) {\n                                // read operands\n                                {\n                                    x_235139 = ((volatile __local\n                                                 double *) red_arr_mem_235128)[sext_i32_i64(local_tid_235124) -\n                                                                               sext_i32_i64(skip_threads_235149)];\n                                    x_235140 = ((volatile __local\n                                                 double *) red_arr_mem_235130)[sext_i32_i64(local_tid_235124) -\n                                                                               sext_i32_i64(skip_threads_235149)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_235151 =\n                                     slt64(srem64(sext_i32_i64(local_tid_235124 *\n                                                  32 + 32 - 1), q_l_203495),\n                                           sext_i32_i64(local_tid_235124 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_235124 -\n                                                         skip_threads_235149) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_235150 && inactive_235151) {\n                                    x_235139 = x_235141;\n                                    x_235140 = x_235142;\n                                }\n                                if (thread_active_235150) {\n                                    if (!inactive_235151) {\n                                        double defunc_1_op_res_235143 =\n                 ",
            "                              x_235139 + x_235141;\n                                        double defunc_1_op_res_235144 =\n                                               x_235140 + x_235142;\n                                        \n                                        x_235139 = defunc_1_op_res_235143;\n                                        x_235140 = defunc_1_op_res_235144;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_235126, skip_threads_235149)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_235150) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_235128)[sext_i32_i64(local_tid_235124)] =\n                                        x_235139;\n                                    x_235141 = x_235139;\n                                    ((volatile __local\n                                      double *) red_arr_mem_235130)[sext_i32_i64(local_tid_235124)] =\n                                        x_235140;\n                                    x_235142 = x_235140;\n                                }\n                            }\n                            if (sle32(wave_sizze_235126, skip_threads_235149)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_235149 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_235152 = squot32(local_tid_235124, 32) == 0 ||\n                     !ltid_in_bounds_235145;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands",
            "\n                    {\n                        if (!no_carry_in_235152) {\n                            x_220416 = x_220414;\n                            x_220417 = x_220415;\n                            x_220414 = ((__local\n                                         double *) red_arr_mem_235128)[sext_i32_i64(squot32(local_tid_235124,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_220415 = ((__local\n                                         double *) red_arr_mem_235130)[sext_i32_i64(squot32(local_tid_235124,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_235153 =\n                             slt64(srem64(sext_i32_i64(local_tid_235124),\n                                          q_l_203495),\n                                   sext_i32_i64(local_tid_235124) -\n                                   sext_i32_i64(squot32(local_tid_235124, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_235152) {\n                            if (inactive_235153) {\n                                x_220414 = x_220416;\n                                x_220415 = x_220417;\n                            }\n                        }\n                        if (!no_carry_in_235152) {\n                            if (!inactive_235153) {\n                                double defunc_1_op_res_220418 = x_220414 +\n                                       x_220416;\n                                double defunc_1_op_res_220419 = x_220415 +\n                                       x_220417;\n                      ",
            "          \n                                x_220414 = defunc_1_op_res_220418;\n                                x_220415 = defunc_1_op_res_220419;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_235152) {\n                            ((__local\n                              double *) red_arr_mem_235128)[sext_i32_i64(local_tid_235124)] =\n                                x_220414;\n                            ((__local\n                              double *) red_arr_mem_235130)[sext_i32_i64(local_tid_235124)] =\n                                x_220415;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_235124, 32) == 0 &&\n                        ltid_in_bounds_235145) {\n                        ((__local\n                          double *) red_arr_mem_235128)[sext_i32_i64(local_tid_235124)] =\n                            x_220416;\n                        ((__local\n                          double *) red_arr_mem_235130)[sext_i32_i64(local_tid_235124)] =\n                            x_220417;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // save final values of segments\n        {\n            if (slt64(sext_i32_i64(virt_group_id_235134) *\n                      squot64(segred_group_sizze_220405,\n                              segment_sizze_nonzzero_235121) +\n                      sext_i32_i64(local_tid_235124), partition_sizze_203577 *\n                      l_n_m_203643) && slt64(sext_i32_i64(local_tid_235124),\n                                             squot64(segred_group_sizze_220405,\n                                                     segment_sizze_nonzzero_2",
            "35121))) {\n                double tmp_235154;\n                \n                tmp_235154 = ((__local\n                               double *) red_arr_mem_235128)[(sext_i32_i64(local_tid_235124) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_235121 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230702)[squot64(sext_i32_i64(virt_group_id_235134) *\n                                                squot64(segred_group_sizze_220405,\n                                                        segment_sizze_nonzzero_235121) +\n                                                sext_i32_i64(local_tid_235124),\n                                                l_n_m_203643) * l_n_m_203643 +\n                                        (sext_i32_i64(virt_group_id_235134) *\n                                         squot64(segred_group_sizze_220405,\n                                                 segment_sizze_nonzzero_235121) +\n                                         sext_i32_i64(local_tid_235124) -\n                                         squot64(sext_i32_i64(virt_group_id_235134) *\n                                                 squot64(segred_group_sizze_220405,\n                                                         segment_sizze_nonzzero_235121) +\n                                                 sext_i32_i64(local_tid_235124),\n                                                 l_n_m_203643) *\n                                         l_n_m_203643)] = tmp_235154;\n                \n                double tmp_235155;\n                \n                tmp_235155 = ((__local\n                               double *) red_arr_mem_235130)[(sext_i32_i64(local_tid_235124) +\n                                                              (int64_t) 1) *\n                                                 ",
            "            segment_sizze_nonzzero_235121 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230706)[squot64(sext_i32_i64(virt_group_id_235134) *\n                                                squot64(segred_group_sizze_220405,\n                                                        segment_sizze_nonzzero_235121) +\n                                                sext_i32_i64(local_tid_235124),\n                                                l_n_m_203643) * l_n_m_203643 +\n                                        (sext_i32_i64(virt_group_id_235134) *\n                                         squot64(segred_group_sizze_220405,\n                                                 segment_sizze_nonzzero_235121) +\n                                         sext_i32_i64(local_tid_235124) -\n                                         squot64(sext_i32_i64(virt_group_id_235134) *\n                                                 squot64(segred_group_sizze_220405,\n                                                         segment_sizze_nonzzero_235121) +\n                                                 sext_i32_i64(local_tid_235124),\n                                                 l_n_m_203643) *\n                                         l_n_m_203643)] = tmp_235155;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_220405\n}\n__kernel void mainzisegred_small_221423(__global int *global_failure,\n                                        uint red_arr_mem_235280_backing_offset_0,\n                                        uint red_arr_mem_235278_backing_offset_1,\n                                        uint red_arr_mem_235276_backing_offset_2,\n                                        uint red_arr_mem_235274_backing_offset_3,\n                                        uint red_arr_mem_2",
            "35272_backing_offset_4,\n                                        int64_t n_203490, int64_t q_l_203495,\n                                        int64_t jump_t_203500,\n                                        int64_t partition_sizze_203577,\n                                        int64_t l_n_m_203643, int64_t i_203670,\n                                        int64_t num_groups_221413,\n                                        int64_t ctx_param_ext_229488,\n                                        int64_t ctx_param_ext_229489,\n                                        int64_t ctx_param_ext_229491,\n                                        int64_t segment_sizze_nonzzero_235265,\n                                        __global unsigned char *ext_mem_229411,\n                                        __global unsigned char *ext_mem_229412,\n                                        __global\n                                        unsigned char *mem_param_229493,\n                                        __global unsigned char *mem_230783,\n                                        __global unsigned char *mem_230787,\n                                        __global unsigned char *mem_230791,\n                                        __global unsigned char *mem_230795,\n                                        __global unsigned char *mem_230799)\n{\n    #define segred_group_sizze_221412 (mainzisegred_group_sizze_221009)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_235280_backing_4 =\n                           &shared_mem[red_arr_mem_235280_backing_offset_0];\n    volatile unsigned char *red_arr_mem_235278_backing_3 =\n                           &shared_mem[red_arr_mem_235278_backing_offset_1];\n    volatile unsigned char *red_arr_mem_235276_backing_2 =\n                           &shared_mem[red_arr_mem_235276_backing_offset_2];\n    volatile unsigned char *red_arr_mem_235274_backing_1 =\n                           &s",
            "hared_mem[red_arr_mem_235274_backing_offset_3];\n    volatile unsigned char *red_arr_mem_235272_backing_0 =\n                           &shared_mem[red_arr_mem_235272_backing_offset_4];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235267;\n    int32_t local_tid_235268;\n    int64_t group_sizze_235271;\n    int32_t wave_sizze_235270;\n    int32_t group_tid_235269;\n    \n    global_tid_235267 = get_global_id(0);\n    local_tid_235268 = get_local_id(0);\n    group_sizze_235271 = get_local_size(0);\n    wave_sizze_235270 = LOCKSTEP_WIDTH;\n    group_tid_235269 = get_group_id(0);\n    \n    int32_t phys_tid_221423 = global_tid_235267;\n    __local unsigned char *red_arr_mem_235272;\n    \n    red_arr_mem_235272 = (__local unsigned char *) red_arr_mem_235272_backing_0;\n    \n    __local unsigned char *red_arr_mem_235274;\n    \n    red_arr_mem_235274 = (__local unsigned char *) red_arr_mem_235274_backing_1;\n    \n    __local unsigned char *red_arr_mem_235276;\n    \n    red_arr_mem_235276 = (__local unsigned char *) red_arr_mem_235276_backing_2;\n    \n    __local unsigned char *red_arr_mem_235278;\n    \n    red_arr_mem_235278 = (__local unsigned char *) red_arr_mem_235278_backing_3;\n    \n    __local unsigned char *red_arr_mem_235280;\n    \n    red_arr_mem_235280 = (__local unsigned char *) red_arr_mem_235280_backing_4;\n    \n    int32_t phys_group_id_235282;\n    \n    phys_group_id_235282 = get_group_id(0);\n    for (int32_t i_235283 = 0; i_235283 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577 * l_n_m_203643,\n                                          squot64(segred_group_sizze_221412,\n                                                  segment_sizze_nonzzero_235265))) -\n                   phys_group_id_235282, sext_i64_i32(num_groups_221413));\n         i_235283++) {\n        int32_t virt_group_id_235284 = phys_group_id_235282 + i_235283 *\n                sext_i64_i32(num_groups_221413);\n        int64_t slice_235285 = l_n_m_203643;\n        int64_t sl",
            "ice_235286 = partition_sizze_203577 * slice_235285;\n        int64_t gtid_221420 = squot64(squot64(sext_i32_i64(local_tid_235268),\n                                              segment_sizze_nonzzero_235265) +\n                                      sext_i32_i64(virt_group_id_235284) *\n                                      squot64(segred_group_sizze_221412,\n                                              segment_sizze_nonzzero_235265),\n                                      slice_235285);\n        int64_t remnant_235287 = squot64(sext_i32_i64(local_tid_235268),\n                                         segment_sizze_nonzzero_235265) +\n                sext_i32_i64(virt_group_id_235284) *\n                squot64(segred_group_sizze_221412,\n                        segment_sizze_nonzzero_235265) - gtid_221420 *\n                slice_235285;\n        int64_t gtid_221421 = remnant_235287;\n        int64_t remnant_235288 = remnant_235287 - gtid_221421;\n        int64_t gtid_221422 = srem64(sext_i32_i64(local_tid_235268),\n                                     q_l_203495);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_l_203495) && ((slt64(gtid_221420,\n                                                          partition_sizze_203577) &&\n                                                    slt64(gtid_221421,\n                                                          l_n_m_203643)) &&\n                                                   slt64(sext_i32_i64(local_tid_235268),\n                                                         q_l_203495 *\n                                                         squot64(segred_group_sizze_221412,\n                                                                 segment_sizze_nonzzero_235265)))) {\n                int64_t x_221443;\n                \n                x_221443 = ((__global int64_t *) ext_mem_229412)[gtid_221420 *\n                                                                 l_n_m_203643 +\n     ",
            "                                                            gtid_221421];\n                \n                double x_221444;\n                \n                x_221444 = ((__global double *) ext_mem_229411)[gtid_221420 *\n                                                                l_n_m_203643 +\n                                                                gtid_221421];\n                \n                int64_t binop_y_228714 = mul64(jump_t_203500, gtid_221421);\n                int64_t binop_y_228715 = smin64(i_203670, binop_y_228714);\n                int64_t index_primexp_228716 = add64((int64_t) 1,\n                                                     binop_y_228715);\n                bool cond_221447 = sle64(n_203490, gtid_221422);\n                int64_t defunc_0_f_res_221448;\n                \n                if (cond_221447) {\n                    defunc_0_f_res_221448 = (int64_t) 0;\n                } else {\n                    int64_t i_221449 = add64(gtid_221422, x_221443);\n                    int64_t defunc_1_add_res_221450 = add64((int64_t) 1,\n                                                            i_221449);\n                    \n                    defunc_0_f_res_221448 = defunc_1_add_res_221450;\n                }\n                \n                double defunc_0_f_res_221451;\n                \n                if (cond_221447) {\n                    defunc_0_f_res_221451 = 0.0;\n                } else {\n                    int64_t i_221452 = add64(gtid_221422, x_221443);\n                    double defunc_0_add_arg_221453;\n                    \n                    defunc_0_add_arg_221453 = ((__global\n                                                double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                                            (gtid_221420 *\n                                                                             ctx_param_ext_229489 +\n                                                                           ",
            "  i_221452 *\n                                                                             ctx_param_ext_229491)];\n                    defunc_0_f_res_221451 = defunc_0_add_arg_221453;\n                }\n                \n                int64_t binop_p_221454 = sub64(defunc_0_f_res_221448,\n                                               index_primexp_228716);\n                double defunc_0_f_res_221455 = sitofp_i64_f64(binop_p_221454);\n                double abs_res_221456 = fabs(defunc_0_f_res_221455);\n                double tmp1_221457 = abs_res_221456 / x_221444;\n                double x_221458 = tmp1_221457 * tmp1_221457;\n                double y_221459 = tmp1_221457 * x_221458;\n                double tmp2_221460 = 1.0 - y_221459;\n                double x_221461 = tmp2_221460 * tmp2_221460;\n                double tmp3_221462 = tmp2_221460 * x_221461;\n                double w_j_221463 = defunc_0_f_res_221451 * tmp3_221462;\n                double xw_j_221464 = defunc_0_f_res_221455 * w_j_221463;\n                double x2w_j_221465 = defunc_0_f_res_221455 * xw_j_221464;\n                double x3w_j_221466 = defunc_0_f_res_221455 * x2w_j_221465;\n                double x4w_j_221467 = defunc_0_f_res_221455 * x3w_j_221466;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_235272)[sext_i32_i64(local_tid_235268)] =\n                        w_j_221463;\n                    ((__local\n                      double *) red_arr_mem_235274)[sext_i32_i64(local_tid_235268)] =\n                        xw_j_221464;\n                    ((__local\n                      double *) red_arr_mem_235276)[sext_i32_i64(local_tid_235268)] =\n                        x2w_j_221465;\n                    ((__local\n                      double *) red_arr_mem_235278)[sext_i32_i64(local_tid_235268)] =\n                        x3w_j_221466;\n         ",
            "           ((__local\n                      double *) red_arr_mem_235280)[sext_i32_i64(local_tid_235268)] =\n                        x4w_j_221467;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_235272)[sext_i32_i64(local_tid_235268)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_235274)[sext_i32_i64(local_tid_235268)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_235276)[sext_i32_i64(local_tid_235268)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_235278)[sext_i32_i64(local_tid_235268)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_235280)[sext_i32_i64(local_tid_235268)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_l_203495)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_221424;\n                double x_221425;\n                double x_221426;\n                double x_221427;\n                double x_221428;\n                double x_221429;\n                double x_221430;\n                double x_221431;\n                double x_221432;\n                double x_221433;\n                double x_235289;\n                double x_235290;\n                double x_235291;\n                double x_235292;\n                double x_235293;\n                double x_235294;\n                double x_235295;\n                double x_235296;\n                double x_235297;\n                double x_235298;\n                bool ltid_in_bounds_235304 =\n                     slt64(sext_i32_i64(local_tid_235268), q_l_203495 *\n                           squot64(segred_group_sizze_221412,\n                                   segment_sizze_nonzzero_235265));\n                int32_t skip_threads_235305;\n                \n ",
            "               // read input for in-block scan\n                {\n                    if (ltid_in_bounds_235304) {\n                        x_221429 = ((volatile __local\n                                     double *) red_arr_mem_235272)[sext_i32_i64(local_tid_235268)];\n                        x_221430 = ((volatile __local\n                                     double *) red_arr_mem_235274)[sext_i32_i64(local_tid_235268)];\n                        x_221431 = ((volatile __local\n                                     double *) red_arr_mem_235276)[sext_i32_i64(local_tid_235268)];\n                        x_221432 = ((volatile __local\n                                     double *) red_arr_mem_235278)[sext_i32_i64(local_tid_235268)];\n                        x_221433 = ((volatile __local\n                                     double *) red_arr_mem_235280)[sext_i32_i64(local_tid_235268)];\n                        if ((local_tid_235268 - squot32(local_tid_235268, 32) *\n                             32) == 0) {\n                            x_221424 = x_221429;\n                            x_221425 = x_221430;\n                            x_221426 = x_221431;\n                            x_221427 = x_221432;\n                            x_221428 = x_221433;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_235305 = 1;\n                    while (slt32(skip_threads_235305, 32)) {\n                        bool thread_active_235306 = sle32(skip_threads_235305,\n                                                          local_tid_235268 -\n                                                          squot32(local_tid_235268,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_235304;\n                        \n                        if (thread_active_235306) {\n                            // read operands\n   ",
            "                         {\n                                x_221424 = ((volatile __local\n                                             double *) red_arr_mem_235272)[sext_i32_i64(local_tid_235268) -\n                                                                           sext_i32_i64(skip_threads_235305)];\n                                x_221425 = ((volatile __local\n                                             double *) red_arr_mem_235274)[sext_i32_i64(local_tid_235268) -\n                                                                           sext_i32_i64(skip_threads_235305)];\n                                x_221426 = ((volatile __local\n                                             double *) red_arr_mem_235276)[sext_i32_i64(local_tid_235268) -\n                                                                           sext_i32_i64(skip_threads_235305)];\n                                x_221427 = ((volatile __local\n                                             double *) red_arr_mem_235278)[sext_i32_i64(local_tid_235268) -\n                                                                           sext_i32_i64(skip_threads_235305)];\n                                x_221428 = ((volatile __local\n                                             double *) red_arr_mem_235280)[sext_i32_i64(local_tid_235268) -\n                                                                           sext_i32_i64(skip_threads_235305)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_235307 =\n                                 slt64(srem64(sext_i32_i64(local_tid_235268),\n                                              q_l_203495),\n                                       sext_i32_i64(local_tid_235268) -\n                                       sext_i32_i64(local_tid_235268 -\n                                       skip_threads_235305));\n                            \n                   ",
            "         if (thread_active_235306 && inactive_235307) {\n                                x_221424 = x_221429;\n                                x_221425 = x_221430;\n                                x_221426 = x_221431;\n                                x_221427 = x_221432;\n                                x_221428 = x_221433;\n                            }\n                            if (thread_active_235306) {\n                                if (!inactive_235307) {\n                                    double defunc_1_op_res_221434 = x_221424 +\n                                           x_221429;\n                                    double defunc_1_op_res_221435 = x_221425 +\n                                           x_221430;\n                                    double defunc_1_op_res_221436 = x_221426 +\n                                           x_221431;\n                                    double defunc_1_op_res_221437 = x_221427 +\n                                           x_221432;\n                                    double defunc_1_op_res_221438 = x_221428 +\n                                           x_221433;\n                                    \n                                    x_221424 = defunc_1_op_res_221434;\n                                    x_221425 = defunc_1_op_res_221435;\n                                    x_221426 = defunc_1_op_res_221436;\n                                    x_221427 = defunc_1_op_res_221437;\n                                    x_221428 = defunc_1_op_res_221438;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_235270, skip_threads_235305)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_235306) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_2",
            "35272)[sext_i32_i64(local_tid_235268)] =\n                                    x_221424;\n                                x_221429 = x_221424;\n                                ((volatile __local\n                                  double *) red_arr_mem_235274)[sext_i32_i64(local_tid_235268)] =\n                                    x_221425;\n                                x_221430 = x_221425;\n                                ((volatile __local\n                                  double *) red_arr_mem_235276)[sext_i32_i64(local_tid_235268)] =\n                                    x_221426;\n                                x_221431 = x_221426;\n                                ((volatile __local\n                                  double *) red_arr_mem_235278)[sext_i32_i64(local_tid_235268)] =\n                                    x_221427;\n                                x_221432 = x_221427;\n                                ((volatile __local\n                                  double *) red_arr_mem_235280)[sext_i32_i64(local_tid_235268)] =\n                                    x_221428;\n                                x_221433 = x_221428;\n                            }\n                        }\n                        if (sle32(wave_sizze_235270, skip_threads_235305)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_235305 *= 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_235268 - squot32(local_tid_235268, 32) *\n                         32) == 31 && ltid_in_bounds_235304) {\n                        ((volatile __local\n                          double *) red_arr_mem_235272)[sext_i32_i64(squot32(local_tid_235268,\n                                                                             32))] =\n                            x_221424;\n                     ",
            "   ((volatile __local\n                          double *) red_arr_mem_235274)[sext_i32_i64(squot32(local_tid_235268,\n                                                                             32))] =\n                            x_221425;\n                        ((volatile __local\n                          double *) red_arr_mem_235276)[sext_i32_i64(squot32(local_tid_235268,\n                                                                             32))] =\n                            x_221426;\n                        ((volatile __local\n                          double *) red_arr_mem_235278)[sext_i32_i64(squot32(local_tid_235268,\n                                                                             32))] =\n                            x_221427;\n                        ((volatile __local\n                          double *) red_arr_mem_235280)[sext_i32_i64(squot32(local_tid_235268,\n                                                                             32))] =\n                            x_221428;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n                {\n                    int32_t skip_threads_235308;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_235268, 32) == 0 &&\n                            ltid_in_bounds_235304) {\n                            x_235294 = ((volatile __local\n                                         double *) red_arr_mem_235272)[sext_i32_i64(local_tid_235268)];\n                            x_235295 = ((volatile __local\n                                         double *) red_arr_mem_235274)[sext_i32_i64(local_tid_235268)];\n                            x_235296 = ((volatile __local\n                                         double *) red_arr_mem_235276)[sext_i32_i64(local_tid_235268)];\n                          ",
            "  x_235297 = ((volatile __local\n                                         double *) red_arr_mem_235278)[sext_i32_i64(local_tid_235268)];\n                            x_235298 = ((volatile __local\n                                         double *) red_arr_mem_235280)[sext_i32_i64(local_tid_235268)];\n                            if ((local_tid_235268 - squot32(local_tid_235268,\n                                                            32) * 32) == 0) {\n                                x_235289 = x_235294;\n                                x_235290 = x_235295;\n                                x_235291 = x_235296;\n                                x_235292 = x_235297;\n                                x_235293 = x_235298;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_235308 = 1;\n                        while (slt32(skip_threads_235308, 32)) {\n                            bool thread_active_235309 =\n                                 sle32(skip_threads_235308, local_tid_235268 -\n                                       squot32(local_tid_235268, 32) * 32) &&\n                                 (squot32(local_tid_235268, 32) == 0 &&\n                                  ltid_in_bounds_235304);\n                            \n                            if (thread_active_235309) {\n                                // read operands\n                                {\n                                    x_235289 = ((volatile __local\n                                                 double *) red_arr_mem_235272)[sext_i32_i64(local_tid_235268) -\n                                                                               sext_i32_i64(skip_threads_235308)];\n                                    x_235290 = ((volatile __local\n                                                 double *) red_arr_mem_235274)[sext_i32_i64(local_tid_235268) -\n                 ",
            "                                                              sext_i32_i64(skip_threads_235308)];\n                                    x_235291 = ((volatile __local\n                                                 double *) red_arr_mem_235276)[sext_i32_i64(local_tid_235268) -\n                                                                               sext_i32_i64(skip_threads_235308)];\n                                    x_235292 = ((volatile __local\n                                                 double *) red_arr_mem_235278)[sext_i32_i64(local_tid_235268) -\n                                                                               sext_i32_i64(skip_threads_235308)];\n                                    x_235293 = ((volatile __local\n                                                 double *) red_arr_mem_235280)[sext_i32_i64(local_tid_235268) -\n                                                                               sext_i32_i64(skip_threads_235308)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_235310 =\n                                     slt64(srem64(sext_i32_i64(local_tid_235268 *\n                                                  32 + 32 - 1), q_l_203495),\n                                           sext_i32_i64(local_tid_235268 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_235268 -\n                                                         skip_threads_235308) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_235309 && inactive_235310) {\n                                    x_235289 = x_235294;\n                                    x_235290 = x_235295;\n                                    x_235291 = x_235296;\n                                    ",
            "x_235292 = x_235297;\n                                    x_235293 = x_235298;\n                                }\n                                if (thread_active_235309) {\n                                    if (!inactive_235310) {\n                                        double defunc_1_op_res_235299 =\n                                               x_235289 + x_235294;\n                                        double defunc_1_op_res_235300 =\n                                               x_235290 + x_235295;\n                                        double defunc_1_op_res_235301 =\n                                               x_235291 + x_235296;\n                                        double defunc_1_op_res_235302 =\n                                               x_235292 + x_235297;\n                                        double defunc_1_op_res_235303 =\n                                               x_235293 + x_235298;\n                                        \n                                        x_235289 = defunc_1_op_res_235299;\n                                        x_235290 = defunc_1_op_res_235300;\n                                        x_235291 = defunc_1_op_res_235301;\n                                        x_235292 = defunc_1_op_res_235302;\n                                        x_235293 = defunc_1_op_res_235303;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_235270, skip_threads_235308)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_235309) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_235272)[sext_i32_i64(local_tid_235268)] =\n                                        x_235289;\n                                ",
            "    x_235294 = x_235289;\n                                    ((volatile __local\n                                      double *) red_arr_mem_235274)[sext_i32_i64(local_tid_235268)] =\n                                        x_235290;\n                                    x_235295 = x_235290;\n                                    ((volatile __local\n                                      double *) red_arr_mem_235276)[sext_i32_i64(local_tid_235268)] =\n                                        x_235291;\n                                    x_235296 = x_235291;\n                                    ((volatile __local\n                                      double *) red_arr_mem_235278)[sext_i32_i64(local_tid_235268)] =\n                                        x_235292;\n                                    x_235297 = x_235292;\n                                    ((volatile __local\n                                      double *) red_arr_mem_235280)[sext_i32_i64(local_tid_235268)] =\n                                        x_235293;\n                                    x_235298 = x_235293;\n                                }\n                            }\n                            if (sle32(wave_sizze_235270, skip_threads_235308)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_235308 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_235311 = squot32(local_tid_235268, 32) == 0 ||\n                     !ltid_in_bounds_235304;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_235311) {\n                            x_221429 = x_221424;\n                            x_221430 = x_221425;\n                            x_221431 = x_221426;\n                     ",
            "       x_221432 = x_221427;\n                            x_221433 = x_221428;\n                            x_221424 = ((__local\n                                         double *) red_arr_mem_235272)[sext_i32_i64(squot32(local_tid_235268,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_221425 = ((__local\n                                         double *) red_arr_mem_235274)[sext_i32_i64(squot32(local_tid_235268,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_221426 = ((__local\n                                         double *) red_arr_mem_235276)[sext_i32_i64(squot32(local_tid_235268,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_221427 = ((__local\n                                         double *) red_arr_mem_235278)[sext_i32_i64(squot32(local_tid_235268,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_221428 = ((__local\n                                         double *) red_arr_mem_235280)[sext_i32_i64(squot32(local_tid_235268,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_235312 =\n                             slt64(srem64(sext_i32",
            "_i64(local_tid_235268),\n                                          q_l_203495),\n                                   sext_i32_i64(local_tid_235268) -\n                                   sext_i32_i64(squot32(local_tid_235268, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_235311) {\n                            if (inactive_235312) {\n                                x_221424 = x_221429;\n                                x_221425 = x_221430;\n                                x_221426 = x_221431;\n                                x_221427 = x_221432;\n                                x_221428 = x_221433;\n                            }\n                        }\n                        if (!no_carry_in_235311) {\n                            if (!inactive_235312) {\n                                double defunc_1_op_res_221434 = x_221424 +\n                                       x_221429;\n                                double defunc_1_op_res_221435 = x_221425 +\n                                       x_221430;\n                                double defunc_1_op_res_221436 = x_221426 +\n                                       x_221431;\n                                double defunc_1_op_res_221437 = x_221427 +\n                                       x_221432;\n                                double defunc_1_op_res_221438 = x_221428 +\n                                       x_221433;\n                                \n                                x_221424 = defunc_1_op_res_221434;\n                                x_221425 = defunc_1_op_res_221435;\n                                x_221426 = defunc_1_op_res_221436;\n                                x_221427 = defunc_1_op_res_221437;\n                                x_221428 = defunc_1_op_res_221438;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_235311",
            ") {\n                            ((__local\n                              double *) red_arr_mem_235272)[sext_i32_i64(local_tid_235268)] =\n                                x_221424;\n                            ((__local\n                              double *) red_arr_mem_235274)[sext_i32_i64(local_tid_235268)] =\n                                x_221425;\n                            ((__local\n                              double *) red_arr_mem_235276)[sext_i32_i64(local_tid_235268)] =\n                                x_221426;\n                            ((__local\n                              double *) red_arr_mem_235278)[sext_i32_i64(local_tid_235268)] =\n                                x_221427;\n                            ((__local\n                              double *) red_arr_mem_235280)[sext_i32_i64(local_tid_235268)] =\n                                x_221428;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_235268, 32) == 0 &&\n                        ltid_in_bounds_235304) {\n                        ((__local\n                          double *) red_arr_mem_235272)[sext_i32_i64(local_tid_235268)] =\n                            x_221429;\n                        ((__local\n                          double *) red_arr_mem_235274)[sext_i32_i64(local_tid_235268)] =\n                            x_221430;\n                        ((__local\n                          double *) red_arr_mem_235276)[sext_i32_i64(local_tid_235268)] =\n                            x_221431;\n                        ((__local\n                          double *) red_arr_mem_235278)[sext_i32_i64(local_tid_235268)] =\n                            x_221432;\n                        ((__local\n                          double *) red_arr_mem_235280)[sext_i32_i64(local_tid_235268)] =\n                            x_221433;\n                 ",
            "   }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // save final values of segments\n        {\n            if (slt64(sext_i32_i64(virt_group_id_235284) *\n                      squot64(segred_group_sizze_221412,\n                              segment_sizze_nonzzero_235265) +\n                      sext_i32_i64(local_tid_235268), partition_sizze_203577 *\n                      l_n_m_203643) && slt64(sext_i32_i64(local_tid_235268),\n                                             squot64(segred_group_sizze_221412,\n                                                     segment_sizze_nonzzero_235265))) {\n                double tmp_235313;\n                \n                tmp_235313 = ((__local\n                               double *) red_arr_mem_235272)[(sext_i32_i64(local_tid_235268) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_235265 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230783)[squot64(sext_i32_i64(virt_group_id_235284) *\n                                                squot64(segred_group_sizze_221412,\n                                                        segment_sizze_nonzzero_235265) +\n                                                sext_i32_i64(local_tid_235268),\n                                                l_n_m_203643) * l_n_m_203643 +\n                                        (sext_i32_i64(virt_group_id_235284) *\n                                         squot64(segred_group_sizze_221412,\n                                                 segment_sizze_nonzzero_235265) +\n                                         sext_i32_i64(local_tid_235268) -\n                                         squot64(sext_i32_i64(virt_group_id_235284) *\n                                             ",
            "    squot64(segred_group_sizze_221412,\n                                                         segment_sizze_nonzzero_235265) +\n                                                 sext_i32_i64(local_tid_235268),\n                                                 l_n_m_203643) *\n                                         l_n_m_203643)] = tmp_235313;\n                \n                double tmp_235314;\n                \n                tmp_235314 = ((__local\n                               double *) red_arr_mem_235274)[(sext_i32_i64(local_tid_235268) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_235265 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230787)[squot64(sext_i32_i64(virt_group_id_235284) *\n                                                squot64(segred_group_sizze_221412,\n                                                        segment_sizze_nonzzero_235265) +\n                                                sext_i32_i64(local_tid_235268),\n                                                l_n_m_203643) * l_n_m_203643 +\n                                        (sext_i32_i64(virt_group_id_235284) *\n                                         squot64(segred_group_sizze_221412,\n                                                 segment_sizze_nonzzero_235265) +\n                                         sext_i32_i64(local_tid_235268) -\n                                         squot64(sext_i32_i64(virt_group_id_235284) *\n                                                 squot64(segred_group_sizze_221412,\n                                                         segment_sizze_nonzzero_235265) +\n                                                 sext_i32_i64(local_tid_235268),\n                                                 l_n_m_203643) *\n                                         l_n_m_2",
            "03643)] = tmp_235314;\n                \n                double tmp_235315;\n                \n                tmp_235315 = ((__local\n                               double *) red_arr_mem_235276)[(sext_i32_i64(local_tid_235268) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_235265 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230791)[squot64(sext_i32_i64(virt_group_id_235284) *\n                                                squot64(segred_group_sizze_221412,\n                                                        segment_sizze_nonzzero_235265) +\n                                                sext_i32_i64(local_tid_235268),\n                                                l_n_m_203643) * l_n_m_203643 +\n                                        (sext_i32_i64(virt_group_id_235284) *\n                                         squot64(segred_group_sizze_221412,\n                                                 segment_sizze_nonzzero_235265) +\n                                         sext_i32_i64(local_tid_235268) -\n                                         squot64(sext_i32_i64(virt_group_id_235284) *\n                                                 squot64(segred_group_sizze_221412,\n                                                         segment_sizze_nonzzero_235265) +\n                                                 sext_i32_i64(local_tid_235268),\n                                                 l_n_m_203643) *\n                                         l_n_m_203643)] = tmp_235315;\n                \n                double tmp_235316;\n                \n                tmp_235316 = ((__local\n                               double *) red_arr_mem_235278)[(sext_i32_i64(local_tid_235268) +\n                                                              (int64_t) 1) *\n                     ",
            "                                        segment_sizze_nonzzero_235265 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230795)[squot64(sext_i32_i64(virt_group_id_235284) *\n                                                squot64(segred_group_sizze_221412,\n                                                        segment_sizze_nonzzero_235265) +\n                                                sext_i32_i64(local_tid_235268),\n                                                l_n_m_203643) * l_n_m_203643 +\n                                        (sext_i32_i64(virt_group_id_235284) *\n                                         squot64(segred_group_sizze_221412,\n                                                 segment_sizze_nonzzero_235265) +\n                                         sext_i32_i64(local_tid_235268) -\n                                         squot64(sext_i32_i64(virt_group_id_235284) *\n                                                 squot64(segred_group_sizze_221412,\n                                                         segment_sizze_nonzzero_235265) +\n                                                 sext_i32_i64(local_tid_235268),\n                                                 l_n_m_203643) *\n                                         l_n_m_203643)] = tmp_235316;\n                \n                double tmp_235317;\n                \n                tmp_235317 = ((__local\n                               double *) red_arr_mem_235280)[(sext_i32_i64(local_tid_235268) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_235265 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230799)[squot64(sext_i32_i64(virt_group_id_235284) *\n                                                squot64(segred_g",
            "roup_sizze_221412,\n                                                        segment_sizze_nonzzero_235265) +\n                                                sext_i32_i64(local_tid_235268),\n                                                l_n_m_203643) * l_n_m_203643 +\n                                        (sext_i32_i64(virt_group_id_235284) *\n                                         squot64(segred_group_sizze_221412,\n                                                 segment_sizze_nonzzero_235265) +\n                                         sext_i32_i64(local_tid_235268) -\n                                         squot64(sext_i32_i64(virt_group_id_235284) *\n                                                 squot64(segred_group_sizze_221412,\n                                                         segment_sizze_nonzzero_235265) +\n                                                 sext_i32_i64(local_tid_235268),\n                                                 l_n_m_203643) *\n                                         l_n_m_203643)] = tmp_235317;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_221412\n}\n__kernel void mainzisegred_small_221521(__global int *global_failure,\n                                        uint red_arr_mem_235412_backing_offset_0,\n                                        uint red_arr_mem_235410_backing_offset_1,\n                                        int64_t n_203490, int64_t q_l_203495,\n                                        int64_t jump_t_203500,\n                                        int64_t partition_sizze_203577,\n                                        int64_t l_n_m_203643, int64_t i_203670,\n                                        int64_t num_groups_221514,\n                                        int64_t ctx_param_ext_229488,\n                                        int64_t ctx_param_ext_229489,\n                 ",
            "                       int64_t ctx_param_ext_229491,\n                                        int64_t segment_sizze_nonzzero_235403,\n                                        __global unsigned char *ext_mem_229411,\n                                        __global unsigned char *ext_mem_229412,\n                                        __global\n                                        unsigned char *mem_param_229493,\n                                        __global unsigned char *mem_230551,\n                                        __global unsigned char *mem_230804,\n                                        __global unsigned char *mem_230808,\n                                        __global unsigned char *mem_230812,\n                                        __global unsigned char *mem_230816,\n                                        __global unsigned char *mem_230820,\n                                        __global unsigned char *mem_230825,\n                                        __global unsigned char *mem_230829)\n{\n    #define segred_group_sizze_221513 (mainzisegred_group_sizze_220883)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_235412_backing_1 =\n                           &shared_mem[red_arr_mem_235412_backing_offset_0];\n    volatile unsigned char *red_arr_mem_235410_backing_0 =\n                           &shared_mem[red_arr_mem_235410_backing_offset_1];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235405;\n    int32_t local_tid_235406;\n    int64_t group_sizze_235409;\n    int32_t wave_sizze_235408;\n    int32_t group_tid_235407;\n    \n    global_tid_235405 = get_global_id(0);\n    local_tid_235406 = get_local_id(0);\n    group_sizze_235409 = get_local_size(0);\n    wave_sizze_235408 = LOCKSTEP_WIDTH;\n    group_tid_235407 = get_group_id(0);\n    \n    int32_t phys_tid_221521 = global_tid_235405;\n    __local unsigned char *red_arr_mem_235410;\n    \n    red_ar",
            "r_mem_235410 = (__local unsigned char *) red_arr_mem_235410_backing_0;\n    \n    __local unsigned char *red_arr_mem_235412;\n    \n    red_arr_mem_235412 = (__local unsigned char *) red_arr_mem_235412_backing_1;\n    \n    int32_t phys_group_id_235414;\n    \n    phys_group_id_235414 = get_group_id(0);\n    for (int32_t i_235415 = 0; i_235415 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577 * l_n_m_203643,\n                                          squot64(segred_group_sizze_221513,\n                                                  segment_sizze_nonzzero_235403))) -\n                   phys_group_id_235414, sext_i64_i32(num_groups_221514));\n         i_235415++) {\n        int32_t virt_group_id_235416 = phys_group_id_235414 + i_235415 *\n                sext_i64_i32(num_groups_221514);\n        int64_t slice_235417 = l_n_m_203643;\n        int64_t slice_235418 = partition_sizze_203577 * slice_235417;\n        int64_t gtid_221518 = squot64(squot64(sext_i32_i64(local_tid_235406),\n                                              segment_sizze_nonzzero_235403) +\n                                      sext_i32_i64(virt_group_id_235416) *\n                                      squot64(segred_group_sizze_221513,\n                                              segment_sizze_nonzzero_235403),\n                                      slice_235417);\n        int64_t remnant_235419 = squot64(sext_i32_i64(local_tid_235406),\n                                         segment_sizze_nonzzero_235403) +\n                sext_i32_i64(virt_group_id_235416) *\n                squot64(segred_group_sizze_221513,\n                        segment_sizze_nonzzero_235403) - gtid_221518 *\n                slice_235417;\n        int64_t gtid_221519 = remnant_235419;\n        int64_t remnant_235420 = remnant_235419 - gtid_221519;\n        int64_t gtid_221520 = srem64(sext_i32_i64(local_tid_235406),\n                                     q_l_203495);\n        \n        // apply map function if in bounds\n        {\n     ",
            "       if (slt64((int64_t) 0, q_l_203495) && ((slt64(gtid_221518,\n                                                          partition_sizze_203577) &&\n                                                    slt64(gtid_221519,\n                                                          l_n_m_203643)) &&\n                                                   slt64(sext_i32_i64(local_tid_235406),\n                                                         q_l_203495 *\n                                                         squot64(segred_group_sizze_221513,\n                                                                 segment_sizze_nonzzero_235403)))) {\n                int64_t x_221538;\n                \n                x_221538 = ((__global int64_t *) ext_mem_229412)[gtid_221518 *\n                                                                 l_n_m_203643 +\n                                                                 gtid_221519];\n                \n                double x_221539;\n                \n                x_221539 = ((__global double *) ext_mem_229411)[gtid_221518 *\n                                                                l_n_m_203643 +\n                                                                gtid_221519];\n                \n                int64_t binop_y_228709 = mul64(jump_t_203500, gtid_221519);\n                int64_t binop_y_228710 = smin64(i_203670, binop_y_228709);\n                int64_t index_primexp_228711 = add64((int64_t) 1,\n                                                     binop_y_228710);\n                double a12_221541;\n                \n                a12_221541 = ((__global double *) mem_230804)[gtid_221518 *\n                                                              l_n_m_203643 +\n                                                              gtid_221519];\n                \n                double b12_221542;\n                \n                b12_221542 = ((__global double *) mem_230808)[gtid_221518 *\n                             ",
            "                                 l_n_m_203643 +\n                                                              gtid_221519];\n                \n                double c12_221543;\n                \n                c12_221543 = ((__global double *) mem_230812)[gtid_221518 *\n                                                              l_n_m_203643 +\n                                                              gtid_221519];\n                \n                double b2_221544;\n                \n                b2_221544 = ((__global double *) mem_230816)[gtid_221518 *\n                                                             l_n_m_203643 +\n                                                             gtid_221519];\n                \n                double c2_221545;\n                \n                c2_221545 = ((__global double *) mem_230820)[gtid_221518 *\n                                                             l_n_m_203643 +\n                                                             gtid_221519];\n                \n                bool cond_221547 = sle64(n_203490, gtid_221520);\n                int64_t defunc_0_f_res_221548;\n                \n                if (cond_221547) {\n                    defunc_0_f_res_221548 = (int64_t) 0;\n                } else {\n                    int64_t i_221549 = add64(gtid_221520, x_221538);\n                    int64_t defunc_1_add_res_221550 = add64((int64_t) 1,\n                                                            i_221549);\n                    \n                    defunc_0_f_res_221548 = defunc_1_add_res_221550;\n                }\n                \n                double defunc_0_f_res_221551;\n                \n                if (cond_221547) {\n                    defunc_0_f_res_221551 = 0.0;\n                } else {\n                    int64_t i_221552 = add64(gtid_221520, x_221538);\n                    double defunc_0_add_arg_221553;\n                    \n                    defunc_0_add_arg_221553 = ((__global\n                  ",
            "                              double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                                            (gtid_221518 *\n                                                                             ctx_param_ext_229489 +\n                                                                             i_221552 *\n                                                                             ctx_param_ext_229491)];\n                    defunc_0_f_res_221551 = defunc_0_add_arg_221553;\n                }\n                \n                int64_t binop_p_221554 = sub64(defunc_0_f_res_221548,\n                                               index_primexp_228711);\n                double defunc_0_f_res_221555 = sitofp_i64_f64(binop_p_221554);\n                double abs_res_221556 = fabs(defunc_0_f_res_221555);\n                double tmp1_221557 = abs_res_221556 / x_221539;\n                double x_221558 = tmp1_221557 * tmp1_221557;\n                double y_221559 = tmp1_221557 * x_221558;\n                double tmp2_221560 = 1.0 - y_221559;\n                double x_221561 = tmp2_221560 * tmp2_221560;\n                double tmp3_221562 = tmp2_221560 * x_221561;\n                double tmp4_221563 = defunc_0_f_res_221551 * tmp3_221562;\n                double defunc_1_f_res_221564 = defunc_0_f_res_221555 *\n                       tmp4_221563;\n                double defunc_1_f_res_221565 = defunc_0_f_res_221555 *\n                       defunc_1_f_res_221564;\n                double defunc_0_f_res_221566;\n                \n                if (cond_221547) {\n                    defunc_0_f_res_221566 = 0.0;\n                } else {\n                    int64_t i_221567 = add64(gtid_221520, x_221538);\n                    double defunc_0_add_arg_221568;\n                    \n                    defunc_0_add_arg_221568 = ((__global\n                                                double *) mem_230551)[gtid_221518 *\n                                    ",
            "                                  n_203490 +\n                                                                      i_221567];\n                    defunc_0_f_res_221566 = defunc_0_add_arg_221568;\n                }\n                \n                double x_221569 = a12_221541 * tmp4_221563;\n                double y_221570 = b12_221542 * defunc_1_f_res_221564;\n                double x_221571 = x_221569 + y_221570;\n                double y_221572 = c12_221543 * defunc_1_f_res_221565;\n                double x_221573 = x_221571 + y_221572;\n                double defunc_9_fit_fun_res_221574 = defunc_0_f_res_221566 *\n                       x_221573;\n                double x_221575 = b12_221542 * tmp4_221563;\n                double y_221576 = b2_221544 * defunc_1_f_res_221564;\n                double x_221577 = x_221575 + y_221576;\n                double y_221578 = c2_221545 * defunc_1_f_res_221565;\n                double x_221579 = x_221577 + y_221578;\n                double defunc_9_slope_fun_res_221580 = defunc_0_f_res_221566 *\n                       x_221579;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_235410)[sext_i32_i64(local_tid_235406)] =\n                        defunc_9_fit_fun_res_221574;\n                    ((__local\n                      double *) red_arr_mem_235412)[sext_i32_i64(local_tid_235406)] =\n                        defunc_9_slope_fun_res_221580;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_235410)[sext_i32_i64(local_tid_235406)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_235412)[sext_i32_i64(local_tid_235406)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_l_203495)) {\n            // perform segmented sca",
            "n to imitate reduction\n            {\n                double x_221522;\n                double x_221523;\n                double x_221524;\n                double x_221525;\n                double x_235421;\n                double x_235422;\n                double x_235423;\n                double x_235424;\n                bool ltid_in_bounds_235427 =\n                     slt64(sext_i32_i64(local_tid_235406), q_l_203495 *\n                           squot64(segred_group_sizze_221513,\n                                   segment_sizze_nonzzero_235403));\n                int32_t skip_threads_235428;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_235427) {\n                        x_221524 = ((volatile __local\n                                     double *) red_arr_mem_235410)[sext_i32_i64(local_tid_235406)];\n                        x_221525 = ((volatile __local\n                                     double *) red_arr_mem_235412)[sext_i32_i64(local_tid_235406)];\n                        if ((local_tid_235406 - squot32(local_tid_235406, 32) *\n                             32) == 0) {\n                            x_221522 = x_221524;\n                            x_221523 = x_221525;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_235428 = 1;\n                    while (slt32(skip_threads_235428, 32)) {\n                        bool thread_active_235429 = sle32(skip_threads_235428,\n                                                          local_tid_235406 -\n                                                          squot32(local_tid_235406,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_235427;\n                        \n                        if (thread_active_235429) {\n                            // read operands\n ",
            "                           {\n                                x_221522 = ((volatile __local\n                                             double *) red_arr_mem_235410)[sext_i32_i64(local_tid_235406) -\n                                                                           sext_i32_i64(skip_threads_235428)];\n                                x_221523 = ((volatile __local\n                                             double *) red_arr_mem_235412)[sext_i32_i64(local_tid_235406) -\n                                                                           sext_i32_i64(skip_threads_235428)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_235430 =\n                                 slt64(srem64(sext_i32_i64(local_tid_235406),\n                                              q_l_203495),\n                                       sext_i32_i64(local_tid_235406) -\n                                       sext_i32_i64(local_tid_235406 -\n                                       skip_threads_235428));\n                            \n                            if (thread_active_235429 && inactive_235430) {\n                                x_221522 = x_221524;\n                                x_221523 = x_221525;\n                            }\n                            if (thread_active_235429) {\n                                if (!inactive_235430) {\n                                    double defunc_1_op_res_221526 = x_221522 +\n                                           x_221524;\n                                    double defunc_1_op_res_221527 = x_221523 +\n                                           x_221525;\n                                    \n                                    x_221522 = defunc_1_op_res_221526;\n                                    x_221523 = defunc_1_op_res_221527;\n                                }\n                            }\n                        }\n    ",
            "                    if (sle32(wave_sizze_235408, skip_threads_235428)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_235429) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_235410)[sext_i32_i64(local_tid_235406)] =\n                                    x_221522;\n                                x_221524 = x_221522;\n                                ((volatile __local\n                                  double *) red_arr_mem_235412)[sext_i32_i64(local_tid_235406)] =\n                                    x_221523;\n                                x_221525 = x_221523;\n                            }\n                        }\n                        if (sle32(wave_sizze_235408, skip_threads_235428)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_235428 *= 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_235406 - squot32(local_tid_235406, 32) *\n                         32) == 31 && ltid_in_bounds_235427) {\n                        ((volatile __local\n                          double *) red_arr_mem_235410)[sext_i32_i64(squot32(local_tid_235406,\n                                                                             32))] =\n                            x_221522;\n                        ((volatile __local\n                          double *) red_arr_mem_235412)[sext_i32_i64(squot32(local_tid_235406,\n                                                                             32))] =\n                            x_221523;\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_235431;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_235406, 32) == 0 &&\n                            ltid_in_bounds_235427) {\n                            x_235423 = ((volatile __local\n                                         double *) red_arr_mem_235410)[sext_i32_i64(local_tid_235406)];\n                            x_235424 = ((volatile __local\n                                         double *) red_arr_mem_235412)[sext_i32_i64(local_tid_235406)];\n                            if ((local_tid_235406 - squot32(local_tid_235406,\n                                                            32) * 32) == 0) {\n                                x_235421 = x_235423;\n                                x_235422 = x_235424;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_235431 = 1;\n                        while (slt32(skip_threads_235431, 32)) {\n                            bool thread_active_235432 =\n                                 sle32(skip_threads_235431, local_tid_235406 -\n                                       squot32(local_tid_235406, 32) * 32) &&\n                                 (squot32(local_tid_235406, 32) == 0 &&\n                                  ltid_in_bounds_235427);\n                            \n                            if (thread_active_235432) {\n                                // read operands\n                                {\n                                    x_235421 = ((volatile __local\n                                                 double *) red_arr_mem_235410)[sext_i32_i64(local_tid_235406) -\n                                                                               sext_i32_i64",
            "(skip_threads_235431)];\n                                    x_235422 = ((volatile __local\n                                                 double *) red_arr_mem_235412)[sext_i32_i64(local_tid_235406) -\n                                                                               sext_i32_i64(skip_threads_235431)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_235433 =\n                                     slt64(srem64(sext_i32_i64(local_tid_235406 *\n                                                  32 + 32 - 1), q_l_203495),\n                                           sext_i32_i64(local_tid_235406 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_235406 -\n                                                         skip_threads_235431) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_235432 && inactive_235433) {\n                                    x_235421 = x_235423;\n                                    x_235422 = x_235424;\n                                }\n                                if (thread_active_235432) {\n                                    if (!inactive_235433) {\n                                        double defunc_1_op_res_235425 =\n                                               x_235421 + x_235423;\n                                        double defunc_1_op_res_235426 =\n                                               x_235422 + x_235424;\n                                        \n                                        x_235421 = defunc_1_op_res_235425;\n                                        x_235422 = defunc_1_op_res_235426;\n                                    }\n                                }\n                            }\n                          ",
            "  if (sle32(wave_sizze_235408, skip_threads_235431)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_235432) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_235410)[sext_i32_i64(local_tid_235406)] =\n                                        x_235421;\n                                    x_235423 = x_235421;\n                                    ((volatile __local\n                                      double *) red_arr_mem_235412)[sext_i32_i64(local_tid_235406)] =\n                                        x_235422;\n                                    x_235424 = x_235422;\n                                }\n                            }\n                            if (sle32(wave_sizze_235408, skip_threads_235431)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_235431 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_235434 = squot32(local_tid_235406, 32) == 0 ||\n                     !ltid_in_bounds_235427;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_235434) {\n                            x_221524 = x_221522;\n                            x_221525 = x_221523;\n                            x_221522 = ((__local\n                                         double *) red_arr_mem_235410)[sext_i32_i64(squot32(local_tid_235406,\n                                                                                            32)) -\n                                                                       (int64_t)",
            " 1];\n                            x_221523 = ((__local\n                                         double *) red_arr_mem_235412)[sext_i32_i64(squot32(local_tid_235406,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_235435 =\n                             slt64(srem64(sext_i32_i64(local_tid_235406),\n                                          q_l_203495),\n                                   sext_i32_i64(local_tid_235406) -\n                                   sext_i32_i64(squot32(local_tid_235406, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_235434) {\n                            if (inactive_235435) {\n                                x_221522 = x_221524;\n                                x_221523 = x_221525;\n                            }\n                        }\n                        if (!no_carry_in_235434) {\n                            if (!inactive_235435) {\n                                double defunc_1_op_res_221526 = x_221522 +\n                                       x_221524;\n                                double defunc_1_op_res_221527 = x_221523 +\n                                       x_221525;\n                                \n                                x_221522 = defunc_1_op_res_221526;\n                                x_221523 = defunc_1_op_res_221527;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_235434) {\n                            ((__local\n                              double *) red_arr_mem_235410)[sext_i32_i64(local_tid_235406)] =\n                                x_221522",
            ";\n                            ((__local\n                              double *) red_arr_mem_235412)[sext_i32_i64(local_tid_235406)] =\n                                x_221523;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_235406, 32) == 0 &&\n                        ltid_in_bounds_235427) {\n                        ((__local\n                          double *) red_arr_mem_235410)[sext_i32_i64(local_tid_235406)] =\n                            x_221524;\n                        ((__local\n                          double *) red_arr_mem_235412)[sext_i32_i64(local_tid_235406)] =\n                            x_221525;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // save final values of segments\n        {\n            if (slt64(sext_i32_i64(virt_group_id_235416) *\n                      squot64(segred_group_sizze_221513,\n                              segment_sizze_nonzzero_235403) +\n                      sext_i32_i64(local_tid_235406), partition_sizze_203577 *\n                      l_n_m_203643) && slt64(sext_i32_i64(local_tid_235406),\n                                             squot64(segred_group_sizze_221513,\n                                                     segment_sizze_nonzzero_235403))) {\n                double tmp_235436;\n                \n                tmp_235436 = ((__local\n                               double *) red_arr_mem_235410)[(sext_i32_i64(local_tid_235406) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_235403 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230825)[s",
            "quot64(sext_i32_i64(virt_group_id_235416) *\n                                                squot64(segred_group_sizze_221513,\n                                                        segment_sizze_nonzzero_235403) +\n                                                sext_i32_i64(local_tid_235406),\n                                                l_n_m_203643) * l_n_m_203643 +\n                                        (sext_i32_i64(virt_group_id_235416) *\n                                         squot64(segred_group_sizze_221513,\n                                                 segment_sizze_nonzzero_235403) +\n                                         sext_i32_i64(local_tid_235406) -\n                                         squot64(sext_i32_i64(virt_group_id_235416) *\n                                                 squot64(segred_group_sizze_221513,\n                                                         segment_sizze_nonzzero_235403) +\n                                                 sext_i32_i64(local_tid_235406),\n                                                 l_n_m_203643) *\n                                         l_n_m_203643)] = tmp_235436;\n                \n                double tmp_235437;\n                \n                tmp_235437 = ((__local\n                               double *) red_arr_mem_235412)[(sext_i32_i64(local_tid_235406) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_235403 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230829)[squot64(sext_i32_i64(virt_group_id_235416) *\n                                                squot64(segred_group_sizze_221513,\n                                                        segment_sizze_nonzzero_235403) +\n                                                sext_i32_i64(local_tid_235406),\n                           ",
            "                     l_n_m_203643) * l_n_m_203643 +\n                                        (sext_i32_i64(virt_group_id_235416) *\n                                         squot64(segred_group_sizze_221513,\n                                                 segment_sizze_nonzzero_235403) +\n                                         sext_i32_i64(local_tid_235406) -\n                                         squot64(sext_i32_i64(virt_group_id_235416) *\n                                                 squot64(segred_group_sizze_221513,\n                                                         segment_sizze_nonzzero_235403) +\n                                                 sext_i32_i64(local_tid_235406),\n                                                 l_n_m_203643) *\n                                         l_n_m_203643)] = tmp_235437;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_221513\n}\n__kernel void mainzisegred_small_223197(__global int *global_failure,\n                                        uint red_arr_mem_235660_backing_offset_0,\n                                        int64_t n_203490, int64_t q_t_203494,\n                                        int64_t jump_t_203500,\n                                        int64_t partition_sizze_203577,\n                                        int64_t t_n_m_203650, int64_t i_203670,\n                                        int64_t num_groups_223191,\n                                        int64_t segment_sizze_nonzzero_235653,\n                                        __global unsigned char *ext_mem_229196,\n                                        __global unsigned char *ext_mem_229197,\n                                        __global unsigned char *ext_mem_229460,\n                                        __global unsigned char *ext_mem_229461,\n                                        __global unsign",
            "ed char *mem_231013,\n                                        __global unsigned char *mem_231027)\n{\n    #define segred_group_sizze_223190 (mainzisegred_group_sizze_222794)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_235660_backing_0 =\n                           &shared_mem[red_arr_mem_235660_backing_offset_0];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235655;\n    int32_t local_tid_235656;\n    int64_t group_sizze_235659;\n    int32_t wave_sizze_235658;\n    int32_t group_tid_235657;\n    \n    global_tid_235655 = get_global_id(0);\n    local_tid_235656 = get_local_id(0);\n    group_sizze_235659 = get_local_size(0);\n    wave_sizze_235658 = LOCKSTEP_WIDTH;\n    group_tid_235657 = get_group_id(0);\n    \n    int32_t phys_tid_223197 = global_tid_235655;\n    __local unsigned char *red_arr_mem_235660;\n    \n    red_arr_mem_235660 = (__local unsigned char *) red_arr_mem_235660_backing_0;\n    \n    int32_t phys_group_id_235662;\n    \n    phys_group_id_235662 = get_group_id(0);\n    for (int32_t i_235663 = 0; i_235663 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577 * t_n_m_203650,\n                                          squot64(segred_group_sizze_223190,\n                                                  segment_sizze_nonzzero_235653))) -\n                   phys_group_id_235662, sext_i64_i32(num_groups_223191));\n         i_235663++) {\n        int32_t virt_group_id_235664 = phys_group_id_235662 + i_235663 *\n                sext_i64_i32(num_groups_223191);\n        int64_t slice_235665 = t_n_m_203650;\n        int64_t slice_235666 = partition_sizze_203577 * slice_235665;\n        int64_t gtid_223194 = squot64(squot64(sext_i32_i64(local_tid_235656),\n                                              segment_sizze_nonzzero_235653) +\n                                      sext_i32_i64(virt_group_id_235664) *\n                                      squot64(segr",
            "ed_group_sizze_223190,\n                                              segment_sizze_nonzzero_235653),\n                                      slice_235665);\n        int64_t remnant_235667 = squot64(sext_i32_i64(local_tid_235656),\n                                         segment_sizze_nonzzero_235653) +\n                sext_i32_i64(virt_group_id_235664) *\n                squot64(segred_group_sizze_223190,\n                        segment_sizze_nonzzero_235653) - gtid_223194 *\n                slice_235665;\n        int64_t gtid_223195 = remnant_235667;\n        int64_t remnant_235668 = remnant_235667 - gtid_223195;\n        int64_t gtid_223196 = srem64(sext_i32_i64(local_tid_235656),\n                                     q_t_203494);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_t_203494) && ((slt64(gtid_223194,\n                                                          partition_sizze_203577) &&\n                                                    slt64(gtid_223195,\n                                                          t_n_m_203650)) &&\n                                                   slt64(sext_i32_i64(local_tid_235656),\n                                                         q_t_203494 *\n                                                         squot64(segred_group_sizze_223190,\n                                                                 segment_sizze_nonzzero_235653)))) {\n                int64_t x_223202;\n                \n                x_223202 = ((__global int64_t *) ext_mem_229196)[gtid_223194];\n                \n                int64_t x_223207;\n                \n                x_223207 = ((__global int64_t *) ext_mem_229461)[gtid_223194 *\n                                                                 t_n_m_203650 +\n                                                                 gtid_223195];\n                \n                double x_223208;\n                \n                x_223208 = ((__global double *",
            ") ext_mem_229460)[gtid_223194 *\n                                                                t_n_m_203650 +\n                                                                gtid_223195];\n                \n                int64_t binop_y_228664 = mul64(jump_t_203500, gtid_223195);\n                int64_t binop_y_228665 = smin64(i_203670, binop_y_228664);\n                int64_t index_primexp_228666 = add64((int64_t) 1,\n                                                     binop_y_228665);\n                bool cond_223211 = sle64(x_223202, gtid_223196);\n                int64_t defunc_0_f_res_223212;\n                \n                if (cond_223211) {\n                    defunc_0_f_res_223212 = (int64_t) 0;\n                } else {\n                    int64_t i_223213 = add64(gtid_223196, x_223207);\n                    int64_t defunc_0_add_arg_223214;\n                    \n                    defunc_0_add_arg_223214 = ((__global\n                                                int64_t *) ext_mem_229197)[gtid_223194 *\n                                                                           n_203490 +\n                                                                           i_223213];\n                    \n                    int64_t defunc_1_add_res_223215 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_223214);\n                    \n                    defunc_0_f_res_223212 = defunc_1_add_res_223215;\n                }\n                \n                double defunc_0_f_res_223216;\n                \n                if (cond_223211) {\n                    defunc_0_f_res_223216 = 0.0;\n                } else {\n                    int64_t i_223217 = add64(gtid_223196, x_223207);\n                    double defunc_0_add_arg_223218;\n                    \n                    defunc_0_add_arg_223218 = ((__global\n                                                double *) mem_231013)[gtid_223194 *\n                                        ",
            "                              n_203490 +\n                                                                      i_223217];\n                    defunc_0_f_res_223216 = defunc_0_add_arg_223218;\n                }\n                \n                int64_t binop_p_223219 = sub64(defunc_0_f_res_223212,\n                                               index_primexp_228666);\n                double defunc_0_f_res_223220 = sitofp_i64_f64(binop_p_223219);\n                double abs_res_223221 = fabs(defunc_0_f_res_223220);\n                double tmp1_223222 = abs_res_223221 / x_223208;\n                double x_223223 = tmp1_223222 * tmp1_223222;\n                double y_223224 = tmp1_223222 * x_223223;\n                double tmp2_223225 = 1.0 - y_223224;\n                double x_223226 = tmp2_223225 * tmp2_223225;\n                double tmp3_223227 = tmp2_223225 * x_223226;\n                double w_j_223228 = defunc_0_f_res_223216 * tmp3_223227;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_235660)[sext_i32_i64(local_tid_235656)] =\n                        w_j_223228;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_235660)[sext_i32_i64(local_tid_235656)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_t_203494)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_223198;\n                double x_223199;\n                double x_235669;\n                double x_235670;\n                bool ltid_in_bounds_235672 =\n                     slt64(sext_i32_i64(local_tid_235656), q_t_203494 *\n                           squot64(segred_group_sizze_223190,\n                                   segment_sizze_nonzzero_235653));\n                int32_t skip_t",
            "hreads_235673;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_235672) {\n                        x_223199 = ((volatile __local\n                                     double *) red_arr_mem_235660)[sext_i32_i64(local_tid_235656)];\n                        if ((local_tid_235656 - squot32(local_tid_235656, 32) *\n                             32) == 0) {\n                            x_223198 = x_223199;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_235673 = 1;\n                    while (slt32(skip_threads_235673, 32)) {\n                        bool thread_active_235674 = sle32(skip_threads_235673,\n                                                          local_tid_235656 -\n                                                          squot32(local_tid_235656,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_235672;\n                        \n                        if (thread_active_235674) {\n                            // read operands\n                            {\n                                x_223198 = ((volatile __local\n                                             double *) red_arr_mem_235660)[sext_i32_i64(local_tid_235656) -\n                                                                           sext_i32_i64(skip_threads_235673)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_235675 =\n                                 slt64(srem64(sext_i32_i64(local_tid_235656),\n                                              q_t_203494),\n                                       sext_i32_i64(local_tid_235656) -\n                                       sext_i32_i64(local_tid_235656 -\n             ",
            "                          skip_threads_235673));\n                            \n                            if (thread_active_235674 && inactive_235675) {\n                                x_223198 = x_223199;\n                            }\n                            if (thread_active_235674) {\n                                if (!inactive_235675) {\n                                    double defunc_1_op_res_223200 = x_223198 +\n                                           x_223199;\n                                    \n                                    x_223198 = defunc_1_op_res_223200;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_235658, skip_threads_235673)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_235674) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_235660)[sext_i32_i64(local_tid_235656)] =\n                                    x_223198;\n                                x_223199 = x_223198;\n                            }\n                        }\n                        if (sle32(wave_sizze_235658, skip_threads_235673)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_235673 *= 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_235656 - squot32(local_tid_235656, 32) *\n                         32) == 31 && ltid_in_bounds_235672) {\n                        ((volatile __local\n                          double *) red_arr_mem_235660)[sext_i32_i64(squot32(local_tid_235656,\n                                                               ",
            "              32))] =\n                            x_223198;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n                {\n                    int32_t skip_threads_235676;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_235656, 32) == 0 &&\n                            ltid_in_bounds_235672) {\n                            x_235670 = ((volatile __local\n                                         double *) red_arr_mem_235660)[sext_i32_i64(local_tid_235656)];\n                            if ((local_tid_235656 - squot32(local_tid_235656,\n                                                            32) * 32) == 0) {\n                                x_235669 = x_235670;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_235676 = 1;\n                        while (slt32(skip_threads_235676, 32)) {\n                            bool thread_active_235677 =\n                                 sle32(skip_threads_235676, local_tid_235656 -\n                                       squot32(local_tid_235656, 32) * 32) &&\n                                 (squot32(local_tid_235656, 32) == 0 &&\n                                  ltid_in_bounds_235672);\n                            \n                            if (thread_active_235677) {\n                                // read operands\n                                {\n                                    x_235669 = ((volatile __local\n                                                 double *) red_arr_mem_235660)[sext_i32_i64(local_tid_235656) -\n                                                                               sext_i32_i64(skip_threads_235676)];\n                  ",
            "              }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_235678 =\n                                     slt64(srem64(sext_i32_i64(local_tid_235656 *\n                                                  32 + 32 - 1), q_t_203494),\n                                           sext_i32_i64(local_tid_235656 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_235656 -\n                                                         skip_threads_235676) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_235677 && inactive_235678) {\n                                    x_235669 = x_235670;\n                                }\n                                if (thread_active_235677) {\n                                    if (!inactive_235678) {\n                                        double defunc_1_op_res_235671 =\n                                               x_235669 + x_235670;\n                                        \n                                        x_235669 = defunc_1_op_res_235671;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_235658, skip_threads_235676)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_235677) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_235660)[sext_i32_i64(local_tid_235656)] =\n                                        x_235669;\n                                    x_235670 = x_235669;\n                                }\n                        ",
            "    }\n                            if (sle32(wave_sizze_235658, skip_threads_235676)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_235676 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_235679 = squot32(local_tid_235656, 32) == 0 ||\n                     !ltid_in_bounds_235672;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_235679) {\n                            x_223199 = x_223198;\n                            x_223198 = ((__local\n                                         double *) red_arr_mem_235660)[sext_i32_i64(squot32(local_tid_235656,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_235680 =\n                             slt64(srem64(sext_i32_i64(local_tid_235656),\n                                          q_t_203494),\n                                   sext_i32_i64(local_tid_235656) -\n                                   sext_i32_i64(squot32(local_tid_235656, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_235679) {\n                            if (inactive_235680) {\n                                x_223198 = x_223199;\n                            }\n                        }\n                        if (!no_carry_in_235679) {\n                            if (!inactive_235680) {\n                                double defunc_1_op_res_223200 = x_223198 +\n                     ",
            "                  x_223199;\n                                \n                                x_223198 = defunc_1_op_res_223200;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_235679) {\n                            ((__local\n                              double *) red_arr_mem_235660)[sext_i32_i64(local_tid_235656)] =\n                                x_223198;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_235656, 32) == 0 &&\n                        ltid_in_bounds_235672) {\n                        ((__local\n                          double *) red_arr_mem_235660)[sext_i32_i64(local_tid_235656)] =\n                            x_223199;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // save final values of segments\n        {\n            if (slt64(sext_i32_i64(virt_group_id_235664) *\n                      squot64(segred_group_sizze_223190,\n                              segment_sizze_nonzzero_235653) +\n                      sext_i32_i64(local_tid_235656), partition_sizze_203577 *\n                      t_n_m_203650) && slt64(sext_i32_i64(local_tid_235656),\n                                             squot64(segred_group_sizze_223190,\n                                                     segment_sizze_nonzzero_235653))) {\n                double tmp_235681;\n                \n                tmp_235681 = ((__local\n                               double *) red_arr_mem_235660)[(sext_i32_i64(local_tid_235656) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonz",
            "zero_235653 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_231027)[squot64(sext_i32_i64(virt_group_id_235664) *\n                                                squot64(segred_group_sizze_223190,\n                                                        segment_sizze_nonzzero_235653) +\n                                                sext_i32_i64(local_tid_235656),\n                                                t_n_m_203650) * t_n_m_203650 +\n                                        (sext_i32_i64(virt_group_id_235664) *\n                                         squot64(segred_group_sizze_223190,\n                                                 segment_sizze_nonzzero_235653) +\n                                         sext_i32_i64(local_tid_235656) -\n                                         squot64(sext_i32_i64(virt_group_id_235664) *\n                                                 squot64(segred_group_sizze_223190,\n                                                         segment_sizze_nonzzero_235653) +\n                                                 sext_i32_i64(local_tid_235656),\n                                                 t_n_m_203650) *\n                                         t_n_m_203650)] = tmp_235681;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_223190\n}\n__kernel void mainzisegred_small_223249(__global int *global_failure,\n                                        uint red_arr_mem_235742_backing_offset_0,\n                                        int64_t n_203490, int64_t q_t_203494,\n                                        int64_t jump_t_203500,\n                                        int64_t partition_sizze_203577,\n                                        int64_t t_n_m_203650, int64_t i_203670,\n                                        i",
            "nt64_t num_groups_223243,\n                                        int64_t segment_sizze_nonzzero_235735,\n                                        __global unsigned char *ext_mem_229196,\n                                        __global unsigned char *ext_mem_229197,\n                                        __global unsigned char *ext_mem_229460,\n                                        __global unsigned char *ext_mem_229461,\n                                        __global unsigned char *mem_231013,\n                                        __global unsigned char *mem_231017,\n                                        __global unsigned char *mem_231032,\n                                        __global unsigned char *mem_231037)\n{\n    #define segred_group_sizze_223242 (mainzisegred_group_sizze_222724)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_235742_backing_0 =\n                           &shared_mem[red_arr_mem_235742_backing_offset_0];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235737;\n    int32_t local_tid_235738;\n    int64_t group_sizze_235741;\n    int32_t wave_sizze_235740;\n    int32_t group_tid_235739;\n    \n    global_tid_235737 = get_global_id(0);\n    local_tid_235738 = get_local_id(0);\n    group_sizze_235741 = get_local_size(0);\n    wave_sizze_235740 = LOCKSTEP_WIDTH;\n    group_tid_235739 = get_group_id(0);\n    \n    int32_t phys_tid_223249 = global_tid_235737;\n    __local unsigned char *red_arr_mem_235742;\n    \n    red_arr_mem_235742 = (__local unsigned char *) red_arr_mem_235742_backing_0;\n    \n    int32_t phys_group_id_235744;\n    \n    phys_group_id_235744 = get_group_id(0);\n    for (int32_t i_235745 = 0; i_235745 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577 * t_n_m_203650,\n                                          squot64(segred_group_sizze_223242,\n                                                  segment_sizze_nonzze",
            "ro_235735))) -\n                   phys_group_id_235744, sext_i64_i32(num_groups_223243));\n         i_235745++) {\n        int32_t virt_group_id_235746 = phys_group_id_235744 + i_235745 *\n                sext_i64_i32(num_groups_223243);\n        int64_t slice_235747 = t_n_m_203650;\n        int64_t slice_235748 = partition_sizze_203577 * slice_235747;\n        int64_t gtid_223246 = squot64(squot64(sext_i32_i64(local_tid_235738),\n                                              segment_sizze_nonzzero_235735) +\n                                      sext_i32_i64(virt_group_id_235746) *\n                                      squot64(segred_group_sizze_223242,\n                                              segment_sizze_nonzzero_235735),\n                                      slice_235747);\n        int64_t remnant_235749 = squot64(sext_i32_i64(local_tid_235738),\n                                         segment_sizze_nonzzero_235735) +\n                sext_i32_i64(virt_group_id_235746) *\n                squot64(segred_group_sizze_223242,\n                        segment_sizze_nonzzero_235735) - gtid_223246 *\n                slice_235747;\n        int64_t gtid_223247 = remnant_235749;\n        int64_t remnant_235750 = remnant_235749 - gtid_223247;\n        int64_t gtid_223248 = srem64(sext_i32_i64(local_tid_235738),\n                                     q_t_203494);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_t_203494) && ((slt64(gtid_223246,\n                                                          partition_sizze_203577) &&\n                                                    slt64(gtid_223247,\n                                                          t_n_m_203650)) &&\n                                                   slt64(sext_i32_i64(local_tid_235738),\n                                                         q_t_203494 *\n                                                         squot64(segred_group_sizze_223242,\n                  ",
            "                                               segment_sizze_nonzzero_235735)))) {\n                int64_t x_223254;\n                \n                x_223254 = ((__global int64_t *) ext_mem_229196)[gtid_223246];\n                \n                int64_t x_223261;\n                \n                x_223261 = ((__global int64_t *) ext_mem_229461)[gtid_223246 *\n                                                                 t_n_m_203650 +\n                                                                 gtid_223247];\n                \n                double x_223262;\n                \n                x_223262 = ((__global double *) ext_mem_229460)[gtid_223246 *\n                                                                t_n_m_203650 +\n                                                                gtid_223247];\n                \n                int64_t binop_y_228659 = mul64(jump_t_203500, gtid_223247);\n                int64_t binop_y_228660 = smin64(i_203670, binop_y_228659);\n                int64_t index_primexp_228661 = add64((int64_t) 1,\n                                                     binop_y_228660);\n                double a0_223264;\n                \n                a0_223264 = ((__global double *) mem_231032)[gtid_223246 *\n                                                             t_n_m_203650 +\n                                                             gtid_223247];\n                \n                bool cond_223266 = sle64(x_223254, gtid_223248);\n                int64_t defunc_0_f_res_223267;\n                \n                if (cond_223266) {\n                    defunc_0_f_res_223267 = (int64_t) 0;\n                } else {\n                    int64_t i_223268 = add64(gtid_223248, x_223261);\n                    int64_t defunc_0_add_arg_223269;\n                    \n                    defunc_0_add_arg_223269 = ((__global\n                                                int64_t *) ext_mem_229197)[gtid_223246 *\n                                              ",
            "                             n_203490 +\n                                                                           i_223268];\n                    \n                    int64_t defunc_1_add_res_223270 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_223269);\n                    \n                    defunc_0_f_res_223267 = defunc_1_add_res_223270;\n                }\n                \n                double defunc_0_f_res_223271;\n                \n                if (cond_223266) {\n                    defunc_0_f_res_223271 = 0.0;\n                } else {\n                    int64_t i_223272 = add64(gtid_223248, x_223261);\n                    double defunc_0_add_arg_223273;\n                    \n                    defunc_0_add_arg_223273 = ((__global\n                                                double *) mem_231013)[gtid_223246 *\n                                                                      n_203490 +\n                                                                      i_223272];\n                    defunc_0_f_res_223271 = defunc_0_add_arg_223273;\n                }\n                \n                int64_t binop_p_223274 = sub64(defunc_0_f_res_223267,\n                                               index_primexp_228661);\n                double defunc_0_f_res_223275 = sitofp_i64_f64(binop_p_223274);\n                double abs_res_223276 = fabs(defunc_0_f_res_223275);\n                double tmp1_223277 = abs_res_223276 / x_223262;\n                double x_223278 = tmp1_223277 * tmp1_223277;\n                double y_223279 = tmp1_223277 * x_223278;\n                double tmp2_223280 = 1.0 - y_223279;\n                double x_223281 = tmp2_223280 * tmp2_223280;\n                double tmp3_223282 = tmp2_223280 * x_223281;\n                double tmp4_223283 = defunc_0_f_res_223271 * tmp3_223282;\n                double defunc_0_f_res_223284;\n                \n                if (cond_223266) {\n                    defunc_0_f",
            "_res_223284 = 0.0;\n                } else {\n                    int64_t i_223285 = add64(gtid_223248, x_223261);\n                    double defunc_0_add_arg_223286;\n                    \n                    defunc_0_add_arg_223286 = ((__global\n                                                double *) mem_231017)[gtid_223246 *\n                                                                      n_203490 +\n                                                                      i_223285];\n                    defunc_0_f_res_223284 = defunc_0_add_arg_223286;\n                }\n                \n                double x_223287 = a0_223264 * tmp4_223283;\n                double defunc_9_fit_fun_res_223288 = defunc_0_f_res_223284 *\n                       x_223287;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_235742)[sext_i32_i64(local_tid_235738)] =\n                        defunc_9_fit_fun_res_223288;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_235742)[sext_i32_i64(local_tid_235738)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_t_203494)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_223250;\n                double x_223251;\n                double x_235751;\n                double x_235752;\n                bool ltid_in_bounds_235754 =\n                     slt64(sext_i32_i64(local_tid_235738), q_t_203494 *\n                           squot64(segred_group_sizze_223242,\n                                   segment_sizze_nonzzero_235735));\n                int32_t skip_threads_235755;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_235754) {\n                   ",
            "     x_223251 = ((volatile __local\n                                     double *) red_arr_mem_235742)[sext_i32_i64(local_tid_235738)];\n                        if ((local_tid_235738 - squot32(local_tid_235738, 32) *\n                             32) == 0) {\n                            x_223250 = x_223251;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_235755 = 1;\n                    while (slt32(skip_threads_235755, 32)) {\n                        bool thread_active_235756 = sle32(skip_threads_235755,\n                                                          local_tid_235738 -\n                                                          squot32(local_tid_235738,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_235754;\n                        \n                        if (thread_active_235756) {\n                            // read operands\n                            {\n                                x_223250 = ((volatile __local\n                                             double *) red_arr_mem_235742)[sext_i32_i64(local_tid_235738) -\n                                                                           sext_i32_i64(skip_threads_235755)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_235757 =\n                                 slt64(srem64(sext_i32_i64(local_tid_235738),\n                                              q_t_203494),\n                                       sext_i32_i64(local_tid_235738) -\n                                       sext_i32_i64(local_tid_235738 -\n                                       skip_threads_235755));\n                            \n                            if (thread_active_235756 && inactive_235757) {\n             ",
            "                   x_223250 = x_223251;\n                            }\n                            if (thread_active_235756) {\n                                if (!inactive_235757) {\n                                    double defunc_1_op_res_223252 = x_223250 +\n                                           x_223251;\n                                    \n                                    x_223250 = defunc_1_op_res_223252;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_235740, skip_threads_235755)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_235756) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_235742)[sext_i32_i64(local_tid_235738)] =\n                                    x_223250;\n                                x_223251 = x_223250;\n                            }\n                        }\n                        if (sle32(wave_sizze_235740, skip_threads_235755)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_235755 *= 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_235738 - squot32(local_tid_235738, 32) *\n                         32) == 31 && ltid_in_bounds_235754) {\n                        ((volatile __local\n                          double *) red_arr_mem_235742)[sext_i32_i64(squot32(local_tid_235738,\n                                                                             32))] =\n                            x_223250;\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_235758;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_235738, 32) == 0 &&\n                            ltid_in_bounds_235754) {\n                            x_235752 = ((volatile __local\n                                         double *) red_arr_mem_235742)[sext_i32_i64(local_tid_235738)];\n                            if ((local_tid_235738 - squot32(local_tid_235738,\n                                                            32) * 32) == 0) {\n                                x_235751 = x_235752;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_235758 = 1;\n                        while (slt32(skip_threads_235758, 32)) {\n                            bool thread_active_235759 =\n                                 sle32(skip_threads_235758, local_tid_235738 -\n                                       squot32(local_tid_235738, 32) * 32) &&\n                                 (squot32(local_tid_235738, 32) == 0 &&\n                                  ltid_in_bounds_235754);\n                            \n                            if (thread_active_235759) {\n                                // read operands\n                                {\n                                    x_235751 = ((volatile __local\n                                                 double *) red_arr_mem_235742)[sext_i32_i64(local_tid_235738) -\n                                                                               sext_i32_i64(skip_threads_235758)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inac",
            "tive_235760 =\n                                     slt64(srem64(sext_i32_i64(local_tid_235738 *\n                                                  32 + 32 - 1), q_t_203494),\n                                           sext_i32_i64(local_tid_235738 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_235738 -\n                                                         skip_threads_235758) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_235759 && inactive_235760) {\n                                    x_235751 = x_235752;\n                                }\n                                if (thread_active_235759) {\n                                    if (!inactive_235760) {\n                                        double defunc_1_op_res_235753 =\n                                               x_235751 + x_235752;\n                                        \n                                        x_235751 = defunc_1_op_res_235753;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_235740, skip_threads_235758)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_235759) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_235742)[sext_i32_i64(local_tid_235738)] =\n                                        x_235751;\n                                    x_235752 = x_235751;\n                                }\n                            }\n                            if (sle32(wave_sizze_235740, skip_threads_235758)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                 ",
            "           }\n                            skip_threads_235758 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_235761 = squot32(local_tid_235738, 32) == 0 ||\n                     !ltid_in_bounds_235754;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_235761) {\n                            x_223251 = x_223250;\n                            x_223250 = ((__local\n                                         double *) red_arr_mem_235742)[sext_i32_i64(squot32(local_tid_235738,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_235762 =\n                             slt64(srem64(sext_i32_i64(local_tid_235738),\n                                          q_t_203494),\n                                   sext_i32_i64(local_tid_235738) -\n                                   sext_i32_i64(squot32(local_tid_235738, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_235761) {\n                            if (inactive_235762) {\n                                x_223250 = x_223251;\n                            }\n                        }\n                        if (!no_carry_in_235761) {\n                            if (!inactive_235762) {\n                                double defunc_1_op_res_223252 = x_223250 +\n                                       x_223251;\n                                \n                                x_223250 = defunc_1_op_res_223252;\n                            }\n        ",
            "                }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_235761) {\n                            ((__local\n                              double *) red_arr_mem_235742)[sext_i32_i64(local_tid_235738)] =\n                                x_223250;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_235738, 32) == 0 &&\n                        ltid_in_bounds_235754) {\n                        ((__local\n                          double *) red_arr_mem_235742)[sext_i32_i64(local_tid_235738)] =\n                            x_223251;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // save final values of segments\n        {\n            if (slt64(sext_i32_i64(virt_group_id_235746) *\n                      squot64(segred_group_sizze_223242,\n                              segment_sizze_nonzzero_235735) +\n                      sext_i32_i64(local_tid_235738), partition_sizze_203577 *\n                      t_n_m_203650) && slt64(sext_i32_i64(local_tid_235738),\n                                             squot64(segred_group_sizze_223242,\n                                                     segment_sizze_nonzzero_235735))) {\n                double tmp_235763;\n                \n                tmp_235763 = ((__local\n                               double *) red_arr_mem_235742)[(sext_i32_i64(local_tid_235738) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_235735 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_231037)[squot64(se",
            "xt_i32_i64(virt_group_id_235746) *\n                                                squot64(segred_group_sizze_223242,\n                                                        segment_sizze_nonzzero_235735) +\n                                                sext_i32_i64(local_tid_235738),\n                                                t_n_m_203650) * t_n_m_203650 +\n                                        (sext_i32_i64(virt_group_id_235746) *\n                                         squot64(segred_group_sizze_223242,\n                                                 segment_sizze_nonzzero_235735) +\n                                         sext_i32_i64(local_tid_235738) -\n                                         squot64(sext_i32_i64(virt_group_id_235746) *\n                                                 squot64(segred_group_sizze_223242,\n                                                         segment_sizze_nonzzero_235735) +\n                                                 sext_i32_i64(local_tid_235738),\n                                                 t_n_m_203650) *\n                                         t_n_m_203650)] = tmp_235763;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_223242\n}\n__kernel void mainzisegred_small_224235(__global int *global_failure,\n                                        uint red_arr_mem_235895_backing_offset_0,\n                                        uint red_arr_mem_235893_backing_offset_1,\n                                        uint red_arr_mem_235891_backing_offset_2,\n                                        int64_t n_203490, int64_t q_t_203494,\n                                        int64_t jump_t_203500,\n                                        int64_t partition_sizze_203577,\n                                        int64_t t_n_m_203650, int64_t i_203670,\n                                        int",
            "64_t num_groups_224227,\n                                        int64_t segment_sizze_nonzzero_235884,\n                                        __global unsigned char *ext_mem_229196,\n                                        __global unsigned char *ext_mem_229197,\n                                        __global unsigned char *ext_mem_229460,\n                                        __global unsigned char *ext_mem_229461,\n                                        __global unsigned char *mem_231151,\n                                        __global unsigned char *mem_231169,\n                                        __global unsigned char *mem_231173,\n                                        __global unsigned char *mem_231177)\n{\n    #define segred_group_sizze_224226 (mainzisegred_group_sizze_223755)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_235895_backing_2 =\n                           &shared_mem[red_arr_mem_235895_backing_offset_0];\n    volatile unsigned char *red_arr_mem_235893_backing_1 =\n                           &shared_mem[red_arr_mem_235893_backing_offset_1];\n    volatile unsigned char *red_arr_mem_235891_backing_0 =\n                           &shared_mem[red_arr_mem_235891_backing_offset_2];\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_224235 = 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 *red_arr_mem_235893;\n    \n    red_arr_mem_235893 = (__loc",
            "al unsigned char *) red_arr_mem_235893_backing_1;\n    \n    __local unsigned char *red_arr_mem_235895;\n    \n    red_arr_mem_235895 = (__local unsigned char *) red_arr_mem_235895_backing_2;\n    \n    int32_t phys_group_id_235897;\n    \n    phys_group_id_235897 = get_group_id(0);\n    for (int32_t i_235898 = 0; i_235898 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577 * t_n_m_203650,\n                                          squot64(segred_group_sizze_224226,\n                                                  segment_sizze_nonzzero_235884))) -\n                   phys_group_id_235897, sext_i64_i32(num_groups_224227));\n         i_235898++) {\n        int32_t virt_group_id_235899 = phys_group_id_235897 + i_235898 *\n                sext_i64_i32(num_groups_224227);\n        int64_t slice_235900 = t_n_m_203650;\n        int64_t slice_235901 = partition_sizze_203577 * slice_235900;\n        int64_t gtid_224232 = squot64(squot64(sext_i32_i64(local_tid_235887),\n                                              segment_sizze_nonzzero_235884) +\n                                      sext_i32_i64(virt_group_id_235899) *\n                                      squot64(segred_group_sizze_224226,\n                                              segment_sizze_nonzzero_235884),\n                                      slice_235900);\n        int64_t remnant_235902 = squot64(sext_i32_i64(local_tid_235887),\n                                         segment_sizze_nonzzero_235884) +\n                sext_i32_i64(virt_group_id_235899) *\n                squot64(segred_group_sizze_224226,\n                        segment_sizze_nonzzero_235884) - gtid_224232 *\n                slice_235900;\n        int64_t gtid_224233 = remnant_235902;\n        int64_t remnant_235903 = remnant_235902 - gtid_224233;\n        int64_t gtid_224234 = srem64(sext_i32_i64(local_tid_235887),\n                                     q_t_203494);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int",
            "64_t) 0, q_t_203494) && ((slt64(gtid_224232,\n                                                          partition_sizze_203577) &&\n                                                    slt64(gtid_224233,\n                                                          t_n_m_203650)) &&\n                                                   slt64(sext_i32_i64(local_tid_235887),\n                                                         q_t_203494 *\n                                                         squot64(segred_group_sizze_224226,\n                                                                 segment_sizze_nonzzero_235884)))) {\n                int64_t x_224246;\n                \n                x_224246 = ((__global int64_t *) ext_mem_229196)[gtid_224232];\n                \n                int64_t x_224251;\n                \n                x_224251 = ((__global int64_t *) ext_mem_229461)[gtid_224232 *\n                                                                 t_n_m_203650 +\n                                                                 gtid_224233];\n                \n                double x_224252;\n                \n                x_224252 = ((__global double *) ext_mem_229460)[gtid_224232 *\n                                                                t_n_m_203650 +\n                                                                gtid_224233];\n                \n                int64_t binop_y_228674 = mul64(jump_t_203500, gtid_224233);\n                int64_t binop_y_228675 = smin64(i_203670, binop_y_228674);\n                int64_t index_primexp_228676 = add64((int64_t) 1,\n                                                     binop_y_228675);\n                bool cond_224255 = sle64(x_224246, gtid_224234);\n                int64_t defunc_0_f_res_224256;\n                \n                if (cond_224255) {\n                    defunc_0_f_res_224256 = (int64_t) 0;\n                } else {\n                    int64_t i_224257 = add64(gtid_224234, x_224251);\n              ",
            "      int64_t defunc_0_add_arg_224258;\n                    \n                    defunc_0_add_arg_224258 = ((__global\n                                                int64_t *) ext_mem_229197)[gtid_224232 *\n                                                                           n_203490 +\n                                                                           i_224257];\n                    \n                    int64_t defunc_1_add_res_224259 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_224258);\n                    \n                    defunc_0_f_res_224256 = defunc_1_add_res_224259;\n                }\n                \n                double defunc_0_f_res_224260;\n                \n                if (cond_224255) {\n                    defunc_0_f_res_224260 = 0.0;\n                } else {\n                    int64_t i_224261 = add64(gtid_224234, x_224251);\n                    double defunc_0_add_arg_224262;\n                    \n                    defunc_0_add_arg_224262 = ((__global\n                                                double *) mem_231151)[gtid_224232 *\n                                                                      n_203490 +\n                                                                      i_224261];\n                    defunc_0_f_res_224260 = defunc_0_add_arg_224262;\n                }\n                \n                int64_t binop_p_224263 = sub64(defunc_0_f_res_224256,\n                                               index_primexp_228676);\n                double defunc_0_f_res_224264 = sitofp_i64_f64(binop_p_224263);\n                double abs_res_224265 = fabs(defunc_0_f_res_224264);\n                double tmp1_224266 = abs_res_224265 / x_224252;\n                double x_224267 = tmp1_224266 * tmp1_224266;\n                double y_224268 = tmp1_224266 * x_224267;\n                double tmp2_224269 = 1.0 - y_224268;\n                double x_224270 = tmp2_224269 * tmp2_224269;\n           ",
            "     double tmp3_224271 = tmp2_224269 * x_224270;\n                double w_j_224272 = defunc_0_f_res_224260 * tmp3_224271;\n                double xw_j_224273 = defunc_0_f_res_224264 * w_j_224272;\n                double x2w_j_224274 = defunc_0_f_res_224264 * xw_j_224273;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_235891)[sext_i32_i64(local_tid_235887)] =\n                        w_j_224272;\n                    ((__local\n                      double *) red_arr_mem_235893)[sext_i32_i64(local_tid_235887)] =\n                        xw_j_224273;\n                    ((__local\n                      double *) red_arr_mem_235895)[sext_i32_i64(local_tid_235887)] =\n                        x2w_j_224274;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_235891)[sext_i32_i64(local_tid_235887)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_235893)[sext_i32_i64(local_tid_235887)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_235895)[sext_i32_i64(local_tid_235887)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_t_203494)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_224236;\n                double x_224237;\n                double x_224238;\n                double x_224239;\n                double x_224240;\n                double x_224241;\n                double x_235904;\n                double x_235905;\n                double x_235906;\n                double x_235907;\n                double x_235908;\n                double x_235909;\n                bool ltid_in_bounds_235913 =\n                     slt64(sext_i32_i64(local_tid_235887), q_t_203494",
            " *\n                           squot64(segred_group_sizze_224226,\n                                   segment_sizze_nonzzero_235884));\n                int32_t skip_threads_235914;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_235913) {\n                        x_224239 = ((volatile __local\n                                     double *) red_arr_mem_235891)[sext_i32_i64(local_tid_235887)];\n                        x_224240 = ((volatile __local\n                                     double *) red_arr_mem_235893)[sext_i32_i64(local_tid_235887)];\n                        x_224241 = ((volatile __local\n                                     double *) red_arr_mem_235895)[sext_i32_i64(local_tid_235887)];\n                        if ((local_tid_235887 - squot32(local_tid_235887, 32) *\n                             32) == 0) {\n                            x_224236 = x_224239;\n                            x_224237 = x_224240;\n                            x_224238 = x_224241;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_235914 = 1;\n                    while (slt32(skip_threads_235914, 32)) {\n                        bool thread_active_235915 = sle32(skip_threads_235914,\n                                                          local_tid_235887 -\n                                                          squot32(local_tid_235887,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_235913;\n                        \n                        if (thread_active_235915) {\n                            // read operands\n                            {\n                                x_224236 = ((volatile __local\n                                             double *) red_arr_mem_235891)[sext_i32_i64(local_tid_235887) -\n             ",
            "                                                              sext_i32_i64(skip_threads_235914)];\n                                x_224237 = ((volatile __local\n                                             double *) red_arr_mem_235893)[sext_i32_i64(local_tid_235887) -\n                                                                           sext_i32_i64(skip_threads_235914)];\n                                x_224238 = ((volatile __local\n                                             double *) red_arr_mem_235895)[sext_i32_i64(local_tid_235887) -\n                                                                           sext_i32_i64(skip_threads_235914)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_235916 =\n                                 slt64(srem64(sext_i32_i64(local_tid_235887),\n                                              q_t_203494),\n                                       sext_i32_i64(local_tid_235887) -\n                                       sext_i32_i64(local_tid_235887 -\n                                       skip_threads_235914));\n                            \n                            if (thread_active_235915 && inactive_235916) {\n                                x_224236 = x_224239;\n                                x_224237 = x_224240;\n                                x_224238 = x_224241;\n                            }\n                            if (thread_active_235915) {\n                                if (!inactive_235916) {\n                                    double defunc_1_op_res_224242 = x_224236 +\n                                           x_224239;\n                                    double defunc_1_op_res_224243 = x_224237 +\n                                           x_224240;\n                                    double defunc_1_op_res_224244 = x_224238 +\n                                           x_224241;\n                   ",
            "                 \n                                    x_224236 = defunc_1_op_res_224242;\n                                    x_224237 = defunc_1_op_res_224243;\n                                    x_224238 = defunc_1_op_res_224244;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_235889, skip_threads_235914)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_235915) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_235891)[sext_i32_i64(local_tid_235887)] =\n                                    x_224236;\n                                x_224239 = x_224236;\n                                ((volatile __local\n                                  double *) red_arr_mem_235893)[sext_i32_i64(local_tid_235887)] =\n                                    x_224237;\n                                x_224240 = x_224237;\n                                ((volatile __local\n                                  double *) red_arr_mem_235895)[sext_i32_i64(local_tid_235887)] =\n                                    x_224238;\n                                x_224241 = x_224238;\n                            }\n                        }\n                        if (sle32(wave_sizze_235889, skip_threads_235914)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_235914 *= 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_235887 - squot32(local_tid_235887, 32) *\n                         32) == 31 && ltid_in_bounds_235913) {\n                        ((volatile __local\n                   ",
            "       double *) red_arr_mem_235891)[sext_i32_i64(squot32(local_tid_235887,\n                                                                             32))] =\n                            x_224236;\n                        ((volatile __local\n                          double *) red_arr_mem_235893)[sext_i32_i64(squot32(local_tid_235887,\n                                                                             32))] =\n                            x_224237;\n                        ((volatile __local\n                          double *) red_arr_mem_235895)[sext_i32_i64(squot32(local_tid_235887,\n                                                                             32))] =\n                            x_224238;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n                {\n                    int32_t skip_threads_235917;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_235887, 32) == 0 &&\n                            ltid_in_bounds_235913) {\n                            x_235907 = ((volatile __local\n                                         double *) red_arr_mem_235891)[sext_i32_i64(local_tid_235887)];\n                            x_235908 = ((volatile __local\n                                         double *) red_arr_mem_235893)[sext_i32_i64(local_tid_235887)];\n                            x_235909 = ((volatile __local\n                                         double *) red_arr_mem_235895)[sext_i32_i64(local_tid_235887)];\n                            if ((local_tid_235887 - squot32(local_tid_235887,\n                                                            32) * 32) == 0) {\n                                x_235904 = x_235907;\n                                x_235905 = x_235908;\n                                x_235906 = x_235909;\n             ",
            "               }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_235917 = 1;\n                        while (slt32(skip_threads_235917, 32)) {\n                            bool thread_active_235918 =\n                                 sle32(skip_threads_235917, local_tid_235887 -\n                                       squot32(local_tid_235887, 32) * 32) &&\n                                 (squot32(local_tid_235887, 32) == 0 &&\n                                  ltid_in_bounds_235913);\n                            \n                            if (thread_active_235918) {\n                                // read operands\n                                {\n                                    x_235904 = ((volatile __local\n                                                 double *) red_arr_mem_235891)[sext_i32_i64(local_tid_235887) -\n                                                                               sext_i32_i64(skip_threads_235917)];\n                                    x_235905 = ((volatile __local\n                                                 double *) red_arr_mem_235893)[sext_i32_i64(local_tid_235887) -\n                                                                               sext_i32_i64(skip_threads_235917)];\n                                    x_235906 = ((volatile __local\n                                                 double *) red_arr_mem_235895)[sext_i32_i64(local_tid_235887) -\n                                                                               sext_i32_i64(skip_threads_235917)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_235919 =\n                                     slt64(srem64(sext_i32_i64(local_tid_235887 *\n                                                  32 + 32 - 1",
            "), q_t_203494),\n                                           sext_i32_i64(local_tid_235887 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_235887 -\n                                                         skip_threads_235917) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_235918 && inactive_235919) {\n                                    x_235904 = x_235907;\n                                    x_235905 = x_235908;\n                                    x_235906 = x_235909;\n                                }\n                                if (thread_active_235918) {\n                                    if (!inactive_235919) {\n                                        double defunc_1_op_res_235910 =\n                                               x_235904 + x_235907;\n                                        double defunc_1_op_res_235911 =\n                                               x_235905 + x_235908;\n                                        double defunc_1_op_res_235912 =\n                                               x_235906 + x_235909;\n                                        \n                                        x_235904 = defunc_1_op_res_235910;\n                                        x_235905 = defunc_1_op_res_235911;\n                                        x_235906 = defunc_1_op_res_235912;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_235889, skip_threads_235917)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_235918) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *",
            ") red_arr_mem_235891)[sext_i32_i64(local_tid_235887)] =\n                                        x_235904;\n                                    x_235907 = x_235904;\n                                    ((volatile __local\n                                      double *) red_arr_mem_235893)[sext_i32_i64(local_tid_235887)] =\n                                        x_235905;\n                                    x_235908 = x_235905;\n                                    ((volatile __local\n                                      double *) red_arr_mem_235895)[sext_i32_i64(local_tid_235887)] =\n                                        x_235906;\n                                    x_235909 = x_235906;\n                                }\n                            }\n                            if (sle32(wave_sizze_235889, skip_threads_235917)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_235917 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_235920 = squot32(local_tid_235887, 32) == 0 ||\n                     !ltid_in_bounds_235913;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_235920) {\n                            x_224239 = x_224236;\n                            x_224240 = x_224237;\n                            x_224241 = x_224238;\n                            x_224236 = ((__local\n                                         double *) red_arr_mem_235891)[sext_i32_i64(squot32(local_tid_235887,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_224237 = ((__local\n                   ",
            "                      double *) red_arr_mem_235893)[sext_i32_i64(squot32(local_tid_235887,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_224238 = ((__local\n                                         double *) red_arr_mem_235895)[sext_i32_i64(squot32(local_tid_235887,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_235921 =\n                             slt64(srem64(sext_i32_i64(local_tid_235887),\n                                          q_t_203494),\n                                   sext_i32_i64(local_tid_235887) -\n                                   sext_i32_i64(squot32(local_tid_235887, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_235920) {\n                            if (inactive_235921) {\n                                x_224236 = x_224239;\n                                x_224237 = x_224240;\n                                x_224238 = x_224241;\n                            }\n                        }\n                        if (!no_carry_in_235920) {\n                            if (!inactive_235921) {\n                                double defunc_1_op_res_224242 = x_224236 +\n                                       x_224239;\n                                double defunc_1_op_res_224243 = x_224237 +\n                                       x_224240;\n                                double defunc_1_op_res_224244 = x_224238 +\n                                       x_224241;\n                                \n                                x_224236 = defunc_1_",
            "op_res_224242;\n                                x_224237 = defunc_1_op_res_224243;\n                                x_224238 = defunc_1_op_res_224244;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_235920) {\n                            ((__local\n                              double *) red_arr_mem_235891)[sext_i32_i64(local_tid_235887)] =\n                                x_224236;\n                            ((__local\n                              double *) red_arr_mem_235893)[sext_i32_i64(local_tid_235887)] =\n                                x_224237;\n                            ((__local\n                              double *) red_arr_mem_235895)[sext_i32_i64(local_tid_235887)] =\n                                x_224238;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_235887, 32) == 0 &&\n                        ltid_in_bounds_235913) {\n                        ((__local\n                          double *) red_arr_mem_235891)[sext_i32_i64(local_tid_235887)] =\n                            x_224239;\n                        ((__local\n                          double *) red_arr_mem_235893)[sext_i32_i64(local_tid_235887)] =\n                            x_224240;\n                        ((__local\n                          double *) red_arr_mem_235895)[sext_i32_i64(local_tid_235887)] =\n                            x_224241;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // save final values of segments\n        {\n            if (slt64(sext_i32_i64(virt_group_id_235899) *\n                      squot64(segred_group_sizze_224226,\n                              segmen",
            "t_sizze_nonzzero_235884) +\n                      sext_i32_i64(local_tid_235887), partition_sizze_203577 *\n                      t_n_m_203650) && slt64(sext_i32_i64(local_tid_235887),\n                                             squot64(segred_group_sizze_224226,\n                                                     segment_sizze_nonzzero_235884))) {\n                double tmp_235922;\n                \n                tmp_235922 = ((__local\n                               double *) red_arr_mem_235891)[(sext_i32_i64(local_tid_235887) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_235884 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_231169)[squot64(sext_i32_i64(virt_group_id_235899) *\n                                                squot64(segred_group_sizze_224226,\n                                                        segment_sizze_nonzzero_235884) +\n                                                sext_i32_i64(local_tid_235887),\n                                                t_n_m_203650) * t_n_m_203650 +\n                                        (sext_i32_i64(virt_group_id_235899) *\n                                         squot64(segred_group_sizze_224226,\n                                                 segment_sizze_nonzzero_235884) +\n                                         sext_i32_i64(local_tid_235887) -\n                                         squot64(sext_i32_i64(virt_group_id_235899) *\n                                                 squot64(segred_group_sizze_224226,\n                                                         segment_sizze_nonzzero_235884) +\n                                                 sext_i32_i64(local_tid_235887),\n                                                 t_n_m_203650) *\n                                         t_n_m_203650)] = t",
            "mp_235922;\n                \n                double tmp_235923;\n                \n                tmp_235923 = ((__local\n                               double *) red_arr_mem_235893)[(sext_i32_i64(local_tid_235887) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_235884 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_231173)[squot64(sext_i32_i64(virt_group_id_235899) *\n                                                squot64(segred_group_sizze_224226,\n                                                        segment_sizze_nonzzero_235884) +\n                                                sext_i32_i64(local_tid_235887),\n                                                t_n_m_203650) * t_n_m_203650 +\n                                        (sext_i32_i64(virt_group_id_235899) *\n                                         squot64(segred_group_sizze_224226,\n                                                 segment_sizze_nonzzero_235884) +\n                                         sext_i32_i64(local_tid_235887) -\n                                         squot64(sext_i32_i64(virt_group_id_235899) *\n                                                 squot64(segred_group_sizze_224226,\n                                                         segment_sizze_nonzzero_235884) +\n                                                 sext_i32_i64(local_tid_235887),\n                                                 t_n_m_203650) *\n                                         t_n_m_203650)] = tmp_235923;\n                \n                double tmp_235924;\n                \n                tmp_235924 = ((__local\n                               double *) red_arr_mem_235895)[(sext_i32_i64(local_tid_235887) +\n                                                              (int64_t) 1) *\n                                ",
            "                             segment_sizze_nonzzero_235884 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_231177)[squot64(sext_i32_i64(virt_group_id_235899) *\n                                                squot64(segred_group_sizze_224226,\n                                                        segment_sizze_nonzzero_235884) +\n                                                sext_i32_i64(local_tid_235887),\n                                                t_n_m_203650) * t_n_m_203650 +\n                                        (sext_i32_i64(virt_group_id_235899) *\n                                         squot64(segred_group_sizze_224226,\n                                                 segment_sizze_nonzzero_235884) +\n                                         sext_i32_i64(local_tid_235887) -\n                                         squot64(sext_i32_i64(virt_group_id_235899) *\n                                                 squot64(segred_group_sizze_224226,\n                                                         segment_sizze_nonzzero_235884) +\n                                                 sext_i32_i64(local_tid_235887),\n                                                 t_n_m_203650) *\n                                         t_n_m_203650)] = tmp_235924;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_224226\n}\n__kernel void mainzisegred_small_224307(__global int *global_failure,\n                                        uint red_arr_mem_236003_backing_offset_0,\n                                        uint red_arr_mem_236001_backing_offset_1,\n                                        int64_t n_203490, int64_t q_t_203494,\n                                        int64_t jump_t_203500,\n                                        int64_t partition_sizze_",
            "203577,\n                                        int64_t t_n_m_203650, int64_t i_203670,\n                                        int64_t num_groups_224300,\n                                        int64_t segment_sizze_nonzzero_235994,\n                                        __global unsigned char *ext_mem_229196,\n                                        __global unsigned char *ext_mem_229197,\n                                        __global unsigned char *ext_mem_229460,\n                                        __global unsigned char *ext_mem_229461,\n                                        __global unsigned char *mem_231151,\n                                        __global unsigned char *mem_231155,\n                                        __global unsigned char *mem_231182,\n                                        __global unsigned char *mem_231186,\n                                        __global unsigned char *mem_231190,\n                                        __global unsigned char *mem_231195,\n                                        __global unsigned char *mem_231199)\n{\n    #define segred_group_sizze_224299 (mainzisegred_group_sizze_223658)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_236003_backing_1 =\n                           &shared_mem[red_arr_mem_236003_backing_offset_0];\n    volatile unsigned char *red_arr_mem_236001_backing_0 =\n                           &shared_mem[red_arr_mem_236001_backing_offset_1];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235996;\n    int32_t local_tid_235997;\n    int64_t group_sizze_236000;\n    int32_t wave_sizze_235999;\n    int32_t group_tid_235998;\n    \n    global_tid_235996 = get_global_id(0);\n    local_tid_235997 = get_local_id(0);\n    group_sizze_236000 = get_local_size(0);\n    wave_sizze_235999 = LOCKSTEP_WIDTH;\n    group_tid_235998 = get_group_id(0);\n    \n    int32_t phys_tid_224307 = global_tid_235996",
            ";\n    __local unsigned char *red_arr_mem_236001;\n    \n    red_arr_mem_236001 = (__local unsigned char *) red_arr_mem_236001_backing_0;\n    \n    __local unsigned char *red_arr_mem_236003;\n    \n    red_arr_mem_236003 = (__local unsigned char *) red_arr_mem_236003_backing_1;\n    \n    int32_t phys_group_id_236005;\n    \n    phys_group_id_236005 = get_group_id(0);\n    for (int32_t i_236006 = 0; i_236006 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577 * t_n_m_203650,\n                                          squot64(segred_group_sizze_224299,\n                                                  segment_sizze_nonzzero_235994))) -\n                   phys_group_id_236005, sext_i64_i32(num_groups_224300));\n         i_236006++) {\n        int32_t virt_group_id_236007 = phys_group_id_236005 + i_236006 *\n                sext_i64_i32(num_groups_224300);\n        int64_t slice_236008 = t_n_m_203650;\n        int64_t slice_236009 = partition_sizze_203577 * slice_236008;\n        int64_t gtid_224304 = squot64(squot64(sext_i32_i64(local_tid_235997),\n                                              segment_sizze_nonzzero_235994) +\n                                      sext_i32_i64(virt_group_id_236007) *\n                                      squot64(segred_group_sizze_224299,\n                                              segment_sizze_nonzzero_235994),\n                                      slice_236008);\n        int64_t remnant_236010 = squot64(sext_i32_i64(local_tid_235997),\n                                         segment_sizze_nonzzero_235994) +\n                sext_i32_i64(virt_group_id_236007) *\n                squot64(segred_group_sizze_224299,\n                        segment_sizze_nonzzero_235994) - gtid_224304 *\n                slice_236008;\n        int64_t gtid_224305 = remnant_236010;\n        int64_t remnant_236011 = remnant_236010 - gtid_224305;\n        int64_t gtid_224306 = srem64(sext_i32_i64(local_tid_235997),\n                                     q_t_203494);\n   ",
            "     \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_t_203494) && ((slt64(gtid_224304,\n                                                          partition_sizze_203577) &&\n                                                    slt64(gtid_224305,\n                                                          t_n_m_203650)) &&\n                                                   slt64(sext_i32_i64(local_tid_235997),\n                                                         q_t_203494 *\n                                                         squot64(segred_group_sizze_224299,\n                                                                 segment_sizze_nonzzero_235994)))) {\n                int64_t x_224315;\n                \n                x_224315 = ((__global int64_t *) ext_mem_229196)[gtid_224304];\n                \n                int64_t x_224324;\n                \n                x_224324 = ((__global int64_t *) ext_mem_229461)[gtid_224304 *\n                                                                 t_n_m_203650 +\n                                                                 gtid_224305];\n                \n                double x_224325;\n                \n                x_224325 = ((__global double *) ext_mem_229460)[gtid_224304 *\n                                                                t_n_m_203650 +\n                                                                gtid_224305];\n                \n                int64_t binop_y_228669 = mul64(jump_t_203500, gtid_224305);\n                int64_t binop_y_228670 = smin64(i_203670, binop_y_228669);\n                int64_t index_primexp_228671 = add64((int64_t) 1,\n                                                     binop_y_228670);\n                double a11_224327;\n                \n                a11_224327 = ((__global double *) mem_231182)[gtid_224304 *\n                                                              t_n_m_203650 +\n                                       ",
            "                       gtid_224305];\n                \n                double b11_224328;\n                \n                b11_224328 = ((__global double *) mem_231186)[gtid_224304 *\n                                                              t_n_m_203650 +\n                                                              gtid_224305];\n                \n                double c11_224329;\n                \n                c11_224329 = ((__global double *) mem_231190)[gtid_224304 *\n                                                              t_n_m_203650 +\n                                                              gtid_224305];\n                \n                bool cond_224331 = sle64(x_224315, gtid_224306);\n                int64_t defunc_0_f_res_224332;\n                \n                if (cond_224331) {\n                    defunc_0_f_res_224332 = (int64_t) 0;\n                } else {\n                    int64_t i_224333 = add64(gtid_224306, x_224324);\n                    int64_t defunc_0_add_arg_224334;\n                    \n                    defunc_0_add_arg_224334 = ((__global\n                                                int64_t *) ext_mem_229197)[gtid_224304 *\n                                                                           n_203490 +\n                                                                           i_224333];\n                    \n                    int64_t defunc_1_add_res_224335 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_224334);\n                    \n                    defunc_0_f_res_224332 = defunc_1_add_res_224335;\n                }\n                \n                double defunc_0_f_res_224336;\n                \n                if (cond_224331) {\n                    defunc_0_f_res_224336 = 0.0;\n                } else {\n                    int64_t i_224337 = add64(gtid_224306, x_224324);\n                    double defunc_0_add_arg_224338;\n                    \n                    defu",
            "nc_0_add_arg_224338 = ((__global\n                                                double *) mem_231151)[gtid_224304 *\n                                                                      n_203490 +\n                                                                      i_224337];\n                    defunc_0_f_res_224336 = defunc_0_add_arg_224338;\n                }\n                \n                int64_t binop_p_224339 = sub64(defunc_0_f_res_224332,\n                                               index_primexp_228671);\n                double defunc_0_f_res_224340 = sitofp_i64_f64(binop_p_224339);\n                double abs_res_224341 = fabs(defunc_0_f_res_224340);\n                double tmp1_224342 = abs_res_224341 / x_224325;\n                double x_224343 = tmp1_224342 * tmp1_224342;\n                double y_224344 = tmp1_224342 * x_224343;\n                double tmp2_224345 = 1.0 - y_224344;\n                double x_224346 = tmp2_224345 * tmp2_224345;\n                double tmp3_224347 = tmp2_224345 * x_224346;\n                double tmp4_224348 = defunc_0_f_res_224336 * tmp3_224347;\n                double defunc_1_f_res_224349 = defunc_0_f_res_224340 *\n                       tmp4_224348;\n                double defunc_0_f_res_224350;\n                \n                if (cond_224331) {\n                    defunc_0_f_res_224350 = 0.0;\n                } else {\n                    int64_t i_224351 = add64(gtid_224306, x_224324);\n                    double defunc_0_add_arg_224352;\n                    \n                    defunc_0_add_arg_224352 = ((__global\n                                                double *) mem_231155)[gtid_224304 *\n                                                                      n_203490 +\n                                                                      i_224351];\n                    defunc_0_f_res_224350 = defunc_0_add_arg_224352;\n                }\n                \n                double x_224353 = a11_224327 * tmp4_224348;\n         ",
            "       double y_224354 = b11_224328 * defunc_1_f_res_224349;\n                double x_224355 = x_224353 + y_224354;\n                double defunc_9_fit_fun_res_224356 = defunc_0_f_res_224350 *\n                       x_224355;\n                double x_224357 = b11_224328 * tmp4_224348;\n                double y_224358 = c11_224329 * defunc_1_f_res_224349;\n                double x_224359 = x_224357 + y_224358;\n                double defunc_9_slope_fun_res_224360 = defunc_0_f_res_224350 *\n                       x_224359;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_236001)[sext_i32_i64(local_tid_235997)] =\n                        defunc_9_fit_fun_res_224356;\n                    ((__local\n                      double *) red_arr_mem_236003)[sext_i32_i64(local_tid_235997)] =\n                        defunc_9_slope_fun_res_224360;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_236001)[sext_i32_i64(local_tid_235997)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_236003)[sext_i32_i64(local_tid_235997)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_t_203494)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_224308;\n                double x_224309;\n                double x_224310;\n                double x_224311;\n                double x_236012;\n                double x_236013;\n                double x_236014;\n                double x_236015;\n                bool ltid_in_bounds_236018 =\n                     slt64(sext_i32_i64(local_tid_235997), q_t_203494 *\n                           squot64(segred_group_sizze_224299,\n                                   segment_sizze_nonzzero_235994));",
            "\n                int32_t skip_threads_236019;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_236018) {\n                        x_224310 = ((volatile __local\n                                     double *) red_arr_mem_236001)[sext_i32_i64(local_tid_235997)];\n                        x_224311 = ((volatile __local\n                                     double *) red_arr_mem_236003)[sext_i32_i64(local_tid_235997)];\n                        if ((local_tid_235997 - squot32(local_tid_235997, 32) *\n                             32) == 0) {\n                            x_224308 = x_224310;\n                            x_224309 = x_224311;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_236019 = 1;\n                    while (slt32(skip_threads_236019, 32)) {\n                        bool thread_active_236020 = sle32(skip_threads_236019,\n                                                          local_tid_235997 -\n                                                          squot32(local_tid_235997,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_236018;\n                        \n                        if (thread_active_236020) {\n                            // read operands\n                            {\n                                x_224308 = ((volatile __local\n                                             double *) red_arr_mem_236001)[sext_i32_i64(local_tid_235997) -\n                                                                           sext_i32_i64(skip_threads_236019)];\n                                x_224309 = ((volatile __local\n                                             double *) red_arr_mem_236003)[sext_i32_i64(local_tid_235997) -\n                                                                   ",
            "        sext_i32_i64(skip_threads_236019)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_236021 =\n                                 slt64(srem64(sext_i32_i64(local_tid_235997),\n                                              q_t_203494),\n                                       sext_i32_i64(local_tid_235997) -\n                                       sext_i32_i64(local_tid_235997 -\n                                       skip_threads_236019));\n                            \n                            if (thread_active_236020 && inactive_236021) {\n                                x_224308 = x_224310;\n                                x_224309 = x_224311;\n                            }\n                            if (thread_active_236020) {\n                                if (!inactive_236021) {\n                                    double defunc_1_op_res_224312 = x_224308 +\n                                           x_224310;\n                                    double defunc_1_op_res_224313 = x_224309 +\n                                           x_224311;\n                                    \n                                    x_224308 = defunc_1_op_res_224312;\n                                    x_224309 = defunc_1_op_res_224313;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_235999, skip_threads_236019)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_236020) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_236001)[sext_i32_i64(local_tid_235997)] =\n                                    x_224308;\n                                x_224310 = x_224308;\n                ",
            "                ((volatile __local\n                                  double *) red_arr_mem_236003)[sext_i32_i64(local_tid_235997)] =\n                                    x_224309;\n                                x_224311 = x_224309;\n                            }\n                        }\n                        if (sle32(wave_sizze_235999, skip_threads_236019)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_236019 *= 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_235997 - squot32(local_tid_235997, 32) *\n                         32) == 31 && ltid_in_bounds_236018) {\n                        ((volatile __local\n                          double *) red_arr_mem_236001)[sext_i32_i64(squot32(local_tid_235997,\n                                                                             32))] =\n                            x_224308;\n                        ((volatile __local\n                          double *) red_arr_mem_236003)[sext_i32_i64(squot32(local_tid_235997,\n                                                                             32))] =\n                            x_224309;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n                {\n                    int32_t skip_threads_236022;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_235997, 32) == 0 &&\n                            ltid_in_bounds_236018) {\n                            x_236014 = ((volatile __local\n                                         double *) red_arr_mem_236001)[sext_i32_i64(local_tid_235997)];\n                            x_236",
            "015 = ((volatile __local\n                                         double *) red_arr_mem_236003)[sext_i32_i64(local_tid_235997)];\n                            if ((local_tid_235997 - squot32(local_tid_235997,\n                                                            32) * 32) == 0) {\n                                x_236012 = x_236014;\n                                x_236013 = x_236015;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_236022 = 1;\n                        while (slt32(skip_threads_236022, 32)) {\n                            bool thread_active_236023 =\n                                 sle32(skip_threads_236022, local_tid_235997 -\n                                       squot32(local_tid_235997, 32) * 32) &&\n                                 (squot32(local_tid_235997, 32) == 0 &&\n                                  ltid_in_bounds_236018);\n                            \n                            if (thread_active_236023) {\n                                // read operands\n                                {\n                                    x_236012 = ((volatile __local\n                                                 double *) red_arr_mem_236001)[sext_i32_i64(local_tid_235997) -\n                                                                               sext_i32_i64(skip_threads_236022)];\n                                    x_236013 = ((volatile __local\n                                                 double *) red_arr_mem_236003)[sext_i32_i64(local_tid_235997) -\n                                                                               sext_i32_i64(skip_threads_236022)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_236024 =\n                                ",
            "     slt64(srem64(sext_i32_i64(local_tid_235997 *\n                                                  32 + 32 - 1), q_t_203494),\n                                           sext_i32_i64(local_tid_235997 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_235997 -\n                                                         skip_threads_236022) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_236023 && inactive_236024) {\n                                    x_236012 = x_236014;\n                                    x_236013 = x_236015;\n                                }\n                                if (thread_active_236023) {\n                                    if (!inactive_236024) {\n                                        double defunc_1_op_res_236016 =\n                                               x_236012 + x_236014;\n                                        double defunc_1_op_res_236017 =\n                                               x_236013 + x_236015;\n                                        \n                                        x_236012 = defunc_1_op_res_236016;\n                                        x_236013 = defunc_1_op_res_236017;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_235999, skip_threads_236022)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_236023) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_236001)[sext_i32_i64(local_tid_235997)] =\n                                        x_236012;\n                                    x_236014 = x_236012",
            ";\n                                    ((volatile __local\n                                      double *) red_arr_mem_236003)[sext_i32_i64(local_tid_235997)] =\n                                        x_236013;\n                                    x_236015 = x_236013;\n                                }\n                            }\n                            if (sle32(wave_sizze_235999, skip_threads_236022)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_236022 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_236025 = squot32(local_tid_235997, 32) == 0 ||\n                     !ltid_in_bounds_236018;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_236025) {\n                            x_224310 = x_224308;\n                            x_224311 = x_224309;\n                            x_224308 = ((__local\n                                         double *) red_arr_mem_236001)[sext_i32_i64(squot32(local_tid_235997,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_224309 = ((__local\n                                         double *) red_arr_mem_236003)[sext_i32_i64(squot32(local_tid_235997,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_236026 =\n                             slt64(srem64",
            "(sext_i32_i64(local_tid_235997),\n                                          q_t_203494),\n                                   sext_i32_i64(local_tid_235997) -\n                                   sext_i32_i64(squot32(local_tid_235997, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_236025) {\n                            if (inactive_236026) {\n                                x_224308 = x_224310;\n                                x_224309 = x_224311;\n                            }\n                        }\n                        if (!no_carry_in_236025) {\n                            if (!inactive_236026) {\n                                double defunc_1_op_res_224312 = x_224308 +\n                                       x_224310;\n                                double defunc_1_op_res_224313 = x_224309 +\n                                       x_224311;\n                                \n                                x_224308 = defunc_1_op_res_224312;\n                                x_224309 = defunc_1_op_res_224313;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_236025) {\n                            ((__local\n                              double *) red_arr_mem_236001)[sext_i32_i64(local_tid_235997)] =\n                                x_224308;\n                            ((__local\n                              double *) red_arr_mem_236003)[sext_i32_i64(local_tid_235997)] =\n                                x_224309;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_235997, 32) == 0 &&\n                        ltid_in_bounds_236018) {\n                        ((__local\n                          double *) re",
            "d_arr_mem_236001)[sext_i32_i64(local_tid_235997)] =\n                            x_224310;\n                        ((__local\n                          double *) red_arr_mem_236003)[sext_i32_i64(local_tid_235997)] =\n                            x_224311;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // save final values of segments\n        {\n            if (slt64(sext_i32_i64(virt_group_id_236007) *\n                      squot64(segred_group_sizze_224299,\n                              segment_sizze_nonzzero_235994) +\n                      sext_i32_i64(local_tid_235997), partition_sizze_203577 *\n                      t_n_m_203650) && slt64(sext_i32_i64(local_tid_235997),\n                                             squot64(segred_group_sizze_224299,\n                                                     segment_sizze_nonzzero_235994))) {\n                double tmp_236027;\n                \n                tmp_236027 = ((__local\n                               double *) red_arr_mem_236001)[(sext_i32_i64(local_tid_235997) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_235994 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_231195)[squot64(sext_i32_i64(virt_group_id_236007) *\n                                                squot64(segred_group_sizze_224299,\n                                                        segment_sizze_nonzzero_235994) +\n                                                sext_i32_i64(local_tid_235997),\n                                                t_n_m_203650) * t_n_m_203650 +\n                                        (sext_i32_i64(virt_group_id_236007) *\n                                         squot64(segred_group_sizze_224299,\n                  ",
            "                               segment_sizze_nonzzero_235994) +\n                                         sext_i32_i64(local_tid_235997) -\n                                         squot64(sext_i32_i64(virt_group_id_236007) *\n                                                 squot64(segred_group_sizze_224299,\n                                                         segment_sizze_nonzzero_235994) +\n                                                 sext_i32_i64(local_tid_235997),\n                                                 t_n_m_203650) *\n                                         t_n_m_203650)] = tmp_236027;\n                \n                double tmp_236028;\n                \n                tmp_236028 = ((__local\n                               double *) red_arr_mem_236003)[(sext_i32_i64(local_tid_235997) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_235994 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_231199)[squot64(sext_i32_i64(virt_group_id_236007) *\n                                                squot64(segred_group_sizze_224299,\n                                                        segment_sizze_nonzzero_235994) +\n                                                sext_i32_i64(local_tid_235997),\n                                                t_n_m_203650) * t_n_m_203650 +\n                                        (sext_i32_i64(virt_group_id_236007) *\n                                         squot64(segred_group_sizze_224299,\n                                                 segment_sizze_nonzzero_235994) +\n                                         sext_i32_i64(local_tid_235997) -\n                                         squot64(sext_i32_i64(virt_group_id_236007) *\n                                                 squot64(segred_group_sizze_224299,\n               ",
            "                                          segment_sizze_nonzzero_235994) +\n                                                 sext_i32_i64(local_tid_235997),\n                                                 t_n_m_203650) *\n                                         t_n_m_203650)] = tmp_236028;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_224299\n}\n__kernel void mainzisegred_small_225523(__global int *global_failure,\n                                        uint red_arr_mem_236176_backing_offset_0,\n                                        uint red_arr_mem_236174_backing_offset_1,\n                                        uint red_arr_mem_236172_backing_offset_2,\n                                        uint red_arr_mem_236170_backing_offset_3,\n                                        uint red_arr_mem_236168_backing_offset_4,\n                                        int64_t n_203490, int64_t q_t_203494,\n                                        int64_t jump_t_203500,\n                                        int64_t partition_sizze_203577,\n                                        int64_t t_n_m_203650, int64_t i_203670,\n                                        int64_t num_groups_225513,\n                                        int64_t segment_sizze_nonzzero_236161,\n                                        __global unsigned char *ext_mem_229196,\n                                        __global unsigned char *ext_mem_229197,\n                                        __global unsigned char *ext_mem_229460,\n                                        __global unsigned char *ext_mem_229461,\n                                        __global unsigned char *mem_231320,\n                                        __global unsigned char *mem_231338,\n                                        __global unsigned char *mem_231342,\n                                        __glob",
            "al unsigned char *mem_231346,\n                                        __global unsigned char *mem_231350,\n                                        __global unsigned char *mem_231354)\n{\n    #define segred_group_sizze_225512 (mainzisegred_group_sizze_224961)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_236176_backing_4 =\n                           &shared_mem[red_arr_mem_236176_backing_offset_0];\n    volatile unsigned char *red_arr_mem_236174_backing_3 =\n                           &shared_mem[red_arr_mem_236174_backing_offset_1];\n    volatile unsigned char *red_arr_mem_236172_backing_2 =\n                           &shared_mem[red_arr_mem_236172_backing_offset_2];\n    volatile unsigned char *red_arr_mem_236170_backing_1 =\n                           &shared_mem[red_arr_mem_236170_backing_offset_3];\n    volatile unsigned char *red_arr_mem_236168_backing_0 =\n                           &shared_mem[red_arr_mem_236168_backing_offset_4];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236163;\n    int32_t local_tid_236164;\n    int64_t group_sizze_236167;\n    int32_t wave_sizze_236166;\n    int32_t group_tid_236165;\n    \n    global_tid_236163 = get_global_id(0);\n    local_tid_236164 = get_local_id(0);\n    group_sizze_236167 = get_local_size(0);\n    wave_sizze_236166 = LOCKSTEP_WIDTH;\n    group_tid_236165 = get_group_id(0);\n    \n    int32_t phys_tid_225523 = global_tid_236163;\n    __local unsigned char *red_arr_mem_236168;\n    \n    red_arr_mem_236168 = (__local unsigned char *) red_arr_mem_236168_backing_0;\n    \n    __local unsigned char *red_arr_mem_236170;\n    \n    red_arr_mem_236170 = (__local unsigned char *) red_arr_mem_236170_backing_1;\n    \n    __local unsigned char *red_arr_mem_236172;\n    \n    red_arr_mem_236172 = (__local unsigned char *) red_arr_mem_236172_backing_2;\n    \n    __local unsigned char *red_arr_mem_236174;\n    \n    red_arr_mem_236174 = (__",
            "local unsigned char *) red_arr_mem_236174_backing_3;\n    \n    __local unsigned char *red_arr_mem_236176;\n    \n    red_arr_mem_236176 = (__local unsigned char *) red_arr_mem_236176_backing_4;\n    \n    int32_t phys_group_id_236178;\n    \n    phys_group_id_236178 = get_group_id(0);\n    for (int32_t i_236179 = 0; i_236179 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577 * t_n_m_203650,\n                                          squot64(segred_group_sizze_225512,\n                                                  segment_sizze_nonzzero_236161))) -\n                   phys_group_id_236178, sext_i64_i32(num_groups_225513));\n         i_236179++) {\n        int32_t virt_group_id_236180 = phys_group_id_236178 + i_236179 *\n                sext_i64_i32(num_groups_225513);\n        int64_t slice_236181 = t_n_m_203650;\n        int64_t slice_236182 = partition_sizze_203577 * slice_236181;\n        int64_t gtid_225520 = squot64(squot64(sext_i32_i64(local_tid_236164),\n                                              segment_sizze_nonzzero_236161) +\n                                      sext_i32_i64(virt_group_id_236180) *\n                                      squot64(segred_group_sizze_225512,\n                                              segment_sizze_nonzzero_236161),\n                                      slice_236181);\n        int64_t remnant_236183 = squot64(sext_i32_i64(local_tid_236164),\n                                         segment_sizze_nonzzero_236161) +\n                sext_i32_i64(virt_group_id_236180) *\n                squot64(segred_group_sizze_225512,\n                        segment_sizze_nonzzero_236161) - gtid_225520 *\n                slice_236181;\n        int64_t gtid_225521 = remnant_236183;\n        int64_t remnant_236184 = remnant_236183 - gtid_225521;\n        int64_t gtid_225522 = srem64(sext_i32_i64(local_tid_236164),\n                                     q_t_203494);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((",
            "int64_t) 0, q_t_203494) && ((slt64(gtid_225520,\n                                                          partition_sizze_203577) &&\n                                                    slt64(gtid_225521,\n                                                          t_n_m_203650)) &&\n                                                   slt64(sext_i32_i64(local_tid_236164),\n                                                         q_t_203494 *\n                                                         squot64(segred_group_sizze_225512,\n                                                                 segment_sizze_nonzzero_236161)))) {\n                int64_t x_225540;\n                \n                x_225540 = ((__global int64_t *) ext_mem_229196)[gtid_225520];\n                \n                int64_t x_225545;\n                \n                x_225545 = ((__global int64_t *) ext_mem_229461)[gtid_225520 *\n                                                                 t_n_m_203650 +\n                                                                 gtid_225521];\n                \n                double x_225546;\n                \n                x_225546 = ((__global double *) ext_mem_229460)[gtid_225520 *\n                                                                t_n_m_203650 +\n                                                                gtid_225521];\n                \n                int64_t binop_y_228684 = mul64(jump_t_203500, gtid_225521);\n                int64_t binop_y_228685 = smin64(i_203670, binop_y_228684);\n                int64_t index_primexp_228686 = add64((int64_t) 1,\n                                                     binop_y_228685);\n                bool cond_225549 = sle64(x_225540, gtid_225522);\n                int64_t defunc_0_f_res_225550;\n                \n                if (cond_225549) {\n                    defunc_0_f_res_225550 = (int64_t) 0;\n                } else {\n                    int64_t i_225551 = add64(gtid_225522, x_225545);\n           ",
            "         int64_t defunc_0_add_arg_225552;\n                    \n                    defunc_0_add_arg_225552 = ((__global\n                                                int64_t *) ext_mem_229197)[gtid_225520 *\n                                                                           n_203490 +\n                                                                           i_225551];\n                    \n                    int64_t defunc_1_add_res_225553 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_225552);\n                    \n                    defunc_0_f_res_225550 = defunc_1_add_res_225553;\n                }\n                \n                double defunc_0_f_res_225554;\n                \n                if (cond_225549) {\n                    defunc_0_f_res_225554 = 0.0;\n                } else {\n                    int64_t i_225555 = add64(gtid_225522, x_225545);\n                    double defunc_0_add_arg_225556;\n                    \n                    defunc_0_add_arg_225556 = ((__global\n                                                double *) mem_231320)[gtid_225520 *\n                                                                      n_203490 +\n                                                                      i_225555];\n                    defunc_0_f_res_225554 = defunc_0_add_arg_225556;\n                }\n                \n                int64_t binop_p_225557 = sub64(defunc_0_f_res_225550,\n                                               index_primexp_228686);\n                double defunc_0_f_res_225558 = sitofp_i64_f64(binop_p_225557);\n                double abs_res_225559 = fabs(defunc_0_f_res_225558);\n                double tmp1_225560 = abs_res_225559 / x_225546;\n                double x_225561 = tmp1_225560 * tmp1_225560;\n                double y_225562 = tmp1_225560 * x_225561;\n                double tmp2_225563 = 1.0 - y_225562;\n                double x_225564 = tmp2_225563 * tmp2_225563;\n        ",
            "        double tmp3_225565 = tmp2_225563 * x_225564;\n                double w_j_225566 = defunc_0_f_res_225554 * tmp3_225565;\n                double xw_j_225567 = defunc_0_f_res_225558 * w_j_225566;\n                double x2w_j_225568 = defunc_0_f_res_225558 * xw_j_225567;\n                double x3w_j_225569 = defunc_0_f_res_225558 * x2w_j_225568;\n                double x4w_j_225570 = defunc_0_f_res_225558 * x3w_j_225569;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_236168)[sext_i32_i64(local_tid_236164)] =\n                        w_j_225566;\n                    ((__local\n                      double *) red_arr_mem_236170)[sext_i32_i64(local_tid_236164)] =\n                        xw_j_225567;\n                    ((__local\n                      double *) red_arr_mem_236172)[sext_i32_i64(local_tid_236164)] =\n                        x2w_j_225568;\n                    ((__local\n                      double *) red_arr_mem_236174)[sext_i32_i64(local_tid_236164)] =\n                        x3w_j_225569;\n                    ((__local\n                      double *) red_arr_mem_236176)[sext_i32_i64(local_tid_236164)] =\n                        x4w_j_225570;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_236168)[sext_i32_i64(local_tid_236164)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_236170)[sext_i32_i64(local_tid_236164)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_236172)[sext_i32_i64(local_tid_236164)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_236174)[sext_i32_i64(local_tid_236164)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_236176)[sext_i32_i64(local_ti",
            "d_236164)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_t_203494)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_225524;\n                double x_225525;\n                double x_225526;\n                double x_225527;\n                double x_225528;\n                double x_225529;\n                double x_225530;\n                double x_225531;\n                double x_225532;\n                double x_225533;\n                double x_236185;\n                double x_236186;\n                double x_236187;\n                double x_236188;\n                double x_236189;\n                double x_236190;\n                double x_236191;\n                double x_236192;\n                double x_236193;\n                double x_236194;\n                bool ltid_in_bounds_236200 =\n                     slt64(sext_i32_i64(local_tid_236164), q_t_203494 *\n                           squot64(segred_group_sizze_225512,\n                                   segment_sizze_nonzzero_236161));\n                int32_t skip_threads_236201;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_236200) {\n                        x_225529 = ((volatile __local\n                                     double *) red_arr_mem_236168)[sext_i32_i64(local_tid_236164)];\n                        x_225530 = ((volatile __local\n                                     double *) red_arr_mem_236170)[sext_i32_i64(local_tid_236164)];\n                        x_225531 = ((volatile __local\n                                     double *) red_arr_mem_236172)[sext_i32_i64(local_tid_236164)];\n                        x_225532 = ((volatile __local\n                                     double *) red_arr_mem_236174)[sext_i32_i64(local_tid_236164)];\n                        x_225533 = ((volatile __local\n                           ",
            "          double *) red_arr_mem_236176)[sext_i32_i64(local_tid_236164)];\n                        if ((local_tid_236164 - squot32(local_tid_236164, 32) *\n                             32) == 0) {\n                            x_225524 = x_225529;\n                            x_225525 = x_225530;\n                            x_225526 = x_225531;\n                            x_225527 = x_225532;\n                            x_225528 = x_225533;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_236201 = 1;\n                    while (slt32(skip_threads_236201, 32)) {\n                        bool thread_active_236202 = sle32(skip_threads_236201,\n                                                          local_tid_236164 -\n                                                          squot32(local_tid_236164,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_236200;\n                        \n                        if (thread_active_236202) {\n                            // read operands\n                            {\n                                x_225524 = ((volatile __local\n                                             double *) red_arr_mem_236168)[sext_i32_i64(local_tid_236164) -\n                                                                           sext_i32_i64(skip_threads_236201)];\n                                x_225525 = ((volatile __local\n                                             double *) red_arr_mem_236170)[sext_i32_i64(local_tid_236164) -\n                                                                           sext_i32_i64(skip_threads_236201)];\n                                x_225526 = ((volatile __local\n                                             double *) red_arr_mem_236172)[sext_i32_i64(local_tid_236164) -\n                                                    ",
            "                       sext_i32_i64(skip_threads_236201)];\n                                x_225527 = ((volatile __local\n                                             double *) red_arr_mem_236174)[sext_i32_i64(local_tid_236164) -\n                                                                           sext_i32_i64(skip_threads_236201)];\n                                x_225528 = ((volatile __local\n                                             double *) red_arr_mem_236176)[sext_i32_i64(local_tid_236164) -\n                                                                           sext_i32_i64(skip_threads_236201)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_236203 =\n                                 slt64(srem64(sext_i32_i64(local_tid_236164),\n                                              q_t_203494),\n                                       sext_i32_i64(local_tid_236164) -\n                                       sext_i32_i64(local_tid_236164 -\n                                       skip_threads_236201));\n                            \n                            if (thread_active_236202 && inactive_236203) {\n                                x_225524 = x_225529;\n                                x_225525 = x_225530;\n                                x_225526 = x_225531;\n                                x_225527 = x_225532;\n                                x_225528 = x_225533;\n                            }\n                            if (thread_active_236202) {\n                                if (!inactive_236203) {\n                                    double defunc_1_op_res_225534 = x_225524 +\n                                           x_225529;\n                                    double defunc_1_op_res_225535 = x_225525 +\n                                           x_225530;\n                                    double defunc_1_op_res_225536 = x_225526 +\n     ",
            "                                      x_225531;\n                                    double defunc_1_op_res_225537 = x_225527 +\n                                           x_225532;\n                                    double defunc_1_op_res_225538 = x_225528 +\n                                           x_225533;\n                                    \n                                    x_225524 = defunc_1_op_res_225534;\n                                    x_225525 = defunc_1_op_res_225535;\n                                    x_225526 = defunc_1_op_res_225536;\n                                    x_225527 = defunc_1_op_res_225537;\n                                    x_225528 = defunc_1_op_res_225538;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_236166, skip_threads_236201)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_236202) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_236168)[sext_i32_i64(local_tid_236164)] =\n                                    x_225524;\n                                x_225529 = x_225524;\n                                ((volatile __local\n                                  double *) red_arr_mem_236170)[sext_i32_i64(local_tid_236164)] =\n                                    x_225525;\n                                x_225530 = x_225525;\n                                ((volatile __local\n                                  double *) red_arr_mem_236172)[sext_i32_i64(local_tid_236164)] =\n                                    x_225526;\n                                x_225531 = x_225526;\n                                ((volatile __local\n                                  double *) red_arr_mem_236174)[sext_i32_i64(local_tid_236164)] =\n                          ",
            "          x_225527;\n                                x_225532 = x_225527;\n                                ((volatile __local\n                                  double *) red_arr_mem_236176)[sext_i32_i64(local_tid_236164)] =\n                                    x_225528;\n                                x_225533 = x_225528;\n                            }\n                        }\n                        if (sle32(wave_sizze_236166, skip_threads_236201)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_236201 *= 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_236164 - squot32(local_tid_236164, 32) *\n                         32) == 31 && ltid_in_bounds_236200) {\n                        ((volatile __local\n                          double *) red_arr_mem_236168)[sext_i32_i64(squot32(local_tid_236164,\n                                                                             32))] =\n                            x_225524;\n                        ((volatile __local\n                          double *) red_arr_mem_236170)[sext_i32_i64(squot32(local_tid_236164,\n                                                                             32))] =\n                            x_225525;\n                        ((volatile __local\n                          double *) red_arr_mem_236172)[sext_i32_i64(squot32(local_tid_236164,\n                                                                             32))] =\n                            x_225526;\n                        ((volatile __local\n                          double *) red_arr_mem_236174)[sext_i32_i64(squot32(local_tid_236164,\n                                                                             32))] =\n                            x_225527;\n                        ((volatile __local\n      ",
            "                    double *) red_arr_mem_236176)[sext_i32_i64(squot32(local_tid_236164,\n                                                                             32))] =\n                            x_225528;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n                {\n                    int32_t skip_threads_236204;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_236164, 32) == 0 &&\n                            ltid_in_bounds_236200) {\n                            x_236190 = ((volatile __local\n                                         double *) red_arr_mem_236168)[sext_i32_i64(local_tid_236164)];\n                            x_236191 = ((volatile __local\n                                         double *) red_arr_mem_236170)[sext_i32_i64(local_tid_236164)];\n                            x_236192 = ((volatile __local\n                                         double *) red_arr_mem_236172)[sext_i32_i64(local_tid_236164)];\n                            x_236193 = ((volatile __local\n                                         double *) red_arr_mem_236174)[sext_i32_i64(local_tid_236164)];\n                            x_236194 = ((volatile __local\n                                         double *) red_arr_mem_236176)[sext_i32_i64(local_tid_236164)];\n                            if ((local_tid_236164 - squot32(local_tid_236164,\n                                                            32) * 32) == 0) {\n                                x_236185 = x_236190;\n                                x_236186 = x_236191;\n                                x_236187 = x_236192;\n                                x_236188 = x_236193;\n                                x_236189 = x_236194;\n                            }\n                        }\n                    }\n              ",
            "      // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_236204 = 1;\n                        while (slt32(skip_threads_236204, 32)) {\n                            bool thread_active_236205 =\n                                 sle32(skip_threads_236204, local_tid_236164 -\n                                       squot32(local_tid_236164, 32) * 32) &&\n                                 (squot32(local_tid_236164, 32) == 0 &&\n                                  ltid_in_bounds_236200);\n                            \n                            if (thread_active_236205) {\n                                // read operands\n                                {\n                                    x_236185 = ((volatile __local\n                                                 double *) red_arr_mem_236168)[sext_i32_i64(local_tid_236164) -\n                                                                               sext_i32_i64(skip_threads_236204)];\n                                    x_236186 = ((volatile __local\n                                                 double *) red_arr_mem_236170)[sext_i32_i64(local_tid_236164) -\n                                                                               sext_i32_i64(skip_threads_236204)];\n                                    x_236187 = ((volatile __local\n                                                 double *) red_arr_mem_236172)[sext_i32_i64(local_tid_236164) -\n                                                                               sext_i32_i64(skip_threads_236204)];\n                                    x_236188 = ((volatile __local\n                                                 double *) red_arr_mem_236174)[sext_i32_i64(local_tid_236164) -\n                                                                               sext_i32_i64(skip_threads_236204)];\n                                    x_236189 = ((volatile __local\n                                                 double *) re",
            "d_arr_mem_236176)[sext_i32_i64(local_tid_236164) -\n                                                                               sext_i32_i64(skip_threads_236204)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_236206 =\n                                     slt64(srem64(sext_i32_i64(local_tid_236164 *\n                                                  32 + 32 - 1), q_t_203494),\n                                           sext_i32_i64(local_tid_236164 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_236164 -\n                                                         skip_threads_236204) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_236205 && inactive_236206) {\n                                    x_236185 = x_236190;\n                                    x_236186 = x_236191;\n                                    x_236187 = x_236192;\n                                    x_236188 = x_236193;\n                                    x_236189 = x_236194;\n                                }\n                                if (thread_active_236205) {\n                                    if (!inactive_236206) {\n                                        double defunc_1_op_res_236195 =\n                                               x_236185 + x_236190;\n                                        double defunc_1_op_res_236196 =\n                                               x_236186 + x_236191;\n                                        double defunc_1_op_res_236197 =\n                                               x_236187 + x_236192;\n                                        double defunc_1_op_res_236198 =\n                                               x_236188 + x_236193;\n                   ",
            "                     double defunc_1_op_res_236199 =\n                                               x_236189 + x_236194;\n                                        \n                                        x_236185 = defunc_1_op_res_236195;\n                                        x_236186 = defunc_1_op_res_236196;\n                                        x_236187 = defunc_1_op_res_236197;\n                                        x_236188 = defunc_1_op_res_236198;\n                                        x_236189 = defunc_1_op_res_236199;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_236166, skip_threads_236204)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_236205) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_236168)[sext_i32_i64(local_tid_236164)] =\n                                        x_236185;\n                                    x_236190 = x_236185;\n                                    ((volatile __local\n                                      double *) red_arr_mem_236170)[sext_i32_i64(local_tid_236164)] =\n                                        x_236186;\n                                    x_236191 = x_236186;\n                                    ((volatile __local\n                                      double *) red_arr_mem_236172)[sext_i32_i64(local_tid_236164)] =\n                                        x_236187;\n                                    x_236192 = x_236187;\n                                    ((volatile __local\n                                      double *) red_arr_mem_236174)[sext_i32_i64(local_tid_236164)] =\n                                        x_236188;\n                                    x_236193 = x_23",
            "6188;\n                                    ((volatile __local\n                                      double *) red_arr_mem_236176)[sext_i32_i64(local_tid_236164)] =\n                                        x_236189;\n                                    x_236194 = x_236189;\n                                }\n                            }\n                            if (sle32(wave_sizze_236166, skip_threads_236204)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_236204 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_236207 = squot32(local_tid_236164, 32) == 0 ||\n                     !ltid_in_bounds_236200;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_236207) {\n                            x_225529 = x_225524;\n                            x_225530 = x_225525;\n                            x_225531 = x_225526;\n                            x_225532 = x_225527;\n                            x_225533 = x_225528;\n                            x_225524 = ((__local\n                                         double *) red_arr_mem_236168)[sext_i32_i64(squot32(local_tid_236164,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_225525 = ((__local\n                                         double *) red_arr_mem_236170)[sext_i32_i64(squot32(local_tid_236164,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_225526 = ((__local",
            "\n                                         double *) red_arr_mem_236172)[sext_i32_i64(squot32(local_tid_236164,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_225527 = ((__local\n                                         double *) red_arr_mem_236174)[sext_i32_i64(squot32(local_tid_236164,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_225528 = ((__local\n                                         double *) red_arr_mem_236176)[sext_i32_i64(squot32(local_tid_236164,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_236208 =\n                             slt64(srem64(sext_i32_i64(local_tid_236164),\n                                          q_t_203494),\n                                   sext_i32_i64(local_tid_236164) -\n                                   sext_i32_i64(squot32(local_tid_236164, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_236207) {\n                            if (inactive_236208) {\n                                x_225524 = x_225529;\n                                x_225525 = x_225530;\n                                x_225526 = x_225531;\n                                x_225527 = x_225532;\n                                x_225528 = x_225533;\n                            }\n                        }\n                        if (!no_carry_in_236207) {\n                            if (!inactiv",
            "e_236208) {\n                                double defunc_1_op_res_225534 = x_225524 +\n                                       x_225529;\n                                double defunc_1_op_res_225535 = x_225525 +\n                                       x_225530;\n                                double defunc_1_op_res_225536 = x_225526 +\n                                       x_225531;\n                                double defunc_1_op_res_225537 = x_225527 +\n                                       x_225532;\n                                double defunc_1_op_res_225538 = x_225528 +\n                                       x_225533;\n                                \n                                x_225524 = defunc_1_op_res_225534;\n                                x_225525 = defunc_1_op_res_225535;\n                                x_225526 = defunc_1_op_res_225536;\n                                x_225527 = defunc_1_op_res_225537;\n                                x_225528 = defunc_1_op_res_225538;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_236207) {\n                            ((__local\n                              double *) red_arr_mem_236168)[sext_i32_i64(local_tid_236164)] =\n                                x_225524;\n                            ((__local\n                              double *) red_arr_mem_236170)[sext_i32_i64(local_tid_236164)] =\n                                x_225525;\n                            ((__local\n                              double *) red_arr_mem_236172)[sext_i32_i64(local_tid_236164)] =\n                                x_225526;\n                            ((__local\n                              double *) red_arr_mem_236174)[sext_i32_i64(local_tid_236164)] =\n                                x_225527;\n                            ((__local\n                              double *) red_arr_mem_236176)[sext_i32_i64(",
            "local_tid_236164)] =\n                                x_225528;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_236164, 32) == 0 &&\n                        ltid_in_bounds_236200) {\n                        ((__local\n                          double *) red_arr_mem_236168)[sext_i32_i64(local_tid_236164)] =\n                            x_225529;\n                        ((__local\n                          double *) red_arr_mem_236170)[sext_i32_i64(local_tid_236164)] =\n                            x_225530;\n                        ((__local\n                          double *) red_arr_mem_236172)[sext_i32_i64(local_tid_236164)] =\n                            x_225531;\n                        ((__local\n                          double *) red_arr_mem_236174)[sext_i32_i64(local_tid_236164)] =\n                            x_225532;\n                        ((__local\n                          double *) red_arr_mem_236176)[sext_i32_i64(local_tid_236164)] =\n                            x_225533;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // save final values of segments\n        {\n            if (slt64(sext_i32_i64(virt_group_id_236180) *\n                      squot64(segred_group_sizze_225512,\n                              segment_sizze_nonzzero_236161) +\n                      sext_i32_i64(local_tid_236164), partition_sizze_203577 *\n                      t_n_m_203650) && slt64(sext_i32_i64(local_tid_236164),\n                                             squot64(segred_group_sizze_225512,\n                                                     segment_sizze_nonzzero_236161))) {\n                double tmp_236209;\n                \n                tmp_236209 = ((__local\n                               doub",
            "le *) red_arr_mem_236168)[(sext_i32_i64(local_tid_236164) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_236161 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_231338)[squot64(sext_i32_i64(virt_group_id_236180) *\n                                                squot64(segred_group_sizze_225512,\n                                                        segment_sizze_nonzzero_236161) +\n                                                sext_i32_i64(local_tid_236164),\n                                                t_n_m_203650) * t_n_m_203650 +\n                                        (sext_i32_i64(virt_group_id_236180) *\n                                         squot64(segred_group_sizze_225512,\n                                                 segment_sizze_nonzzero_236161) +\n                                         sext_i32_i64(local_tid_236164) -\n                                         squot64(sext_i32_i64(virt_group_id_236180) *\n                                                 squot64(segred_group_sizze_225512,\n                                                         segment_sizze_nonzzero_236161) +\n                                                 sext_i32_i64(local_tid_236164),\n                                                 t_n_m_203650) *\n                                         t_n_m_203650)] = tmp_236209;\n                \n                double tmp_236210;\n                \n                tmp_236210 = ((__local\n                               double *) red_arr_mem_236170)[(sext_i32_i64(local_tid_236164) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_236161 -\n                                                             (int64_t) 1];\n                ((",
            "__global\n                  double *) mem_231342)[squot64(sext_i32_i64(virt_group_id_236180) *\n                                                squot64(segred_group_sizze_225512,\n                                                        segment_sizze_nonzzero_236161) +\n                                                sext_i32_i64(local_tid_236164),\n                                                t_n_m_203650) * t_n_m_203650 +\n                                        (sext_i32_i64(virt_group_id_236180) *\n                                         squot64(segred_group_sizze_225512,\n                                                 segment_sizze_nonzzero_236161) +\n                                         sext_i32_i64(local_tid_236164) -\n                                         squot64(sext_i32_i64(virt_group_id_236180) *\n                                                 squot64(segred_group_sizze_225512,\n                                                         segment_sizze_nonzzero_236161) +\n                                                 sext_i32_i64(local_tid_236164),\n                                                 t_n_m_203650) *\n                                         t_n_m_203650)] = tmp_236210;\n                \n                double tmp_236211;\n                \n                tmp_236211 = ((__local\n                               double *) red_arr_mem_236172)[(sext_i32_i64(local_tid_236164) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_236161 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_231346)[squot64(sext_i32_i64(virt_group_id_236180) *\n                                                squot64(segred_group_sizze_225512,\n                                                        segment_sizze_nonzzero_236161) +\n                                                sext_i32_",
            "i64(local_tid_236164),\n                                                t_n_m_203650) * t_n_m_203650 +\n                                        (sext_i32_i64(virt_group_id_236180) *\n                                         squot64(segred_group_sizze_225512,\n                                                 segment_sizze_nonzzero_236161) +\n                                         sext_i32_i64(local_tid_236164) -\n                                         squot64(sext_i32_i64(virt_group_id_236180) *\n                                                 squot64(segred_group_sizze_225512,\n                                                         segment_sizze_nonzzero_236161) +\n                                                 sext_i32_i64(local_tid_236164),\n                                                 t_n_m_203650) *\n                                         t_n_m_203650)] = tmp_236211;\n                \n                double tmp_236212;\n                \n                tmp_236212 = ((__local\n                               double *) red_arr_mem_236174)[(sext_i32_i64(local_tid_236164) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_236161 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_231350)[squot64(sext_i32_i64(virt_group_id_236180) *\n                                                squot64(segred_group_sizze_225512,\n                                                        segment_sizze_nonzzero_236161) +\n                                                sext_i32_i64(local_tid_236164),\n                                                t_n_m_203650) * t_n_m_203650 +\n                                        (sext_i32_i64(virt_group_id_236180) *\n                                         squot64(segred_group_sizze_225512,\n                                                 segment_sizze_nonz",
            "zero_236161) +\n                                         sext_i32_i64(local_tid_236164) -\n                                         squot64(sext_i32_i64(virt_group_id_236180) *\n                                                 squot64(segred_group_sizze_225512,\n                                                         segment_sizze_nonzzero_236161) +\n                                                 sext_i32_i64(local_tid_236164),\n                                                 t_n_m_203650) *\n                                         t_n_m_203650)] = tmp_236212;\n                \n                double tmp_236213;\n                \n                tmp_236213 = ((__local\n                               double *) red_arr_mem_236176)[(sext_i32_i64(local_tid_236164) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_236161 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_231354)[squot64(sext_i32_i64(virt_group_id_236180) *\n                                                squot64(segred_group_sizze_225512,\n                                                        segment_sizze_nonzzero_236161) +\n                                                sext_i32_i64(local_tid_236164),\n                                                t_n_m_203650) * t_n_m_203650 +\n                                        (sext_i32_i64(virt_group_id_236180) *\n                                         squot64(segred_group_sizze_225512,\n                                                 segment_sizze_nonzzero_236161) +\n                                         sext_i32_i64(local_tid_236164) -\n                                         squot64(sext_i32_i64(virt_group_id_236180) *\n                                                 squot64(segred_group_sizze_225512,\n                                                         segment",
            "_sizze_nonzzero_236161) +\n                                                 sext_i32_i64(local_tid_236164),\n                                                 t_n_m_203650) *\n                                         t_n_m_203650)] = tmp_236213;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_225512\n}\n__kernel void mainzisegred_small_225624(__global int *global_failure,\n                                        uint red_arr_mem_236308_backing_offset_0,\n                                        uint red_arr_mem_236306_backing_offset_1,\n                                        int64_t n_203490, int64_t q_t_203494,\n                                        int64_t jump_t_203500,\n                                        int64_t partition_sizze_203577,\n                                        int64_t t_n_m_203650, int64_t i_203670,\n                                        int64_t num_groups_225617,\n                                        int64_t segment_sizze_nonzzero_236299,\n                                        __global unsigned char *ext_mem_229196,\n                                        __global unsigned char *ext_mem_229197,\n                                        __global unsigned char *ext_mem_229460,\n                                        __global unsigned char *ext_mem_229461,\n                                        __global unsigned char *mem_231320,\n                                        __global unsigned char *mem_231324,\n                                        __global unsigned char *mem_231359,\n                                        __global unsigned char *mem_231363,\n                                        __global unsigned char *mem_231367,\n                                        __global unsigned char *mem_231371,\n                                        __global unsigned char *mem_231375,\n                                     ",
            "   __global unsigned char *mem_231380,\n                                        __global unsigned char *mem_231384)\n{\n    #define segred_group_sizze_225616 (mainzisegred_group_sizze_224832)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_236308_backing_1 =\n                           &shared_mem[red_arr_mem_236308_backing_offset_0];\n    volatile unsigned char *red_arr_mem_236306_backing_0 =\n                           &shared_mem[red_arr_mem_236306_backing_offset_1];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236301;\n    int32_t local_tid_236302;\n    int64_t group_sizze_236305;\n    int32_t wave_sizze_236304;\n    int32_t group_tid_236303;\n    \n    global_tid_236301 = get_global_id(0);\n    local_tid_236302 = get_local_id(0);\n    group_sizze_236305 = get_local_size(0);\n    wave_sizze_236304 = LOCKSTEP_WIDTH;\n    group_tid_236303 = get_group_id(0);\n    \n    int32_t phys_tid_225624 = global_tid_236301;\n    __local unsigned char *red_arr_mem_236306;\n    \n    red_arr_mem_236306 = (__local unsigned char *) red_arr_mem_236306_backing_0;\n    \n    __local unsigned char *red_arr_mem_236308;\n    \n    red_arr_mem_236308 = (__local unsigned char *) red_arr_mem_236308_backing_1;\n    \n    int32_t phys_group_id_236310;\n    \n    phys_group_id_236310 = get_group_id(0);\n    for (int32_t i_236311 = 0; i_236311 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577 * t_n_m_203650,\n                                          squot64(segred_group_sizze_225616,\n                                                  segment_sizze_nonzzero_236299))) -\n                   phys_group_id_236310, sext_i64_i32(num_groups_225617));\n         i_236311++) {\n        int32_t virt_group_id_236312 = phys_group_id_236310 + i_236311 *\n                sext_i64_i32(num_groups_225617);\n        int64_t slice_236313 = t_n_m_203650;\n        int64_t slice_236314 = partition_sizze_203577 * slic",
            "e_236313;\n        int64_t gtid_225621 = squot64(squot64(sext_i32_i64(local_tid_236302),\n                                              segment_sizze_nonzzero_236299) +\n                                      sext_i32_i64(virt_group_id_236312) *\n                                      squot64(segred_group_sizze_225616,\n                                              segment_sizze_nonzzero_236299),\n                                      slice_236313);\n        int64_t remnant_236315 = squot64(sext_i32_i64(local_tid_236302),\n                                         segment_sizze_nonzzero_236299) +\n                sext_i32_i64(virt_group_id_236312) *\n                squot64(segred_group_sizze_225616,\n                        segment_sizze_nonzzero_236299) - gtid_225621 *\n                slice_236313;\n        int64_t gtid_225622 = remnant_236315;\n        int64_t remnant_236316 = remnant_236315 - gtid_225622;\n        int64_t gtid_225623 = srem64(sext_i32_i64(local_tid_236302),\n                                     q_t_203494);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_t_203494) && ((slt64(gtid_225621,\n                                                          partition_sizze_203577) &&\n                                                    slt64(gtid_225622,\n                                                          t_n_m_203650)) &&\n                                                   slt64(sext_i32_i64(local_tid_236302),\n                                                         q_t_203494 *\n                                                         squot64(segred_group_sizze_225616,\n                                                                 segment_sizze_nonzzero_236299)))) {\n                int64_t x_225632;\n                \n                x_225632 = ((__global int64_t *) ext_mem_229196)[gtid_225621];\n                \n                int64_t x_225643;\n                \n                x_225643 = ((__global int64_t *) ext_mem_22",
            "9461)[gtid_225621 *\n                                                                 t_n_m_203650 +\n                                                                 gtid_225622];\n                \n                double x_225644;\n                \n                x_225644 = ((__global double *) ext_mem_229460)[gtid_225621 *\n                                                                t_n_m_203650 +\n                                                                gtid_225622];\n                \n                int64_t binop_y_228679 = mul64(jump_t_203500, gtid_225622);\n                int64_t binop_y_228680 = smin64(i_203670, binop_y_228679);\n                int64_t index_primexp_228681 = add64((int64_t) 1,\n                                                     binop_y_228680);\n                double a12_225646;\n                \n                a12_225646 = ((__global double *) mem_231359)[gtid_225621 *\n                                                              t_n_m_203650 +\n                                                              gtid_225622];\n                \n                double b12_225647;\n                \n                b12_225647 = ((__global double *) mem_231363)[gtid_225621 *\n                                                              t_n_m_203650 +\n                                                              gtid_225622];\n                \n                double c12_225648;\n                \n                c12_225648 = ((__global double *) mem_231367)[gtid_225621 *\n                                                              t_n_m_203650 +\n                                                              gtid_225622];\n                \n                double b2_225649;\n                \n                b2_225649 = ((__global double *) mem_231371)[gtid_225621 *\n                                                             t_n_m_203650 +\n                                                             gtid_225622];\n                \n                double c2_2",
            "25650;\n                \n                c2_225650 = ((__global double *) mem_231375)[gtid_225621 *\n                                                             t_n_m_203650 +\n                                                             gtid_225622];\n                \n                bool cond_225652 = sle64(x_225632, gtid_225623);\n                int64_t defunc_0_f_res_225653;\n                \n                if (cond_225652) {\n                    defunc_0_f_res_225653 = (int64_t) 0;\n                } else {\n                    int64_t i_225654 = add64(gtid_225623, x_225643);\n                    int64_t defunc_0_add_arg_225655;\n                    \n                    defunc_0_add_arg_225655 = ((__global\n                                                int64_t *) ext_mem_229197)[gtid_225621 *\n                                                                           n_203490 +\n                                                                           i_225654];\n                    \n                    int64_t defunc_1_add_res_225656 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_225655);\n                    \n                    defunc_0_f_res_225653 = defunc_1_add_res_225656;\n                }\n                \n                double defunc_0_f_res_225657;\n                \n                if (cond_225652) {\n                    defunc_0_f_res_225657 = 0.0;\n                } else {\n                    int64_t i_225658 = add64(gtid_225623, x_225643);\n                    double defunc_0_add_arg_225659;\n                    \n                    defunc_0_add_arg_225659 = ((__global\n                                                double *) mem_231320)[gtid_225621 *\n                                                                      n_203490 +\n                                                                      i_225658];\n                    defunc_0_f_res_225657 = defunc_0_add_arg_225659;\n                }\n                \n",
            "                int64_t binop_p_225660 = sub64(defunc_0_f_res_225653,\n                                               index_primexp_228681);\n                double defunc_0_f_res_225661 = sitofp_i64_f64(binop_p_225660);\n                double abs_res_225662 = fabs(defunc_0_f_res_225661);\n                double tmp1_225663 = abs_res_225662 / x_225644;\n                double x_225664 = tmp1_225663 * tmp1_225663;\n                double y_225665 = tmp1_225663 * x_225664;\n                double tmp2_225666 = 1.0 - y_225665;\n                double x_225667 = tmp2_225666 * tmp2_225666;\n                double tmp3_225668 = tmp2_225666 * x_225667;\n                double tmp4_225669 = defunc_0_f_res_225657 * tmp3_225668;\n                double defunc_1_f_res_225670 = defunc_0_f_res_225661 *\n                       tmp4_225669;\n                double defunc_1_f_res_225671 = defunc_0_f_res_225661 *\n                       defunc_1_f_res_225670;\n                double defunc_0_f_res_225672;\n                \n                if (cond_225652) {\n                    defunc_0_f_res_225672 = 0.0;\n                } else {\n                    int64_t i_225673 = add64(gtid_225623, x_225643);\n                    double defunc_0_add_arg_225674;\n                    \n                    defunc_0_add_arg_225674 = ((__global\n                                                double *) mem_231324)[gtid_225621 *\n                                                                      n_203490 +\n                                                                      i_225673];\n                    defunc_0_f_res_225672 = defunc_0_add_arg_225674;\n                }\n                \n                double x_225675 = a12_225646 * tmp4_225669;\n                double y_225676 = b12_225647 * defunc_1_f_res_225670;\n                double x_225677 = x_225675 + y_225676;\n                double y_225678 = c12_225648 * defunc_1_f_res_225671;\n                double x_225679 = x_225677 + y_225678;\n                double de",
            "func_9_fit_fun_res_225680 = defunc_0_f_res_225672 *\n                       x_225679;\n                double x_225681 = b12_225647 * tmp4_225669;\n                double y_225682 = b2_225649 * defunc_1_f_res_225670;\n                double x_225683 = x_225681 + y_225682;\n                double y_225684 = c2_225650 * defunc_1_f_res_225671;\n                double x_225685 = x_225683 + y_225684;\n                double defunc_9_slope_fun_res_225686 = defunc_0_f_res_225672 *\n                       x_225685;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_236306)[sext_i32_i64(local_tid_236302)] =\n                        defunc_9_fit_fun_res_225680;\n                    ((__local\n                      double *) red_arr_mem_236308)[sext_i32_i64(local_tid_236302)] =\n                        defunc_9_slope_fun_res_225686;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_236306)[sext_i32_i64(local_tid_236302)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_236308)[sext_i32_i64(local_tid_236302)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_t_203494)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_225625;\n                double x_225626;\n                double x_225627;\n                double x_225628;\n                double x_236317;\n                double x_236318;\n                double x_236319;\n                double x_236320;\n                bool ltid_in_bounds_236323 =\n                     slt64(sext_i32_i64(local_tid_236302), q_t_203494 *\n                           squot64(segred_group_sizze_225616,\n                                   segment_sizze_nonzzero_236299));\n                i",
            "nt32_t skip_threads_236324;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_236323) {\n                        x_225627 = ((volatile __local\n                                     double *) red_arr_mem_236306)[sext_i32_i64(local_tid_236302)];\n                        x_225628 = ((volatile __local\n                                     double *) red_arr_mem_236308)[sext_i32_i64(local_tid_236302)];\n                        if ((local_tid_236302 - squot32(local_tid_236302, 32) *\n                             32) == 0) {\n                            x_225625 = x_225627;\n                            x_225626 = x_225628;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_236324 = 1;\n                    while (slt32(skip_threads_236324, 32)) {\n                        bool thread_active_236325 = sle32(skip_threads_236324,\n                                                          local_tid_236302 -\n                                                          squot32(local_tid_236302,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_236323;\n                        \n                        if (thread_active_236325) {\n                            // read operands\n                            {\n                                x_225625 = ((volatile __local\n                                             double *) red_arr_mem_236306)[sext_i32_i64(local_tid_236302) -\n                                                                           sext_i32_i64(skip_threads_236324)];\n                                x_225626 = ((volatile __local\n                                             double *) red_arr_mem_236308)[sext_i32_i64(local_tid_236302) -\n                                                                           sext_i32_i",
            "64(skip_threads_236324)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_236326 =\n                                 slt64(srem64(sext_i32_i64(local_tid_236302),\n                                              q_t_203494),\n                                       sext_i32_i64(local_tid_236302) -\n                                       sext_i32_i64(local_tid_236302 -\n                                       skip_threads_236324));\n                            \n                            if (thread_active_236325 && inactive_236326) {\n                                x_225625 = x_225627;\n                                x_225626 = x_225628;\n                            }\n                            if (thread_active_236325) {\n                                if (!inactive_236326) {\n                                    double defunc_1_op_res_225629 = x_225625 +\n                                           x_225627;\n                                    double defunc_1_op_res_225630 = x_225626 +\n                                           x_225628;\n                                    \n                                    x_225625 = defunc_1_op_res_225629;\n                                    x_225626 = defunc_1_op_res_225630;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_236304, skip_threads_236324)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_236325) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_236306)[sext_i32_i64(local_tid_236302)] =\n                                    x_225625;\n                                x_225627 = x_225625;\n                                ((",
            "volatile __local\n                                  double *) red_arr_mem_236308)[sext_i32_i64(local_tid_236302)] =\n                                    x_225626;\n                                x_225628 = x_225626;\n                            }\n                        }\n                        if (sle32(wave_sizze_236304, skip_threads_236324)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_236324 *= 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_236302 - squot32(local_tid_236302, 32) *\n                         32) == 31 && ltid_in_bounds_236323) {\n                        ((volatile __local\n                          double *) red_arr_mem_236306)[sext_i32_i64(squot32(local_tid_236302,\n                                                                             32))] =\n                            x_225625;\n                        ((volatile __local\n                          double *) red_arr_mem_236308)[sext_i32_i64(squot32(local_tid_236302,\n                                                                             32))] =\n                            x_225626;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n                {\n                    int32_t skip_threads_236327;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_236302, 32) == 0 &&\n                            ltid_in_bounds_236323) {\n                            x_236319 = ((volatile __local\n                                         double *) red_arr_mem_236306)[sext_i32_i64(local_tid_236302)];\n                            x_236320 = ((volatile _",
            "_local\n                                         double *) red_arr_mem_236308)[sext_i32_i64(local_tid_236302)];\n                            if ((local_tid_236302 - squot32(local_tid_236302,\n                                                            32) * 32) == 0) {\n                                x_236317 = x_236319;\n                                x_236318 = x_236320;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_236327 = 1;\n                        while (slt32(skip_threads_236327, 32)) {\n                            bool thread_active_236328 =\n                                 sle32(skip_threads_236327, local_tid_236302 -\n                                       squot32(local_tid_236302, 32) * 32) &&\n                                 (squot32(local_tid_236302, 32) == 0 &&\n                                  ltid_in_bounds_236323);\n                            \n                            if (thread_active_236328) {\n                                // read operands\n                                {\n                                    x_236317 = ((volatile __local\n                                                 double *) red_arr_mem_236306)[sext_i32_i64(local_tid_236302) -\n                                                                               sext_i32_i64(skip_threads_236327)];\n                                    x_236318 = ((volatile __local\n                                                 double *) red_arr_mem_236308)[sext_i32_i64(local_tid_236302) -\n                                                                               sext_i32_i64(skip_threads_236327)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_236329 =\n                                     slt64(srem64(",
            "sext_i32_i64(local_tid_236302 *\n                                                  32 + 32 - 1), q_t_203494),\n                                           sext_i32_i64(local_tid_236302 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_236302 -\n                                                         skip_threads_236327) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_236328 && inactive_236329) {\n                                    x_236317 = x_236319;\n                                    x_236318 = x_236320;\n                                }\n                                if (thread_active_236328) {\n                                    if (!inactive_236329) {\n                                        double defunc_1_op_res_236321 =\n                                               x_236317 + x_236319;\n                                        double defunc_1_op_res_236322 =\n                                               x_236318 + x_236320;\n                                        \n                                        x_236317 = defunc_1_op_res_236321;\n                                        x_236318 = defunc_1_op_res_236322;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_236304, skip_threads_236327)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_236328) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_236306)[sext_i32_i64(local_tid_236302)] =\n                                        x_236317;\n                                    x_236319 = x_236317;\n                ",
            "                    ((volatile __local\n                                      double *) red_arr_mem_236308)[sext_i32_i64(local_tid_236302)] =\n                                        x_236318;\n                                    x_236320 = x_236318;\n                                }\n                            }\n                            if (sle32(wave_sizze_236304, skip_threads_236327)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_236327 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_236330 = squot32(local_tid_236302, 32) == 0 ||\n                     !ltid_in_bounds_236323;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_236330) {\n                            x_225627 = x_225625;\n                            x_225628 = x_225626;\n                            x_225625 = ((__local\n                                         double *) red_arr_mem_236306)[sext_i32_i64(squot32(local_tid_236302,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_225626 = ((__local\n                                         double *) red_arr_mem_236308)[sext_i32_i64(squot32(local_tid_236302,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_236331 =\n                             slt64(srem64(sext_i32_i64(loca",
            "l_tid_236302),\n                                          q_t_203494),\n                                   sext_i32_i64(local_tid_236302) -\n                                   sext_i32_i64(squot32(local_tid_236302, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_236330) {\n                            if (inactive_236331) {\n                                x_225625 = x_225627;\n                                x_225626 = x_225628;\n                            }\n                        }\n                        if (!no_carry_in_236330) {\n                            if (!inactive_236331) {\n                                double defunc_1_op_res_225629 = x_225625 +\n                                       x_225627;\n                                double defunc_1_op_res_225630 = x_225626 +\n                                       x_225628;\n                                \n                                x_225625 = defunc_1_op_res_225629;\n                                x_225626 = defunc_1_op_res_225630;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_236330) {\n                            ((__local\n                              double *) red_arr_mem_236306)[sext_i32_i64(local_tid_236302)] =\n                                x_225625;\n                            ((__local\n                              double *) red_arr_mem_236308)[sext_i32_i64(local_tid_236302)] =\n                                x_225626;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_236302, 32) == 0 &&\n                        ltid_in_bounds_236323) {\n                        ((__local\n                          double *) red_arr_mem_236306)[",
            "sext_i32_i64(local_tid_236302)] =\n                            x_225627;\n                        ((__local\n                          double *) red_arr_mem_236308)[sext_i32_i64(local_tid_236302)] =\n                            x_225628;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // save final values of segments\n        {\n            if (slt64(sext_i32_i64(virt_group_id_236312) *\n                      squot64(segred_group_sizze_225616,\n                              segment_sizze_nonzzero_236299) +\n                      sext_i32_i64(local_tid_236302), partition_sizze_203577 *\n                      t_n_m_203650) && slt64(sext_i32_i64(local_tid_236302),\n                                             squot64(segred_group_sizze_225616,\n                                                     segment_sizze_nonzzero_236299))) {\n                double tmp_236332;\n                \n                tmp_236332 = ((__local\n                               double *) red_arr_mem_236306)[(sext_i32_i64(local_tid_236302) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_236299 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_231380)[squot64(sext_i32_i64(virt_group_id_236312) *\n                                                squot64(segred_group_sizze_225616,\n                                                        segment_sizze_nonzzero_236299) +\n                                                sext_i32_i64(local_tid_236302),\n                                                t_n_m_203650) * t_n_m_203650 +\n                                        (sext_i32_i64(virt_group_id_236312) *\n                                         squot64(segred_group_sizze_225616,\n                                    ",
            "             segment_sizze_nonzzero_236299) +\n                                         sext_i32_i64(local_tid_236302) -\n                                         squot64(sext_i32_i64(virt_group_id_236312) *\n                                                 squot64(segred_group_sizze_225616,\n                                                         segment_sizze_nonzzero_236299) +\n                                                 sext_i32_i64(local_tid_236302),\n                                                 t_n_m_203650) *\n                                         t_n_m_203650)] = tmp_236332;\n                \n                double tmp_236333;\n                \n                tmp_236333 = ((__local\n                               double *) red_arr_mem_236308)[(sext_i32_i64(local_tid_236302) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_236299 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_231384)[squot64(sext_i32_i64(virt_group_id_236312) *\n                                                squot64(segred_group_sizze_225616,\n                                                        segment_sizze_nonzzero_236299) +\n                                                sext_i32_i64(local_tid_236302),\n                                                t_n_m_203650) * t_n_m_203650 +\n                                        (sext_i32_i64(virt_group_id_236312) *\n                                         squot64(segred_group_sizze_225616,\n                                                 segment_sizze_nonzzero_236299) +\n                                         sext_i32_i64(local_tid_236302) -\n                                         squot64(sext_i32_i64(virt_group_id_236312) *\n                                                 squot64(segred_group_sizze_225616,\n                                 ",
            "                        segment_sizze_nonzzero_236299) +\n                                                 sext_i32_i64(local_tid_236302),\n                                                 t_n_m_203650) *\n                                         t_n_m_203650)] = tmp_236333;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_225616\n}\n__kernel void mainzisegred_small_228090(__global int *global_failure,\n                                        uint red_arr_mem_236973_backing_offset_0,\n                                        int64_t n_203490,\n                                        int64_t partition_sizze_203577,\n                                        int64_t stl_res_203664,\n                                        int64_t j_m_i_204133,\n                                        int64_t num_groups_228085,\n                                        int64_t segment_sizze_nonzzero_236966,\n                                        __global unsigned char *ext_mem_231816,\n                                        __global unsigned char *mem_231833)\n{\n    #define segred_group_sizze_228084 (mainzisegred_group_sizze_228067)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_236973_backing_0 =\n                           &shared_mem[red_arr_mem_236973_backing_offset_0];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236968;\n    int32_t local_tid_236969;\n    int64_t group_sizze_236972;\n    int32_t wave_sizze_236971;\n    int32_t group_tid_236970;\n    \n    global_tid_236968 = get_global_id(0);\n    local_tid_236969 = get_local_id(0);\n    group_sizze_236972 = get_local_size(0);\n    wave_sizze_236971 = LOCKSTEP_WIDTH;\n    group_tid_236970 = get_group_id(0);\n    \n    int32_t phys_tid_228090 = global_tid_236968;\n    __local unsigned char *red_arr_mem_23",
            "6973;\n    \n    red_arr_mem_236973 = (__local unsigned char *) red_arr_mem_236973_backing_0;\n    \n    int32_t phys_group_id_236975;\n    \n    phys_group_id_236975 = get_group_id(0);\n    for (int32_t i_236976 = 0; i_236976 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577,\n                                          squot64(segred_group_sizze_228084,\n                                                  segment_sizze_nonzzero_236966))) -\n                   phys_group_id_236975, sext_i64_i32(num_groups_228085));\n         i_236976++) {\n        int32_t virt_group_id_236977 = phys_group_id_236975 + i_236976 *\n                sext_i64_i32(num_groups_228085);\n        int64_t slice_236978 = partition_sizze_203577;\n        int64_t gtid_228088 = squot64(sext_i32_i64(local_tid_236969),\n                                      segment_sizze_nonzzero_236966) +\n                sext_i32_i64(virt_group_id_236977) *\n                squot64(segred_group_sizze_228084,\n                        segment_sizze_nonzzero_236966);\n        int64_t remnant_236979 = squot64(sext_i32_i64(local_tid_236969),\n                                         segment_sizze_nonzzero_236966) +\n                sext_i32_i64(virt_group_id_236977) *\n                squot64(segred_group_sizze_228084,\n                        segment_sizze_nonzzero_236966) - gtid_228088;\n        int64_t gtid_228089 = srem64(sext_i32_i64(local_tid_236969),\n                                     j_m_i_204133);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, j_m_i_204133) && (slt64(gtid_228088,\n                                                           partition_sizze_203577) &&\n                                                     slt64(sext_i32_i64(local_tid_236969),\n                                                           j_m_i_204133 *\n                                                           squot64(segred_group_sizze_228084,\n                                                     ",
            "              segment_sizze_nonzzero_236966)))) {\n                int64_t slice_228219 = stl_res_203664 + gtid_228089;\n                double x_228095;\n                \n                x_228095 = ((__global double *) ext_mem_231816)[gtid_228088 *\n                                                                n_203490 +\n                                                                slice_228219];\n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_236973)[sext_i32_i64(local_tid_236969)] =\n                        x_228095;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_236973)[sext_i32_i64(local_tid_236969)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, j_m_i_204133)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_228091;\n                double x_228092;\n                double x_236980;\n                double x_236981;\n                bool ltid_in_bounds_236983 =\n                     slt64(sext_i32_i64(local_tid_236969), j_m_i_204133 *\n                           squot64(segred_group_sizze_228084,\n                                   segment_sizze_nonzzero_236966));\n                int32_t skip_threads_236984;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_236983) {\n                        x_228092 = ((volatile __local\n                                     double *) red_arr_mem_236973)[sext_i32_i64(local_tid_236969)];\n                        if ((local_tid_236969 - squot32(local_tid_236969, 32) *\n                             32) == 0) {\n                            x_228091 = x_228092;\n                        }\n                    }\n                }\n                // in-",
            "block scan (hopefully no barriers needed)\n                {\n                    skip_threads_236984 = 1;\n                    while (slt32(skip_threads_236984, 32)) {\n                        bool thread_active_236985 = sle32(skip_threads_236984,\n                                                          local_tid_236969 -\n                                                          squot32(local_tid_236969,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_236983;\n                        \n                        if (thread_active_236985) {\n                            // read operands\n                            {\n                                x_228091 = ((volatile __local\n                                             double *) red_arr_mem_236973)[sext_i32_i64(local_tid_236969) -\n                                                                           sext_i32_i64(skip_threads_236984)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_236986 =\n                                 slt64(srem64(sext_i32_i64(local_tid_236969),\n                                              j_m_i_204133),\n                                       sext_i32_i64(local_tid_236969) -\n                                       sext_i32_i64(local_tid_236969 -\n                                       skip_threads_236984));\n                            \n                            if (thread_active_236985 && inactive_236986) {\n                                x_228091 = x_228092;\n                            }\n                            if (thread_active_236985) {\n                                if (!inactive_236986) {\n                                    double defunc_1_op_res_228093 = x_228091 +\n                                           x_228092;\n                                    \n                                    x_22",
            "8091 = defunc_1_op_res_228093;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_236971, skip_threads_236984)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_236985) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_236973)[sext_i32_i64(local_tid_236969)] =\n                                    x_228091;\n                                x_228092 = x_228091;\n                            }\n                        }\n                        if (sle32(wave_sizze_236971, skip_threads_236984)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_236984 *= 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_236969 - squot32(local_tid_236969, 32) *\n                         32) == 31 && ltid_in_bounds_236983) {\n                        ((volatile __local\n                          double *) red_arr_mem_236973)[sext_i32_i64(squot32(local_tid_236969,\n                                                                             32))] =\n                            x_228091;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n                {\n                    int32_t skip_threads_236987;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_236969, 32) == 0 &&\n                            ltid_in_bounds_236983) {\n                            x_23",
            "6981 = ((volatile __local\n                                         double *) red_arr_mem_236973)[sext_i32_i64(local_tid_236969)];\n                            if ((local_tid_236969 - squot32(local_tid_236969,\n                                                            32) * 32) == 0) {\n                                x_236980 = x_236981;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_236987 = 1;\n                        while (slt32(skip_threads_236987, 32)) {\n                            bool thread_active_236988 =\n                                 sle32(skip_threads_236987, local_tid_236969 -\n                                       squot32(local_tid_236969, 32) * 32) &&\n                                 (squot32(local_tid_236969, 32) == 0 &&\n                                  ltid_in_bounds_236983);\n                            \n                            if (thread_active_236988) {\n                                // read operands\n                                {\n                                    x_236980 = ((volatile __local\n                                                 double *) red_arr_mem_236973)[sext_i32_i64(local_tid_236969) -\n                                                                               sext_i32_i64(skip_threads_236987)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_236989 =\n                                     slt64(srem64(sext_i32_i64(local_tid_236969 *\n                                                  32 + 32 - 1), j_m_i_204133),\n                                           sext_i32_i64(local_tid_236969 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_236969 -\n       ",
            "                                                  skip_threads_236987) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_236988 && inactive_236989) {\n                                    x_236980 = x_236981;\n                                }\n                                if (thread_active_236988) {\n                                    if (!inactive_236989) {\n                                        double defunc_1_op_res_236982 =\n                                               x_236980 + x_236981;\n                                        \n                                        x_236980 = defunc_1_op_res_236982;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_236971, skip_threads_236987)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_236988) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_236973)[sext_i32_i64(local_tid_236969)] =\n                                        x_236980;\n                                    x_236981 = x_236980;\n                                }\n                            }\n                            if (sle32(wave_sizze_236971, skip_threads_236987)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_236987 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_236990 = squot32(local_tid_236969, 32) == 0 ||\n                     !ltid_in_bounds_236983;\n                \n                // carry-in for every block except ",
            "the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_236990) {\n                            x_228092 = x_228091;\n                            x_228091 = ((__local\n                                         double *) red_arr_mem_236973)[sext_i32_i64(squot32(local_tid_236969,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_236991 =\n                             slt64(srem64(sext_i32_i64(local_tid_236969),\n                                          j_m_i_204133),\n                                   sext_i32_i64(local_tid_236969) -\n                                   sext_i32_i64(squot32(local_tid_236969, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_236990) {\n                            if (inactive_236991) {\n                                x_228091 = x_228092;\n                            }\n                        }\n                        if (!no_carry_in_236990) {\n                            if (!inactive_236991) {\n                                double defunc_1_op_res_228093 = x_228091 +\n                                       x_228092;\n                                \n                                x_228091 = defunc_1_op_res_228093;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_236990) {\n                            ((__local\n                              double *) red_arr_mem_236973)[sext_i32_i64(local_tid_236969)] =\n                                x_228091;\n                        }\n                    }\n          ",
            "      }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_236969, 32) == 0 &&\n                        ltid_in_bounds_236983) {\n                        ((__local\n                          double *) red_arr_mem_236973)[sext_i32_i64(local_tid_236969)] =\n                            x_228092;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // save final values of segments\n        {\n            if (slt64(sext_i32_i64(virt_group_id_236977) *\n                      squot64(segred_group_sizze_228084,\n                              segment_sizze_nonzzero_236966) +\n                      sext_i32_i64(local_tid_236969), partition_sizze_203577) &&\n                slt64(sext_i32_i64(local_tid_236969),\n                      squot64(segred_group_sizze_228084,\n                              segment_sizze_nonzzero_236966))) {\n                double tmp_236992;\n                \n                tmp_236992 = ((__local\n                               double *) red_arr_mem_236973)[(sext_i32_i64(local_tid_236969) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_236966 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_231833)[sext_i32_i64(virt_group_id_236977) *\n                                        squot64(segred_group_sizze_228084,\n                                                segment_sizze_nonzzero_236966) +\n                                        sext_i32_i64(local_tid_236969)] =\n                    tmp_236992;\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_228084\n}\n__kernel void mainzisegscan_206867(__global int *global_failure,\n                                   int failure_is_an_option, __global\n                                   int64_t *global_failure_args,\n                                   uint local_mem_232282_backing_offset_0,\n                                   int64_t m_203489, int64_t n_203490,\n                                   int64_t n_p_203492,\n                                   int64_t defunc_0_f_res_203510, __global\n                                   unsigned char *mem_229148, __global\n                                   unsigned char *mem_229152, __global\n                                   unsigned char *mem_229155, __global\n                                   unsigned char *mem_229157, __global\n                                   unsigned char *mainziid_counter_mem_232253,\n                                   __global\n                                   unsigned char *status_flags_mem_232255,\n                                   __global\n                                   unsigned char *aggregates_mem_232257,\n                                   __global\n                                   unsigned char *incprefixes_mem_232259)\n{\n    #define segscan_group_sizze_206862 (mainzisegscan_group_sizze_206861)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *local_mem_232282_backing_0 =\n                           &shared_mem[local_mem_232282_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_232273;\n    int32_t local_tid_232274;\n    int64_t group_sizze_232277;\n    int32_t wave_sizze_232276;\n    int32_t group_tid_232275;\n    \n    global_tid_232273 = get_global_id(0);\n    local_tid_232274 = get_loc",
            "al_id(0);\n    group_sizze_232277 = get_local_size(0);\n    wave_sizze_232276 = LOCKSTEP_WIDTH;\n    group_tid_232275 = get_group_id(0);\n    \n    int32_t phys_tid_206867 = global_tid_232273;\n    int64_t byte_offsets_232278 = (int64_t) 0;\n    int64_t byte_offsets_232279 = segscan_group_sizze_206862 * (int64_t) 8;\n    int64_t warp_byte_offset_232280 = (int64_t) 32;\n    int64_t warp_byte_offset_232281 = (int64_t) 288;\n    \n    // Allocate reused shared memeory\n    { }\n    \n    __local unsigned char *local_mem_232282;\n    \n    local_mem_232282 = (__local unsigned char *) local_mem_232282_backing_0;\n    \n    int64_t trans_arr_len_232283 = (int64_t) 11 * segscan_group_sizze_206862;\n    int32_t dynamic_id_232289;\n    \n    if (local_tid_232274 == 0) {\n        dynamic_id_232289 = atomic_add_i32_global(&((volatile __global\n                                                     int *) mainziid_counter_mem_232253)[(int64_t) 0],\n                                                  (int) 1);\n        ((__local int32_t *) local_mem_232282)[(int64_t) 0] = dynamic_id_232289;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    dynamic_id_232289 = ((__local int32_t *) local_mem_232282)[(int64_t) 0];\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t blockOff_232290 = sext_i32_i64(dynamic_id_232289) * (int64_t) 11 *\n            segscan_group_sizze_206862;\n    int64_t sgm_idx_232291 = smod64(blockOff_232290, m_203489);\n    int32_t boundary_232292 = sext_i64_i32(smin64((int64_t) 11 *\n                                                  segscan_group_sizze_206862,\n                                                  m_203489 - sgm_idx_232291));\n    int32_t segsizze_compact_232293 = sext_i64_i32(smin64((int64_t) 11 *\n                                                          segscan_group_sizze_206862,\n                                                          m_203489));\n    int64_t private_mem_232294[(int64_t) 11];\n    \n    // Load and map\n    {\n        for (int64_t i_232296 = 0; i_232296 < (int64_t) 11; i_23229",
            "6++) {\n            int64_t phys_tid_232297 = blockOff_232290 +\n                    sext_i32_i64(local_tid_232274) + i_232296 *\n                    segscan_group_sizze_206862;\n            int64_t slice_232298 = m_203489;\n            int64_t gtid_206866 = phys_tid_232297;\n            int64_t remnant_232299 = phys_tid_232297 - gtid_206866;\n            \n            if (slt64(phys_tid_232297, m_203489)) {\n                bool defunc_2_reduce_res_203548;\n                bool redout_228648 = 0;\n                \n                for (int64_t i_228649 = 0; i_228649 < n_p_203492; i_228649++) {\n                    bool defunc_2_reduce_res_203553;\n                    bool redout_228650 = 1;\n                    \n                    for (int64_t i_228651 = 0; i_228651 < defunc_0_f_res_203510;\n                         i_228651++) {\n                        int64_t x_203558 = mul64(n_p_203492, i_228651);\n                        int64_t idx_203559 = add64(x_203558, i_228649);\n                        bool cond_203560 = slt64(idx_203559, n_203490);\n                        bool defunc_0_f_res_203561;\n                        \n                        if (cond_203560) {\n                            bool x_203562 = sle64((int64_t) 0, idx_203559);\n                            bool bounds_check_203563 = cond_203560 && x_203562;\n                            bool index_certs_203564;\n                            \n                            if (!bounds_check_203563) {\n                                {\n                                    if (atomic_cmpxchg_i32_global(global_failure,\n                                                                  -1, 0) ==\n                                        -1) {\n                                        global_failure_args[0] =\n                                            (int64_t) idx_203559;\n                                        global_failure_args[1] =\n                                            (int64_t) n_203490;\n                                        ;\n  ",
            "                                  }\n                                    local_failure = true;\n                                    goto error_0;\n                                }\n                            }\n                            \n                            double isnan_arg_203565;\n                            \n                            isnan_arg_203565 = ((__global\n                                                 double *) mem_229148)[idx_203559 *\n                                                                       m_203489 +\n                                                                       gtid_206866];\n                            \n                            bool isnan_res_203566;\n                            \n                            isnan_res_203566 = futrts_isnan64(isnan_arg_203565);\n                            defunc_0_f_res_203561 = isnan_res_203566;\n                        } else {\n                            defunc_0_f_res_203561 = 0;\n                        }\n                        \n                        bool x_203556 = defunc_0_f_res_203561 && redout_228650;\n                        bool redout_tmp_232301 = x_203556;\n                        \n                        redout_228650 = redout_tmp_232301;\n                    }\n                    defunc_2_reduce_res_203553 = redout_228650;\n                    \n                    bool defunc_1_op_res_203551 = defunc_2_reduce_res_203553 ||\n                         redout_228648;\n                    bool redout_tmp_232300 = defunc_1_op_res_203551;\n                    \n                    redout_228648 = redout_tmp_232300;\n                }\n                defunc_2_reduce_res_203548 = redout_228648;\n                \n                int64_t defunc_2_lifted_lambda_res_203567 =\n                        btoi_bool_i64(defunc_2_reduce_res_203548);\n                bool is_i_203568 = defunc_2_lifted_lambda_res_203567 ==\n                     (int64_t) 0;\n                bool cond_neg_203569 = !is_i_20356",
            "8;\n                int64_t part_res_203570 = btoi_bool_i64(cond_neg_203569);\n                int64_t part_res_203571 = btoi_bool_i64(is_i_203568);\n                \n                ((__global int64_t *) mem_229155)[gtid_206866] =\n                    part_res_203570;\n                ((__global bool *) mem_229157)[gtid_206866] =\n                    defunc_2_reduce_res_203548;\n                private_mem_232294[i_232296] = part_res_203571;\n            } else {\n                private_mem_232294[i_232296] = (int64_t) 0;\n            }\n        }\n    }\n    // Transpose scan inputs\n    {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_232302 = 0; i_232302 < (int64_t) 11; i_232302++) {\n            int64_t sharedIdx_232303 = sext_i32_i64(local_tid_232274) +\n                    i_232302 * segscan_group_sizze_206862;\n            int64_t tmp_232304;\n            \n            tmp_232304 = private_mem_232294[i_232302];\n            ((__local int64_t *) local_mem_232282)[sharedIdx_232303] =\n                tmp_232304;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int32_t i_232305 = 0; i_232305 < 11; i_232305++) {\n            int32_t sharedIdx_232306 = local_tid_232274 * 11 + i_232305;\n            int64_t tmp_232307;\n            \n            tmp_232307 = ((__local\n                           int64_t *) local_mem_232282)[sext_i32_i64(sharedIdx_232306)];\n            private_mem_232294[sext_i32_i64(i_232305)] = tmp_232307;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    // Per thread scan\n    {\n        int32_t gidx_232308 = local_tid_232274 * 11 + 1;\n        \n        for (int64_t i_232309 = 0; i_232309 < (int64_t) 10; i_232309++) {\n            int64_t x_203544;\n            int64_t y_203545;\n            \n            x_203544 = private_mem_232294[i_232309];\n            y_203545 = private_mem_232294[i_232309 + (int64_t) 1];\n            \n            int64_t zz_203546 = x_203544 + y_203545;\n            \n            private_mem_232294[i_232309 + (int64_t) 1]",
            " = zz_203546;\n        }\n    }\n    // Publish results in shared memory\n    {\n        int64_t tmp_232310;\n        \n        tmp_232310 = private_mem_232294[(int64_t) 10];\n        ((__local int64_t *) local_mem_232282)[squot64(byte_offsets_232278,\n                                                       (int64_t) 8) +\n                                               sext_i32_i64(local_tid_232274)] =\n            tmp_232310;\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    \n    int64_t acc_232314;\n    \n    // Scan results (with warp scan)\n    {\n        int64_t x_232311;\n        int64_t y_232312;\n        int64_t x_232315;\n        int64_t y_232316;\n        bool ltid_in_bounds_232318 = slt64(sext_i32_i64(local_tid_232274),\n                                           segscan_group_sizze_206862);\n        int32_t skip_threads_232319;\n        \n        // read input for in-block scan\n        {\n            if (ltid_in_bounds_232318) {\n                y_232312 = ((volatile __local\n                             int64_t *) local_mem_232282)[squot64(byte_offsets_232278,\n                                                                  (int64_t) 8) +\n                                                          sext_i32_i64(local_tid_232274)];\n                if ((local_tid_232274 - squot32(local_tid_232274, 32) * 32) ==\n                    0) {\n                    x_232311 = y_232312;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_232319 = 1;\n            while (slt32(skip_threads_232319, 32)) {\n                bool thread_active_232320 = sle32(skip_threads_232319,\n                                                  local_tid_232274 -\n                                                  squot32(local_tid_232274,\n                                                          32) * 32) &&\n                     ltid_in_bounds_232318;\n                \n                if (thread_active_232320) {\n                    // read oper",
            "ands\n                    {\n                        x_232311 = ((volatile __local\n                                     int64_t *) local_mem_232282)[squot64(byte_offsets_232278,\n                                                                          (int64_t) 8) +\n                                                                  (sext_i32_i64(local_tid_232274) -\n                                                                   sext_i32_i64(skip_threads_232319))];\n                    }\n                }\n                // perform operation\n                {\n                    if (thread_active_232320) {\n                        int64_t zz_232313 = x_232311 + y_232312;\n                        \n                        x_232311 = zz_232313;\n                    }\n                }\n                if (sle32(wave_sizze_232276, skip_threads_232319)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_232320) {\n                    // write result\n                    {\n                        ((volatile __local\n                          int64_t *) local_mem_232282)[squot64(byte_offsets_232278,\n                                                               (int64_t) 8) +\n                                                       sext_i32_i64(local_tid_232274)] =\n                            x_232311;\n                        y_232312 = x_232311;\n                    }\n                }\n                if (sle32(wave_sizze_232276, skip_threads_232319)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_232319 *= 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_232274 - squot32(local_tid_232274, 32) * 32) == 31 &&\n                ltid_in_bounds_232318) {\n                ((volatile __local\n                  int64_t *) local_mem_232282)[squot64(byte_offsets_232278,\n    ",
            "                                                   (int64_t) 8) +\n                                               sext_i32_i64(squot32(local_tid_232274,\n                                                                    32))] =\n                    x_232311;\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_232321;\n            \n            // read input for in-block scan\n            {\n                if (squot32(local_tid_232274, 32) == 0 &&\n                    ltid_in_bounds_232318) {\n                    y_232316 = ((volatile __local\n                                 int64_t *) local_mem_232282)[squot64(byte_offsets_232278,\n                                                                      (int64_t) 8) +\n                                                              sext_i32_i64(local_tid_232274)];\n                    if ((local_tid_232274 - squot32(local_tid_232274, 32) *\n                         32) == 0) {\n                        x_232315 = y_232316;\n                    }\n                }\n            }\n            // in-block scan (hopefully no barriers needed)\n            {\n                skip_threads_232321 = 1;\n                while (slt32(skip_threads_232321, 32)) {\n                    bool thread_active_232322 = sle32(skip_threads_232321,\n                                                      local_tid_232274 -\n                                                      squot32(local_tid_232274,\n                                                              32) * 32) &&\n                         (squot32(local_tid_232274, 32) == 0 &&\n                          ltid_in_bounds_232318);\n                    \n                    if (thread_active_232322) {\n                        // read operands\n                        {\n                            x_232315 = ((volatile __local\n                                         int64_t ",
            "*) local_mem_232282)[squot64(byte_offsets_232278,\n                                                                              (int64_t) 8) +\n                                                                      (sext_i32_i64(local_tid_232274) -\n                                                                       sext_i32_i64(skip_threads_232321))];\n                        }\n                    }\n                    // perform operation\n                    {\n                        if (thread_active_232322) {\n                            int64_t zz_232317 = x_232315 + y_232316;\n                            \n                            x_232315 = zz_232317;\n                        }\n                    }\n                    if (sle32(wave_sizze_232276, skip_threads_232321)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    if (thread_active_232322) {\n                        // write result\n                        {\n                            ((volatile __local\n                              int64_t *) local_mem_232282)[squot64(byte_offsets_232278,\n                                                                   (int64_t) 8) +\n                                                           sext_i32_i64(local_tid_232274)] =\n                                x_232315;\n                            y_232316 = x_232315;\n                        }\n                    }\n                    if (sle32(wave_sizze_232276, skip_threads_232321)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    skip_threads_232321 *= 2;\n                }\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        bool no_carry_in_232323 = squot32(local_tid_232274, 32) == 0 ||\n             !ltid_in_bounds_232318;\n        \n        // carry-in for every block except the first\n        {\n            // read operands\n            {\n                if (!no_carry_in_232323) {\n                    y_2",
            "32312 = x_232311;\n                    x_232311 = ((__local\n                                 int64_t *) local_mem_232282)[squot64(byte_offsets_232278,\n                                                                      (int64_t) 8) +\n                                                              (sext_i32_i64(squot32(local_tid_232274,\n                                                                                    32)) -\n                                                               (int64_t) 1)];\n                }\n            }\n            // perform operation\n            {\n                if (!no_carry_in_232323) {\n                    int64_t zz_232313 = x_232311 + y_232312;\n                    \n                    x_232311 = zz_232313;\n                }\n            }\n            // write final result\n            {\n                if (!no_carry_in_232323) {\n                    ((__local\n                      int64_t *) local_mem_232282)[squot64(byte_offsets_232278,\n                                                           (int64_t) 8) +\n                                                   sext_i32_i64(local_tid_232274)] =\n                        x_232311;\n                }\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // restore correct values for first block\n        {\n            if (squot32(local_tid_232274, 32) == 0 && ltid_in_bounds_232318) {\n                ((__local\n                  int64_t *) local_mem_232282)[squot64(byte_offsets_232278,\n                                                       (int64_t) 8) +\n                                               sext_i32_i64(local_tid_232274)] =\n                    y_232312;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (local_tid_232274 == 0) {\n            acc_232314 = ((__local\n                           int64_t *) local_mem_232282)[squot64(byte_offsets_232278,\n                                                               ",
            " (int64_t) 8) +\n                                                        (segscan_group_sizze_206862 -\n                                                         (int64_t) 1)];\n        } else {\n            acc_232314 = ((__local\n                           int64_t *) local_mem_232282)[squot64(byte_offsets_232278,\n                                                                (int64_t) 8) +\n                                                        (sext_i32_i64(local_tid_232274) -\n                                                         (int64_t) 1)];\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    \n    int64_t prefix_232324 = (int64_t) 0;\n    bool block_new_sgm_232325 = sgm_idx_232291 == (int64_t) 0;\n    \n    // Perform lookback\n    {\n        if (block_new_sgm_232325 && local_tid_232274 == 0) {\n            ((volatile __global\n              int64_t *) incprefixes_mem_232259)[dynamic_id_232289] =\n                acc_232314;\n            mem_fence_global();\n            ((volatile __global\n              int8_t *) status_flags_mem_232255)[dynamic_id_232289] =\n                (int8_t) 2;\n            acc_232314 = (int64_t) 0;\n        }\n        if (!block_new_sgm_232325 && slt32(local_tid_232274,\n                                           wave_sizze_232276)) {\n            if (local_tid_232274 == 0) {\n                ((volatile __global\n                  int64_t *) aggregates_mem_232257)[dynamic_id_232289] =\n                    acc_232314;\n                mem_fence_global();\n                ((volatile __global\n                  int8_t *) status_flags_mem_232255)[dynamic_id_232289] =\n                    (int8_t) 1;\n                \n                int8_t tmp_232326;\n                \n                tmp_232326 = ((volatile __global\n                               int8_t *) status_flags_mem_232255)[dynamic_id_232289 -\n                                                                  (int64_t) 1];\n                ((volatile __local int8_t *) local_mem_232282)[(int64_t) 0] =\n ",
            "                   tmp_232326;\n            }\n            mem_fence_local();\n            \n            int8_t status_232327;\n            \n            status_232327 = ((__local int8_t *) local_mem_232282)[(int64_t) 0];\n            if (status_232327 == (int8_t) 2) {\n                if (local_tid_232274 == 0) {\n                    prefix_232324 = ((volatile __global\n                                      int64_t *) incprefixes_mem_232259)[dynamic_id_232289 -\n                                                                         (int64_t) 1];\n                }\n            } else {\n                int32_t readOffset_232328 = dynamic_id_232289 -\n                        sext_i32_i64(wave_sizze_232276);\n                \n                while (slt32(wave_sizze_232276 * -1, readOffset_232328)) {\n                    int32_t read_i_232329 = readOffset_232328 +\n                            local_tid_232274;\n                    int64_t aggr_232330 = (int64_t) 0;\n                    int8_t flag_232331 = (int8_t) 0;\n                    \n                    if (sle32(0, read_i_232329)) {\n                        flag_232331 = ((volatile __global\n                                        int8_t *) status_flags_mem_232255)[sext_i32_i64(read_i_232329)];\n                        if (flag_232331 == (int8_t) 2) {\n                            aggr_232330 = ((volatile __global\n                                            int64_t *) incprefixes_mem_232259)[sext_i32_i64(read_i_232329)];\n                        } else {\n                            if (flag_232331 == (int8_t) 1) {\n                                aggr_232330 = ((volatile __global\n                                                int64_t *) aggregates_mem_232257)[sext_i32_i64(read_i_232329)];\n                            }\n                        }\n                    }\n                    ((__local\n                      int64_t *) local_mem_232282)[squot64(warp_byte_offset_232280,\n                                                           ",
            "(int64_t) 8) +\n                                                   sext_i32_i64(local_tid_232274)] =\n                        aggr_232330;\n                    ((__local\n                      int8_t *) local_mem_232282)[sext_i32_i64(local_tid_232274)] =\n                        flag_232331;\n                    flag_232331 = ((__local\n                                    int8_t *) local_mem_232282)[sext_i32_i64(wave_sizze_232276) -\n                                                                (int64_t) 1];\n                    if (slt8(flag_232331, (int8_t) 2)) {\n                        int8_t flg_x_232335;\n                        int8_t flg_y_232336;\n                        int64_t x_232332;\n                        int64_t y_232333;\n                        int32_t skip_threads_232337;\n                        \n                        // read input for in-block scan\n                        {\n                            flg_y_232336 = ((volatile __local\n                                             int8_t *) local_mem_232282)[sext_i32_i64(local_tid_232274)];\n                            y_232333 = ((volatile __local\n                                         int64_t *) local_mem_232282)[squot64(warp_byte_offset_232280,\n                                                                              (int64_t) 8) +\n                                                                      sext_i32_i64(local_tid_232274)];\n                            if ((local_tid_232274 - squot32(local_tid_232274,\n                                                            32) * 32) == 0) {\n                                x_232332 = y_232333;\n                                flg_x_232335 = flg_y_232336;\n                            }\n                        }\n                        // in-block scan (hopefully no barriers needed)\n                        {\n                            skip_threads_232337 = 1;\n                            while (slt32(skip_threads_232337, 32)) {\n                              ",
            "  if (sle32(skip_threads_232337,\n                                          local_tid_232274 -\n                                          squot32(local_tid_232274, 32) * 32)) {\n                                    // read operands\n                                    {\n                                        flg_x_232335 = ((volatile __local\n                                                         int8_t *) local_mem_232282)[sext_i32_i64(local_tid_232274) -\n                                                                                     sext_i32_i64(skip_threads_232337)];\n                                        x_232332 = ((volatile __local\n                                                     int64_t *) local_mem_232282)[squot64(warp_byte_offset_232280,\n                                                                                          (int64_t) 8) +\n                                                                                  (sext_i32_i64(local_tid_232274) -\n                                                                                   sext_i32_i64(skip_threads_232337))];\n                                    }\n                                    // perform operation\n                                    {\n                                        if (flg_y_232336 == (int8_t) 2 ||\n                                            flg_y_232336 == (int8_t) 0) {\n                                            flg_x_232335 = flg_y_232336;\n                                            x_232332 = y_232333;\n                                        } else {\n                                            int64_t zz_232334 = x_232332 +\n                                                    y_232333;\n                                            \n                                            x_232332 = zz_232334;\n                                        }\n                                    }\n                                    // write result\n                                    {\n         ",
            "                               ((volatile __local\n                                          int8_t *) local_mem_232282)[sext_i32_i64(local_tid_232274)] =\n                                            flg_x_232335;\n                                        flg_y_232336 = flg_x_232335;\n                                        ((volatile __local\n                                          int64_t *) local_mem_232282)[squot64(warp_byte_offset_232280,\n                                                                               (int64_t) 8) +\n                                                                       sext_i32_i64(local_tid_232274)] =\n                                            x_232332;\n                                        y_232333 = x_232332;\n                                    }\n                                }\n                                skip_threads_232337 *= 2;\n                            }\n                        }\n                    }\n                    flag_232331 = ((__local\n                                    int8_t *) local_mem_232282)[sext_i32_i64(wave_sizze_232276) -\n                                                                (int64_t) 1];\n                    aggr_232330 = ((__local\n                                    int64_t *) local_mem_232282)[squot64(warp_byte_offset_232280,\n                                                                         (int64_t) 8) +\n                                                                 (sext_i32_i64(wave_sizze_232276) -\n                                                                  (int64_t) 1)];\n                    if (flag_232331 == (int8_t) 2) {\n                        readOffset_232328 = wave_sizze_232276 * -1;\n                    } else {\n                        if (flag_232331 == (int8_t) 1) {\n                            readOffset_232328 -= wave_sizze_232276;\n                        }\n                    }\n                    if (slt8((int8_t) 0, flag_232331)) {\n                       ",
            " int64_t x_232338 = aggr_232330;\n                        int64_t y_232339 = prefix_232324;\n                        int64_t zz_232340 = x_232338 + y_232339;\n                        \n                        prefix_232324 = zz_232340;\n                    }\n                    mem_fence_local();\n                }\n            }\n            if (local_tid_232274 == 0) {\n                if (boundary_232292 == sext_i64_i32(segscan_group_sizze_206862 *\n                    (int64_t) 11)) {\n                    int64_t x_232341 = prefix_232324;\n                    int64_t y_232342 = acc_232314;\n                    int64_t zz_232343 = x_232341 + y_232342;\n                    \n                    ((volatile __global\n                      int64_t *) incprefixes_mem_232259)[dynamic_id_232289] =\n                        zz_232343;\n                    mem_fence_global();\n                    ((volatile __global\n                      int8_t *) status_flags_mem_232255)[dynamic_id_232289] =\n                        (int8_t) 2;\n                }\n                ((__local\n                  int64_t *) local_mem_232282)[squot64(warp_byte_offset_232280,\n                                                       (int64_t) 8)] =\n                    prefix_232324;\n                acc_232314 = (int64_t) 0;\n            }\n        }\n        if (!(dynamic_id_232289 == (int64_t) 0)) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            prefix_232324 = ((__local\n                              int64_t *) local_mem_232282)[squot64(warp_byte_offset_232280,\n                                                                   (int64_t) 8)];\n            barrier(CLK_LOCAL_MEM_FENCE);\n        }\n    }\n    // Distribute results\n    {\n        int64_t x_232344;\n        int64_t y_232345;\n        int64_t x_232347 = prefix_232324;\n        int64_t y_232348 = acc_232314;\n        \n        if (slt32(local_tid_232274 * 11, boundary_232292) &&\n            !block_new_sgm_232325) {\n            int64_t zz_232349 = x_232347 + y_232348",
            ";\n            \n            x_232344 = zz_232349;\n        } else {\n            x_232344 = acc_232314;\n        }\n        \n        int32_t stopping_point_232350 = segsizze_compact_232293 -\n                srem32(local_tid_232274 * 11 - 1 + segsizze_compact_232293 -\n                       boundary_232292, segsizze_compact_232293);\n        \n        for (int64_t i_232351 = 0; i_232351 < (int64_t) 11; i_232351++) {\n            if (slt32(sext_i64_i32(i_232351), stopping_point_232350 - 1)) {\n                y_232345 = private_mem_232294[i_232351];\n                \n                int64_t zz_232346 = x_232344 + y_232345;\n                \n                private_mem_232294[i_232351] = zz_232346;\n            }\n        }\n    }\n    // Transpose scan output and Write it to global memory in coalesced fashion\n    {\n        for (int64_t i_232352 = 0; i_232352 < (int64_t) 11; i_232352++) {\n            int64_t sharedIdx_232353 = sext_i32_i64(local_tid_232274 * 11) +\n                    i_232352;\n            int64_t tmp_232354;\n            \n            tmp_232354 = private_mem_232294[i_232352];\n            ((__local int64_t *) local_mem_232282)[sharedIdx_232353] =\n                tmp_232354;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_232355 = 0; i_232355 < (int64_t) 11; i_232355++) {\n            int64_t flat_idx_232356 = blockOff_232290 +\n                    segscan_group_sizze_206862 * i_232355 +\n                    sext_i32_i64(local_tid_232274);\n            int64_t slice_232357 = m_203489;\n            int64_t gtid_206866 = flat_idx_232356;\n            int64_t remnant_232358 = flat_idx_232356 - gtid_206866;\n            \n            if (slt64(flat_idx_232356, m_203489)) {\n                int64_t tmp_232359;\n                \n                tmp_232359 = ((__local\n                               int64_t *) local_mem_232282)[flat_idx_232356 -\n                                                            blockOff_232290];\n                ((__global int64_t *) mem_2",
            "29152)[gtid_206866] = tmp_232359;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    // If this is the last block, reset the dynamicId\n    {\n        if (dynamic_id_232289 == sdiv_up64(m_203489,\n                                           segscan_group_sizze_206862 *\n                                           (int64_t) 11) - (int64_t) 1) {\n            ((__global int32_t *) mainziid_counter_mem_232253)[(int64_t) 0] = 0;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_206862\n}\n__kernel void mainzisegscan_207007(__global int *global_failure,\n                                   uint local_mem_232419_backing_offset_0,\n                                   int64_t n_203490,\n                                   int64_t partition_sizze_203577, __global\n                                   unsigned char *mem_229161, __global\n                                   unsigned char *mem_229186, __global\n                                   unsigned char *mainziid_counter_mem_232402,\n                                   __global\n                                   unsigned char *status_flags_mem_232404,\n                                   __global\n                                   unsigned char *aggregates_mem_232406,\n                                   __global\n                                   unsigned char *incprefixes_mem_232408)\n{\n    #define segscan_group_sizze_207001 (mainzisegscan_group_sizze_206981)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *local_mem_232419_backing_0 =\n                           &shared_mem[local_mem_232419_backing_offset_0];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_232410;\n    int32_t local_tid_232411;\n    int64_t group_sizze_232414;\n    int32_t wave_sizze_232413;\n    int32_t group_tid_232412;\n    \n    global_tid_232410 = get_global_id(0);\n    local_tid_232411 = get_local_id(0);\n    group_sizze_232414 = get_l",
            "ocal_size(0);\n    wave_sizze_232413 = LOCKSTEP_WIDTH;\n    group_tid_232412 = get_group_id(0);\n    \n    int32_t phys_tid_207007 = global_tid_232410;\n    int64_t byte_offsets_232415 = (int64_t) 0;\n    int64_t byte_offsets_232416 = segscan_group_sizze_207001 * (int64_t) 8;\n    int64_t warp_byte_offset_232417 = (int64_t) 32;\n    int64_t warp_byte_offset_232418 = (int64_t) 288;\n    \n    // Allocate reused shared memeory\n    { }\n    \n    __local unsigned char *local_mem_232419;\n    \n    local_mem_232419 = (__local unsigned char *) local_mem_232419_backing_0;\n    \n    int64_t trans_arr_len_232420 = (int64_t) 11 * segscan_group_sizze_207001;\n    int32_t dynamic_id_232426;\n    \n    if (local_tid_232411 == 0) {\n        dynamic_id_232426 = atomic_add_i32_global(&((volatile __global\n                                                     int *) mainziid_counter_mem_232402)[(int64_t) 0],\n                                                  (int) 1);\n        ((__local int32_t *) local_mem_232419)[(int64_t) 0] = dynamic_id_232426;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    dynamic_id_232426 = ((__local int32_t *) local_mem_232419)[(int64_t) 0];\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t blockOff_232427 = sext_i32_i64(dynamic_id_232426) * (int64_t) 11 *\n            segscan_group_sizze_207001;\n    int64_t sgm_idx_232428 = smod64(blockOff_232427, n_203490);\n    int32_t boundary_232429 = sext_i64_i32(smin64((int64_t) 11 *\n                                                  segscan_group_sizze_207001,\n                                                  n_203490 - sgm_idx_232428));\n    int32_t segsizze_compact_232430 = sext_i64_i32(smin64((int64_t) 11 *\n                                                          segscan_group_sizze_207001,\n                                                          n_203490));\n    int64_t private_mem_232431[(int64_t) 11];\n    \n    // Load and map\n    {\n        for (int64_t i_232433 = 0; i_232433 < (int64_t) 11; i_232433++) {\n            int64_t phys_tid_2324",
            "34 = blockOff_232427 +\n                    sext_i32_i64(local_tid_232411) + i_232433 *\n                    segscan_group_sizze_207001;\n            int64_t slice_232435 = n_203490;\n            int64_t slice_232436 = partition_sizze_203577 * slice_232435;\n            int64_t gtid_207005 = squot64(phys_tid_232434, slice_232435);\n            int64_t remnant_232437 = phys_tid_232434 - gtid_207005 *\n                    slice_232435;\n            int64_t gtid_207006 = remnant_232437;\n            int64_t remnant_232438 = remnant_232437 - gtid_207006;\n            \n            if (slt64(phys_tid_232434, partition_sizze_203577 * n_203490)) {\n                double x_207012;\n                \n                x_207012 = ((__global double *) mem_229161)[gtid_207005 *\n                                                            n_203490 +\n                                                            gtid_207006];\n                \n                bool isnan_res_207013;\n                \n                isnan_res_207013 = futrts_isnan64(x_207012);\n                \n                bool defunc_0_p_res_207014 = !isnan_res_207013;\n                int64_t defunc_0_f_res_207015 =\n                        btoi_bool_i64(defunc_0_p_res_207014);\n                \n                private_mem_232431[i_232433] = defunc_0_f_res_207015;\n            } else {\n                private_mem_232431[i_232433] = (int64_t) 0;\n            }\n        }\n    }\n    // Transpose scan inputs\n    {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_232439 = 0; i_232439 < (int64_t) 11; i_232439++) {\n            int64_t sharedIdx_232440 = sext_i32_i64(local_tid_232411) +\n                    i_232439 * segscan_group_sizze_207001;\n            int64_t tmp_232441;\n            \n            tmp_232441 = private_mem_232431[i_232439];\n            ((__local int64_t *) local_mem_232419)[sharedIdx_232440] =\n                tmp_232441;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int32_t i_232442 = 0; i_232442 <",
            " 11; i_232442++) {\n            int32_t sharedIdx_232443 = local_tid_232411 * 11 + i_232442;\n            int64_t tmp_232444;\n            \n            tmp_232444 = ((__local\n                           int64_t *) local_mem_232419)[sext_i32_i64(sharedIdx_232443)];\n            private_mem_232431[sext_i32_i64(i_232442)] = tmp_232444;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    // Per thread scan\n    {\n        int32_t gidx_232445 = local_tid_232411 * 11 + 1;\n        \n        for (int64_t i_232446 = 0; i_232446 < (int64_t) 10; i_232446++) {\n            bool new_sgm_232447 = smod32(gidx_232445 + sext_i64_i32(i_232446) -\n                                         boundary_232429,\n                                         segsizze_compact_232430) == 0;\n            \n            if (!new_sgm_232447) {\n                int64_t x_207008;\n                int64_t x_207009;\n                \n                x_207008 = private_mem_232431[i_232446];\n                x_207009 = private_mem_232431[i_232446 + (int64_t) 1];\n                \n                int64_t defunc_1_op_res_207010 = add64(x_207008, x_207009);\n                \n                private_mem_232431[i_232446 + (int64_t) 1] =\n                    defunc_1_op_res_207010;\n            }\n        }\n    }\n    // Publish results in shared memory\n    {\n        int64_t tmp_232448;\n        \n        tmp_232448 = private_mem_232431[(int64_t) 10];\n        ((__local int64_t *) local_mem_232419)[squot64(byte_offsets_232415,\n                                                       (int64_t) 8) +\n                                               sext_i32_i64(local_tid_232411)] =\n            tmp_232448;\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    \n    int64_t acc_232452;\n    \n    // Scan results (with warp scan)\n    {\n        int64_t x_232449;\n        int64_t x_232450;\n        int64_t x_232453;\n        int64_t x_232454;\n        bool ltid_in_bounds_232456 = slt64(sext_i32_i64(local_tid_232411),\n                                          ",
            " segscan_group_sizze_207001);\n        int32_t skip_threads_232457;\n        \n        // read input for in-block scan\n        {\n            if (ltid_in_bounds_232456) {\n                x_232450 = ((volatile __local\n                             int64_t *) local_mem_232419)[squot64(byte_offsets_232415,\n                                                                  (int64_t) 8) +\n                                                          sext_i32_i64(local_tid_232411)];\n                if ((local_tid_232411 - squot32(local_tid_232411, 32) * 32) ==\n                    0) {\n                    x_232449 = x_232450;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_232457 = 1;\n            while (slt32(skip_threads_232457, 32)) {\n                bool thread_active_232458 = sle32(skip_threads_232457,\n                                                  local_tid_232411 -\n                                                  squot32(local_tid_232411,\n                                                          32) * 32) &&\n                     ltid_in_bounds_232456;\n                \n                if (thread_active_232458) {\n                    // read operands\n                    {\n                        x_232449 = ((volatile __local\n                                     int64_t *) local_mem_232419)[squot64(byte_offsets_232415,\n                                                                          (int64_t) 8) +\n                                                                  (sext_i32_i64(local_tid_232411) -\n                                                                   sext_i32_i64(skip_threads_232457))];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_232459 = slt32(smod32((local_tid_232411 + 1) *\n                                                        11 - 1 +\n                                                   ",
            "     segsizze_compact_232430 -\n                                                        boundary_232429,\n                                                        segsizze_compact_232430),\n                                                 (local_tid_232411 + 1) * 11 -\n                                                 1 - ((local_tid_232411 -\n                                                       skip_threads_232457 +\n                                                       1) * 11 - 1));\n                    \n                    if (thread_active_232458 && inactive_232459) {\n                        x_232449 = x_232450;\n                    }\n                    if (thread_active_232458) {\n                        if (!inactive_232459) {\n                            int64_t defunc_1_op_res_232451 = add64(x_232449,\n                                                                   x_232450);\n                            \n                            x_232449 = defunc_1_op_res_232451;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_232413, skip_threads_232457)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_232458) {\n                    // write result\n                    {\n                        ((volatile __local\n                          int64_t *) local_mem_232419)[squot64(byte_offsets_232415,\n                                                               (int64_t) 8) +\n                                                       sext_i32_i64(local_tid_232411)] =\n                            x_232449;\n                        x_232450 = x_232449;\n                    }\n                }\n                if (sle32(wave_sizze_232413, skip_threads_232457)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_232457 *= 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_232411 - squot32(local_tid_232411, 32) * 32) == 31 &&\n                ltid_in_bounds_232456) {\n                ((volatile __local\n                  int64_t *) local_mem_232419)[squot64(byte_offsets_232415,\n                                                       (int64_t) 8) +\n                                               sext_i32_i64(squot32(local_tid_232411,\n                                                                    32))] =\n                    x_232449;\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_232460;\n            \n            // read input for in-block scan\n            {\n                if (squot32(local_tid_232411, 32) == 0 &&\n                    ltid_in_bounds_232456) {\n                    x_232454 = ((volatile __local\n                                 int64_t *) local_mem_232419)[squot64(byte_offsets_232415,\n                                                                      (int64_t) 8) +\n                                                              sext_i32_i64(local_tid_232411)];\n                    if ((local_tid_232411 - squot32(local_tid_232411, 32) *\n                         32) == 0) {\n                        x_232453 = x_232454;\n                    }\n                }\n            }\n            // in-block scan (hopefully no barriers needed)\n            {\n                skip_threads_232460 = 1;\n                while (slt32(skip_threads_232460, 32)) {\n                    bool thread_active_232461 = sle32(skip_threads_232460,\n                                                      local_tid_232411 -\n                                                      squot32(local_tid_232411,\n                                                              32) * 32) &&\n                         (squot32(local_tid_232411, 32) == 0 &&\n                          ltid_",
            "in_bounds_232456);\n                    \n                    if (thread_active_232461) {\n                        // read operands\n                        {\n                            x_232453 = ((volatile __local\n                                         int64_t *) local_mem_232419)[squot64(byte_offsets_232415,\n                                                                              (int64_t) 8) +\n                                                                      (sext_i32_i64(local_tid_232411) -\n                                                                       sext_i32_i64(skip_threads_232460))];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_232462 = slt32(smod32((local_tid_232411 *\n                                                             32 + 32 - 1 + 1) *\n                                                            11 - 1 +\n                                                            segsizze_compact_232430 -\n                                                            boundary_232429,\n                                                            segsizze_compact_232430),\n                                                     (local_tid_232411 * 32 +\n                                                      32 - 1 + 1) * 11 - 1 -\n                                                     (((local_tid_232411 -\n                                                        skip_threads_232460) *\n                                                       32 + 32 - 1 + 1) * 11 -\n                                                      1));\n                        \n                        if (thread_active_232461 && inactive_232462) {\n                            x_232453 = x_232454;\n                        }\n                        if (thread_active_232461) {\n                            if (!inactive_232462) {\n                                int64_t defunc_1_op_res_232455 = add64(x",
            "_232453,\n                                                                       x_232454);\n                                \n                                x_232453 = defunc_1_op_res_232455;\n                            }\n                        }\n                    }\n                    if (sle32(wave_sizze_232413, skip_threads_232460)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    if (thread_active_232461) {\n                        // write result\n                        {\n                            ((volatile __local\n                              int64_t *) local_mem_232419)[squot64(byte_offsets_232415,\n                                                                   (int64_t) 8) +\n                                                           sext_i32_i64(local_tid_232411)] =\n                                x_232453;\n                            x_232454 = x_232453;\n                        }\n                    }\n                    if (sle32(wave_sizze_232413, skip_threads_232460)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    skip_threads_232460 *= 2;\n                }\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        bool no_carry_in_232463 = squot32(local_tid_232411, 32) == 0 ||\n             !ltid_in_bounds_232456;\n        \n        // carry-in for every block except the first\n        {\n            // read operands\n            {\n                if (!no_carry_in_232463) {\n                    x_232450 = x_232449;\n                    x_232449 = ((__local\n                                 int64_t *) local_mem_232419)[squot64(byte_offsets_232415,\n                                                                      (int64_t) 8) +\n                                                              (sext_i32_i64(squot32(local_tid_232411,\n                                                                                    32)) -\n                 ",
            "                                              (int64_t) 1)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_232464 = slt32(smod32((local_tid_232411 + 1) *\n                                                    11 - 1 +\n                                                    segsizze_compact_232430 -\n                                                    boundary_232429,\n                                                    segsizze_compact_232430),\n                                             (local_tid_232411 + 1) * 11 - 1 -\n                                             ((squot32(local_tid_232411, 32) *\n                                               32 - 1 + 1) * 11 - 1));\n                \n                if (!no_carry_in_232463) {\n                    if (inactive_232464) {\n                        x_232449 = x_232450;\n                    }\n                }\n                if (!no_carry_in_232463) {\n                    if (!inactive_232464) {\n                        int64_t defunc_1_op_res_232451 = add64(x_232449,\n                                                               x_232450);\n                        \n                        x_232449 = defunc_1_op_res_232451;\n                    }\n                }\n            }\n            // write final result\n            {\n                if (!no_carry_in_232463) {\n                    ((__local\n                      int64_t *) local_mem_232419)[squot64(byte_offsets_232415,\n                                                           (int64_t) 8) +\n                                                   sext_i32_i64(local_tid_232411)] =\n                        x_232449;\n                }\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // restore correct values for first block\n        {\n            if (squot32(local_tid_232411, 32) == 0 && ltid_in_bounds_232456) {\n                ((__local\n                  int64_t *) local_mem_232419)[squot64(byte_offsets_2",
            "32415,\n                                                       (int64_t) 8) +\n                                               sext_i32_i64(local_tid_232411)] =\n                    x_232450;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (local_tid_232411 == 0) {\n            acc_232452 = ((__local\n                           int64_t *) local_mem_232419)[squot64(byte_offsets_232415,\n                                                                (int64_t) 8) +\n                                                        (segscan_group_sizze_207001 -\n                                                         (int64_t) 1)];\n        } else {\n            acc_232452 = ((__local\n                           int64_t *) local_mem_232419)[squot64(byte_offsets_232415,\n                                                                (int64_t) 8) +\n                                                        (sext_i32_i64(local_tid_232411) -\n                                                         (int64_t) 1)];\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    \n    int64_t prefix_232465 = (int64_t) 0;\n    bool block_new_sgm_232466 = sgm_idx_232428 == (int64_t) 0;\n    \n    // Perform lookback\n    {\n        if (block_new_sgm_232466 && local_tid_232411 == 0) {\n            ((volatile __global\n              int64_t *) incprefixes_mem_232408)[dynamic_id_232426] =\n                acc_232452;\n            mem_fence_global();\n            ((volatile __global\n              int8_t *) status_flags_mem_232404)[dynamic_id_232426] =\n                (int8_t) 2;\n            acc_232452 = (int64_t) 0;\n        }\n        if (!block_new_sgm_232466 && slt32(local_tid_232411,\n                                           wave_sizze_232413)) {\n            if (local_tid_232411 == 0) {\n                if (boundary_232429 == sext_i64_i32(segscan_group_sizze_207001 *\n                    (int64_t) 11)) {\n                    ((volatile __global\n                ",
            "      int64_t *) aggregates_mem_232406)[dynamic_id_232426] =\n                        acc_232452;\n                    mem_fence_global();\n                    ((volatile __global\n                      int8_t *) status_flags_mem_232404)[dynamic_id_232426] =\n                        (int8_t) 1;\n                } else {\n                    ((volatile __global\n                      int64_t *) incprefixes_mem_232408)[dynamic_id_232426] =\n                        acc_232452;\n                    mem_fence_global();\n                    ((volatile __global\n                      int8_t *) status_flags_mem_232404)[dynamic_id_232426] =\n                        (int8_t) 2;\n                }\n                \n                int8_t tmp_232467;\n                \n                tmp_232467 = ((volatile __global\n                               int8_t *) status_flags_mem_232404)[dynamic_id_232426 -\n                                                                  (int64_t) 1];\n                ((volatile __local int8_t *) local_mem_232419)[(int64_t) 0] =\n                    tmp_232467;\n            }\n            mem_fence_local();\n            \n            int8_t status_232468;\n            \n            status_232468 = ((__local int8_t *) local_mem_232419)[(int64_t) 0];\n            if (status_232468 == (int8_t) 2) {\n                if (local_tid_232411 == 0) {\n                    prefix_232465 = ((volatile __global\n                                      int64_t *) incprefixes_mem_232408)[dynamic_id_232426 -\n                                                                         (int64_t) 1];\n                }\n            } else {\n                int32_t readOffset_232469 = dynamic_id_232426 -\n                        sext_i32_i64(wave_sizze_232413);\n                \n                while (slt32(wave_sizze_232413 * -1, readOffset_232469)) {\n                    int32_t read_i_232470 = readOffset_232469 +\n                            local_tid_232411;\n                    int64_t aggr_232471 = (int64_",
            "t) 0;\n                    int8_t flag_232472 = (int8_t) 0;\n                    \n                    if (sle32(0, read_i_232470)) {\n                        if (sle64(blockOff_232427 -\n                                  (sext_i32_i64(read_i_232470 + 1) *\n                                   segscan_group_sizze_207001 * (int64_t) 11 -\n                                   (int64_t) 1), sgm_idx_232428)) {\n                            flag_232472 = ((volatile __global\n                                            int8_t *) status_flags_mem_232404)[sext_i32_i64(read_i_232470)];\n                            if (flag_232472 == (int8_t) 2) {\n                                aggr_232471 = ((volatile __global\n                                                int64_t *) incprefixes_mem_232408)[sext_i32_i64(read_i_232470)];\n                            } else {\n                                if (flag_232472 == (int8_t) 1) {\n                                    aggr_232471 = ((volatile __global\n                                                    int64_t *) aggregates_mem_232406)[sext_i32_i64(read_i_232470)];\n                                }\n                            }\n                        } else {\n                            flag_232472 = (int8_t) 2;\n                        }\n                    }\n                    ((__local\n                      int64_t *) local_mem_232419)[squot64(warp_byte_offset_232417,\n                                                           (int64_t) 8) +\n                                                   sext_i32_i64(local_tid_232411)] =\n                        aggr_232471;\n                    ((__local\n                      int8_t *) local_mem_232419)[sext_i32_i64(local_tid_232411)] =\n                        flag_232472;\n                    flag_232472 = ((__local\n                                    int8_t *) local_mem_232419)[sext_i32_i64(wave_sizze_232413) -\n                                                                (int64_t) 1];\n                    if",
            " (slt8(flag_232472, (int8_t) 2)) {\n                        int8_t flg_x_232476;\n                        int8_t flg_y_232477;\n                        int64_t x_232473;\n                        int64_t x_232474;\n                        int32_t skip_threads_232478;\n                        \n                        // read input for in-block scan\n                        {\n                            flg_y_232477 = ((volatile __local\n                                             int8_t *) local_mem_232419)[sext_i32_i64(local_tid_232411)];\n                            x_232474 = ((volatile __local\n                                         int64_t *) local_mem_232419)[squot64(warp_byte_offset_232417,\n                                                                              (int64_t) 8) +\n                                                                      sext_i32_i64(local_tid_232411)];\n                            if ((local_tid_232411 - squot32(local_tid_232411,\n                                                            32) * 32) == 0) {\n                                x_232473 = x_232474;\n                                flg_x_232476 = flg_y_232477;\n                            }\n                        }\n                        // in-block scan (hopefully no barriers needed)\n                        {\n                            skip_threads_232478 = 1;\n                            while (slt32(skip_threads_232478, 32)) {\n                                if (sle32(skip_threads_232478,\n                                          local_tid_232411 -\n                                          squot32(local_tid_232411, 32) * 32)) {\n                                    // read operands\n                                    {\n                                        flg_x_232476 = ((volatile __local\n                                                         int8_t *) local_mem_232419)[sext_i32_i64(local_tid_232411) -\n                                                                        ",
            "             sext_i32_i64(skip_threads_232478)];\n                                        x_232473 = ((volatile __local\n                                                     int64_t *) local_mem_232419)[squot64(warp_byte_offset_232417,\n                                                                                          (int64_t) 8) +\n                                                                                  (sext_i32_i64(local_tid_232411) -\n                                                                                   sext_i32_i64(skip_threads_232478))];\n                                    }\n                                    // perform operation\n                                    {\n                                        if (flg_y_232477 == (int8_t) 2 ||\n                                            flg_y_232477 == (int8_t) 0) {\n                                            flg_x_232476 = flg_y_232477;\n                                            x_232473 = x_232474;\n                                        } else {\n                                            int64_t defunc_1_op_res_232475 =\n                                                    add64(x_232473, x_232474);\n                                            \n                                            x_232473 = defunc_1_op_res_232475;\n                                        }\n                                    }\n                                    // write result\n                                    {\n                                        ((volatile __local\n                                          int8_t *) local_mem_232419)[sext_i32_i64(local_tid_232411)] =\n                                            flg_x_232476;\n                                        flg_y_232477 = flg_x_232476;\n                                        ((volatile __local\n                                          int64_t *) local_mem_232419)[squot64(warp_byte_offset_232417,\n                                                      ",
            "                         (int64_t) 8) +\n                                                                       sext_i32_i64(local_tid_232411)] =\n                                            x_232473;\n                                        x_232474 = x_232473;\n                                    }\n                                }\n                                skip_threads_232478 *= 2;\n                            }\n                        }\n                    }\n                    flag_232472 = ((__local\n                                    int8_t *) local_mem_232419)[sext_i32_i64(wave_sizze_232413) -\n                                                                (int64_t) 1];\n                    aggr_232471 = ((__local\n                                    int64_t *) local_mem_232419)[squot64(warp_byte_offset_232417,\n                                                                         (int64_t) 8) +\n                                                                 (sext_i32_i64(wave_sizze_232413) -\n                                                                  (int64_t) 1)];\n                    if (flag_232472 == (int8_t) 2) {\n                        readOffset_232469 = wave_sizze_232413 * -1;\n                    } else {\n                        if (flag_232472 == (int8_t) 1) {\n                            readOffset_232469 -= wave_sizze_232413;\n                        }\n                    }\n                    if (slt8((int8_t) 0, flag_232472)) {\n                        int64_t x_232479 = aggr_232471;\n                        int64_t x_232480 = prefix_232465;\n                        int64_t defunc_1_op_res_232481 = add64(x_232479,\n                                                               x_232480);\n                        \n                        prefix_232465 = defunc_1_op_res_232481;\n                    }\n                    mem_fence_local();\n                }\n            }\n            if (local_tid_232411 == 0) {\n                if (boundary_232429 =",
            "= sext_i64_i32(segscan_group_sizze_207001 *\n                    (int64_t) 11)) {\n                    int64_t x_232482 = prefix_232465;\n                    int64_t x_232483 = acc_232452;\n                    int64_t defunc_1_op_res_232484 = add64(x_232482, x_232483);\n                    \n                    ((volatile __global\n                      int64_t *) incprefixes_mem_232408)[dynamic_id_232426] =\n                        defunc_1_op_res_232484;\n                    mem_fence_global();\n                    ((volatile __global\n                      int8_t *) status_flags_mem_232404)[dynamic_id_232426] =\n                        (int8_t) 2;\n                }\n                ((__local\n                  int64_t *) local_mem_232419)[squot64(warp_byte_offset_232417,\n                                                       (int64_t) 8)] =\n                    prefix_232465;\n                acc_232452 = (int64_t) 0;\n            }\n        }\n        if (!(dynamic_id_232426 == (int64_t) 0)) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            prefix_232465 = ((__local\n                              int64_t *) local_mem_232419)[squot64(warp_byte_offset_232417,\n                                                                   (int64_t) 8)];\n            barrier(CLK_LOCAL_MEM_FENCE);\n        }\n    }\n    // Distribute results\n    {\n        int64_t x_232485;\n        int64_t x_232486;\n        int64_t x_232488 = prefix_232465;\n        int64_t x_232489 = acc_232452;\n        \n        if (slt32(local_tid_232411 * 11, boundary_232429) &&\n            !block_new_sgm_232466) {\n            int64_t defunc_1_op_res_232490 = add64(x_232488, x_232489);\n            \n            x_232485 = defunc_1_op_res_232490;\n        } else {\n            x_232485 = acc_232452;\n        }\n        \n        int32_t stopping_point_232491 = segsizze_compact_232430 -\n                srem32(local_tid_232411 * 11 - 1 + segsizze_compact_232430 -\n                       boundary_232429, segsizze_compact_232430);\n        \n ",
            "       for (int64_t i_232492 = 0; i_232492 < (int64_t) 11; i_232492++) {\n            if (slt32(sext_i64_i32(i_232492), stopping_point_232491 - 1)) {\n                x_232486 = private_mem_232431[i_232492];\n                \n                int64_t defunc_1_op_res_232487 = add64(x_232485, x_232486);\n                \n                private_mem_232431[i_232492] = defunc_1_op_res_232487;\n            }\n        }\n    }\n    // Transpose scan output and Write it to global memory in coalesced fashion\n    {\n        for (int64_t i_232493 = 0; i_232493 < (int64_t) 11; i_232493++) {\n            int64_t sharedIdx_232494 = sext_i32_i64(local_tid_232411 * 11) +\n                    i_232493;\n            int64_t tmp_232495;\n            \n            tmp_232495 = private_mem_232431[i_232493];\n            ((__local int64_t *) local_mem_232419)[sharedIdx_232494] =\n                tmp_232495;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_232496 = 0; i_232496 < (int64_t) 11; i_232496++) {\n            int64_t flat_idx_232497 = blockOff_232427 +\n                    segscan_group_sizze_207001 * i_232496 +\n                    sext_i32_i64(local_tid_232411);\n            int64_t slice_232498 = n_203490;\n            int64_t slice_232499 = partition_sizze_203577 * slice_232498;\n            int64_t gtid_207005 = squot64(flat_idx_232497, slice_232498);\n            int64_t remnant_232500 = flat_idx_232497 - gtid_207005 *\n                    slice_232498;\n            int64_t gtid_207006 = remnant_232500;\n            int64_t remnant_232501 = remnant_232500 - gtid_207006;\n            \n            if (slt64(flat_idx_232497, partition_sizze_203577 * n_203490)) {\n                int64_t tmp_232502;\n                \n                tmp_232502 = ((__local\n                               int64_t *) local_mem_232419)[flat_idx_232497 -\n                                                            blockOff_232427];\n                ((__global int64_t *) mem_229186)[gtid_207005 * n_203490 +\n ",
            "                                                 gtid_207006] = tmp_232502;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    // If this is the last block, reset the dynamicId\n    {\n        if (dynamic_id_232426 == sdiv_up64(partition_sizze_203577 * n_203490,\n                                           segscan_group_sizze_207001 *\n                                           (int64_t) 11) - (int64_t) 1) {\n            ((__global int32_t *) mainziid_counter_mem_232402)[(int64_t) 0] = 0;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_207001\n}\n__kernel void mainzisegscan_207559(__global int *global_failure,\n                                   uint local_mem_232626_backing_offset_0,\n                                   int64_t n_p_203492,\n                                   int64_t partition_sizze_203577,\n                                   int64_t defunc_0_f_res_203631, __global\n                                   unsigned char *mem_229206, __global\n                                   unsigned char *mem_229250, __global\n                                   unsigned char *mainziid_counter_mem_232609,\n                                   __global\n                                   unsigned char *status_flags_mem_232611,\n                                   __global\n                                   unsigned char *aggregates_mem_232613,\n                                   __global\n                                   unsigned char *incprefixes_mem_232615)\n{\n    #define segscan_group_sizze_207552 (mainzisegscan_group_sizze_207419)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *local_mem_232626_backing_0 =\n                           &shared_mem[local_mem_232626_backing_offset_0];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_232617;\n    int32_t local_tid_232618;\n    int64_t group_sizze_232621;\n    int32_t wave_sizze_232620;\n    int32_t ",
            "group_tid_232619;\n    \n    global_tid_232617 = get_global_id(0);\n    local_tid_232618 = get_local_id(0);\n    group_sizze_232621 = get_local_size(0);\n    wave_sizze_232620 = LOCKSTEP_WIDTH;\n    group_tid_232619 = get_group_id(0);\n    \n    int32_t phys_tid_207559 = global_tid_232617;\n    int64_t byte_offsets_232622 = (int64_t) 0;\n    int64_t byte_offsets_232623 = segscan_group_sizze_207552 * (int64_t) 8;\n    int64_t warp_byte_offset_232624 = (int64_t) 32;\n    int64_t warp_byte_offset_232625 = (int64_t) 288;\n    \n    // Allocate reused shared memeory\n    { }\n    \n    __local unsigned char *local_mem_232626;\n    \n    local_mem_232626 = (__local unsigned char *) local_mem_232626_backing_0;\n    \n    int64_t trans_arr_len_232627 = (int64_t) 11 * segscan_group_sizze_207552;\n    int32_t dynamic_id_232633;\n    \n    if (local_tid_232618 == 0) {\n        dynamic_id_232633 = atomic_add_i32_global(&((volatile __global\n                                                     int *) mainziid_counter_mem_232609)[(int64_t) 0],\n                                                  (int) 1);\n        ((__local int32_t *) local_mem_232626)[(int64_t) 0] = dynamic_id_232633;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    dynamic_id_232633 = ((__local int32_t *) local_mem_232626)[(int64_t) 0];\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t blockOff_232634 = sext_i32_i64(dynamic_id_232633) * (int64_t) 11 *\n            segscan_group_sizze_207552;\n    int64_t sgm_idx_232635 = smod64(blockOff_232634, defunc_0_f_res_203631);\n    int32_t boundary_232636 = sext_i64_i32(smin64((int64_t) 11 *\n                                                  segscan_group_sizze_207552,\n                                                  defunc_0_f_res_203631 -\n                                                  sgm_idx_232635));\n    int32_t segsizze_compact_232637 = sext_i64_i32(smin64((int64_t) 11 *\n                                                          segscan_group_sizze_207552,\n                                           ",
            "               defunc_0_f_res_203631));\n    int64_t private_mem_232638[(int64_t) 11];\n    \n    // Load and map\n    {\n        for (int64_t i_232640 = 0; i_232640 < (int64_t) 11; i_232640++) {\n            int64_t phys_tid_232641 = blockOff_232634 +\n                    sext_i32_i64(local_tid_232618) + i_232640 *\n                    segscan_group_sizze_207552;\n            int64_t slice_232642 = defunc_0_f_res_203631;\n            int64_t slice_232643 = n_p_203492 * slice_232642;\n            int64_t slice_232644 = partition_sizze_203577 * slice_232643;\n            int64_t gtid_207556 = squot64(phys_tid_232641, slice_232643);\n            int64_t remnant_232645 = phys_tid_232641 - gtid_207556 *\n                    slice_232643;\n            int64_t gtid_207557 = squot64(remnant_232645, slice_232642);\n            int64_t remnant_232646 = remnant_232645 - gtid_207557 *\n                    slice_232642;\n            int64_t gtid_207558 = remnant_232646;\n            int64_t remnant_232647 = remnant_232646 - gtid_207558;\n            \n            if (slt64(phys_tid_232641, partition_sizze_203577 * n_p_203492 *\n                      defunc_0_f_res_203631)) {\n                double x_207565;\n                \n                x_207565 = ((__global double *) mem_229206)[gtid_207556 *\n                                                            (defunc_0_f_res_203631 *\n                                                             n_p_203492) +\n                                                            gtid_207557 *\n                                                            defunc_0_f_res_203631 +\n                                                            gtid_207558];\n                \n                bool isnan_res_207566;\n                \n                isnan_res_207566 = futrts_isnan64(x_207565);\n                \n                bool defunc_0_p_res_207567 = !isnan_res_207566;\n                int64_t defunc_0_f_res_207568 =\n                        btoi_bool_i64(defunc_0_p_res_207567);",
            "\n                \n                private_mem_232638[i_232640] = defunc_0_f_res_207568;\n            } else {\n                private_mem_232638[i_232640] = (int64_t) 0;\n            }\n        }\n    }\n    // Transpose scan inputs\n    {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_232648 = 0; i_232648 < (int64_t) 11; i_232648++) {\n            int64_t sharedIdx_232649 = sext_i32_i64(local_tid_232618) +\n                    i_232648 * segscan_group_sizze_207552;\n            int64_t tmp_232650;\n            \n            tmp_232650 = private_mem_232638[i_232648];\n            ((__local int64_t *) local_mem_232626)[sharedIdx_232649] =\n                tmp_232650;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int32_t i_232651 = 0; i_232651 < 11; i_232651++) {\n            int32_t sharedIdx_232652 = local_tid_232618 * 11 + i_232651;\n            int64_t tmp_232653;\n            \n            tmp_232653 = ((__local\n                           int64_t *) local_mem_232626)[sext_i32_i64(sharedIdx_232652)];\n            private_mem_232638[sext_i32_i64(i_232651)] = tmp_232653;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    // Per thread scan\n    {\n        int32_t gidx_232654 = local_tid_232618 * 11 + 1;\n        \n        for (int64_t i_232655 = 0; i_232655 < (int64_t) 10; i_232655++) {\n            bool new_sgm_232656 = smod32(gidx_232654 + sext_i64_i32(i_232655) -\n                                         boundary_232636,\n                                         segsizze_compact_232637) == 0;\n            \n            if (!new_sgm_232656) {\n                int64_t x_207560;\n                int64_t x_207561;\n                \n                x_207560 = private_mem_232638[i_232655];\n                x_207561 = private_mem_232638[i_232655 + (int64_t) 1];\n                \n                int64_t defunc_1_op_res_207562 = add64(x_207560, x_207561);\n                \n                private_mem_232638[i_232655 + (int64_t) 1] =\n                    defunc_1_op_res_",
            "207562;\n            }\n        }\n    }\n    // Publish results in shared memory\n    {\n        int64_t tmp_232657;\n        \n        tmp_232657 = private_mem_232638[(int64_t) 10];\n        ((__local int64_t *) local_mem_232626)[squot64(byte_offsets_232622,\n                                                       (int64_t) 8) +\n                                               sext_i32_i64(local_tid_232618)] =\n            tmp_232657;\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    \n    int64_t acc_232661;\n    \n    // Scan results (with warp scan)\n    {\n        int64_t x_232658;\n        int64_t x_232659;\n        int64_t x_232662;\n        int64_t x_232663;\n        bool ltid_in_bounds_232665 = slt64(sext_i32_i64(local_tid_232618),\n                                           segscan_group_sizze_207552);\n        int32_t skip_threads_232666;\n        \n        // read input for in-block scan\n        {\n            if (ltid_in_bounds_232665) {\n                x_232659 = ((volatile __local\n                             int64_t *) local_mem_232626)[squot64(byte_offsets_232622,\n                                                                  (int64_t) 8) +\n                                                          sext_i32_i64(local_tid_232618)];\n                if ((local_tid_232618 - squot32(local_tid_232618, 32) * 32) ==\n                    0) {\n                    x_232658 = x_232659;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_232666 = 1;\n            while (slt32(skip_threads_232666, 32)) {\n                bool thread_active_232667 = sle32(skip_threads_232666,\n                                                  local_tid_232618 -\n                                                  squot32(local_tid_232618,\n                                                          32) * 32) &&\n                     ltid_in_bounds_232665;\n                \n                if (thread_active_232667) {\n                    // r",
            "ead operands\n                    {\n                        x_232658 = ((volatile __local\n                                     int64_t *) local_mem_232626)[squot64(byte_offsets_232622,\n                                                                          (int64_t) 8) +\n                                                                  (sext_i32_i64(local_tid_232618) -\n                                                                   sext_i32_i64(skip_threads_232666))];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_232668 = slt32(smod32((local_tid_232618 + 1) *\n                                                        11 - 1 +\n                                                        segsizze_compact_232637 -\n                                                        boundary_232636,\n                                                        segsizze_compact_232637),\n                                                 (local_tid_232618 + 1) * 11 -\n                                                 1 - ((local_tid_232618 -\n                                                       skip_threads_232666 +\n                                                       1) * 11 - 1));\n                    \n                    if (thread_active_232667 && inactive_232668) {\n                        x_232658 = x_232659;\n                    }\n                    if (thread_active_232667) {\n                        if (!inactive_232668) {\n                            int64_t defunc_1_op_res_232660 = add64(x_232658,\n                                                                   x_232659);\n                            \n                            x_232658 = defunc_1_op_res_232660;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_232620, skip_threads_232666)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_232667) {\n",
            "                    // write result\n                    {\n                        ((volatile __local\n                          int64_t *) local_mem_232626)[squot64(byte_offsets_232622,\n                                                               (int64_t) 8) +\n                                                       sext_i32_i64(local_tid_232618)] =\n                            x_232658;\n                        x_232659 = x_232658;\n                    }\n                }\n                if (sle32(wave_sizze_232620, skip_threads_232666)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_232666 *= 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_232618 - squot32(local_tid_232618, 32) * 32) == 31 &&\n                ltid_in_bounds_232665) {\n                ((volatile __local\n                  int64_t *) local_mem_232626)[squot64(byte_offsets_232622,\n                                                       (int64_t) 8) +\n                                               sext_i32_i64(squot32(local_tid_232618,\n                                                                    32))] =\n                    x_232658;\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_232669;\n            \n            // read input for in-block scan\n            {\n                if (squot32(local_tid_232618, 32) == 0 &&\n                    ltid_in_bounds_232665) {\n                    x_232663 = ((volatile __local\n                                 int64_t *) local_mem_232626)[squot64(byte_offsets_232622,\n                                                                      (int64_t) 8) +\n                                                              sext_i32_i64(local_tid_232618)];\n             ",
            "       if ((local_tid_232618 - squot32(local_tid_232618, 32) *\n                         32) == 0) {\n                        x_232662 = x_232663;\n                    }\n                }\n            }\n            // in-block scan (hopefully no barriers needed)\n            {\n                skip_threads_232669 = 1;\n                while (slt32(skip_threads_232669, 32)) {\n                    bool thread_active_232670 = sle32(skip_threads_232669,\n                                                      local_tid_232618 -\n                                                      squot32(local_tid_232618,\n                                                              32) * 32) &&\n                         (squot32(local_tid_232618, 32) == 0 &&\n                          ltid_in_bounds_232665);\n                    \n                    if (thread_active_232670) {\n                        // read operands\n                        {\n                            x_232662 = ((volatile __local\n                                         int64_t *) local_mem_232626)[squot64(byte_offsets_232622,\n                                                                              (int64_t) 8) +\n                                                                      (sext_i32_i64(local_tid_232618) -\n                                                                       sext_i32_i64(skip_threads_232669))];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_232671 = slt32(smod32((local_tid_232618 *\n                                                             32 + 32 - 1 + 1) *\n                                                            11 - 1 +\n                                                            segsizze_compact_232637 -\n                                                            boundary_232636,\n                                                            segsizze_compact_232637),\n                         ",
            "                            (local_tid_232618 * 32 +\n                                                      32 - 1 + 1) * 11 - 1 -\n                                                     (((local_tid_232618 -\n                                                        skip_threads_232669) *\n                                                       32 + 32 - 1 + 1) * 11 -\n                                                      1));\n                        \n                        if (thread_active_232670 && inactive_232671) {\n                            x_232662 = x_232663;\n                        }\n                        if (thread_active_232670) {\n                            if (!inactive_232671) {\n                                int64_t defunc_1_op_res_232664 = add64(x_232662,\n                                                                       x_232663);\n                                \n                                x_232662 = defunc_1_op_res_232664;\n                            }\n                        }\n                    }\n                    if (sle32(wave_sizze_232620, skip_threads_232669)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    if (thread_active_232670) {\n                        // write result\n                        {\n                            ((volatile __local\n                              int64_t *) local_mem_232626)[squot64(byte_offsets_232622,\n                                                                   (int64_t) 8) +\n                                                           sext_i32_i64(local_tid_232618)] =\n                                x_232662;\n                            x_232663 = x_232662;\n                        }\n                    }\n                    if (sle32(wave_sizze_232620, skip_threads_232669)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    skip_threads_232669 *= 2;\n                }\n            }\n        }\n        barri",
            "er(CLK_LOCAL_MEM_FENCE);\n        \n        bool no_carry_in_232672 = squot32(local_tid_232618, 32) == 0 ||\n             !ltid_in_bounds_232665;\n        \n        // carry-in for every block except the first\n        {\n            // read operands\n            {\n                if (!no_carry_in_232672) {\n                    x_232659 = x_232658;\n                    x_232658 = ((__local\n                                 int64_t *) local_mem_232626)[squot64(byte_offsets_232622,\n                                                                      (int64_t) 8) +\n                                                              (sext_i32_i64(squot32(local_tid_232618,\n                                                                                    32)) -\n                                                               (int64_t) 1)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_232673 = slt32(smod32((local_tid_232618 + 1) *\n                                                    11 - 1 +\n                                                    segsizze_compact_232637 -\n                                                    boundary_232636,\n                                                    segsizze_compact_232637),\n                                             (local_tid_232618 + 1) * 11 - 1 -\n                                             ((squot32(local_tid_232618, 32) *\n                                               32 - 1 + 1) * 11 - 1));\n                \n                if (!no_carry_in_232672) {\n                    if (inactive_232673) {\n                        x_232658 = x_232659;\n                    }\n                }\n                if (!no_carry_in_232672) {\n                    if (!inactive_232673) {\n                        int64_t defunc_1_op_res_232660 = add64(x_232658,\n                                                               x_232659);\n                        \n                        x_232658 = defunc_1_op_res_2",
            "32660;\n                    }\n                }\n            }\n            // write final result\n            {\n                if (!no_carry_in_232672) {\n                    ((__local\n                      int64_t *) local_mem_232626)[squot64(byte_offsets_232622,\n                                                           (int64_t) 8) +\n                                                   sext_i32_i64(local_tid_232618)] =\n                        x_232658;\n                }\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // restore correct values for first block\n        {\n            if (squot32(local_tid_232618, 32) == 0 && ltid_in_bounds_232665) {\n                ((__local\n                  int64_t *) local_mem_232626)[squot64(byte_offsets_232622,\n                                                       (int64_t) 8) +\n                                               sext_i32_i64(local_tid_232618)] =\n                    x_232659;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (local_tid_232618 == 0) {\n            acc_232661 = ((__local\n                           int64_t *) local_mem_232626)[squot64(byte_offsets_232622,\n                                                                (int64_t) 8) +\n                                                        (segscan_group_sizze_207552 -\n                                                         (int64_t) 1)];\n        } else {\n            acc_232661 = ((__local\n                           int64_t *) local_mem_232626)[squot64(byte_offsets_232622,\n                                                                (int64_t) 8) +\n                                                        (sext_i32_i64(local_tid_232618) -\n                                                         (int64_t) 1)];\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    \n    int64_t prefix_232674 = (int64_t) 0;\n    bool block_new_sgm_232675 = sgm_idx_232635 == (int64_t) 0;\n    \n   ",
            " // Perform lookback\n    {\n        if (block_new_sgm_232675 && local_tid_232618 == 0) {\n            ((volatile __global\n              int64_t *) incprefixes_mem_232615)[dynamic_id_232633] =\n                acc_232661;\n            mem_fence_global();\n            ((volatile __global\n              int8_t *) status_flags_mem_232611)[dynamic_id_232633] =\n                (int8_t) 2;\n            acc_232661 = (int64_t) 0;\n        }\n        if (!block_new_sgm_232675 && slt32(local_tid_232618,\n                                           wave_sizze_232620)) {\n            if (local_tid_232618 == 0) {\n                if (boundary_232636 == sext_i64_i32(segscan_group_sizze_207552 *\n                    (int64_t) 11)) {\n                    ((volatile __global\n                      int64_t *) aggregates_mem_232613)[dynamic_id_232633] =\n                        acc_232661;\n                    mem_fence_global();\n                    ((volatile __global\n                      int8_t *) status_flags_mem_232611)[dynamic_id_232633] =\n                        (int8_t) 1;\n                } else {\n                    ((volatile __global\n                      int64_t *) incprefixes_mem_232615)[dynamic_id_232633] =\n                        acc_232661;\n                    mem_fence_global();\n                    ((volatile __global\n                      int8_t *) status_flags_mem_232611)[dynamic_id_232633] =\n                        (int8_t) 2;\n                }\n                \n                int8_t tmp_232676;\n                \n                tmp_232676 = ((volatile __global\n                               int8_t *) status_flags_mem_232611)[dynamic_id_232633 -\n                                                                  (int64_t) 1];\n                ((volatile __local int8_t *) local_mem_232626)[(int64_t) 0] =\n                    tmp_232676;\n            }\n            mem_fence_local();\n            \n            int8_t status_232677;\n            \n            status_232677 = ((__local int8_t *) lo",
            "cal_mem_232626)[(int64_t) 0];\n            if (status_232677 == (int8_t) 2) {\n                if (local_tid_232618 == 0) {\n                    prefix_232674 = ((volatile __global\n                                      int64_t *) incprefixes_mem_232615)[dynamic_id_232633 -\n                                                                         (int64_t) 1];\n                }\n            } else {\n                int32_t readOffset_232678 = dynamic_id_232633 -\n                        sext_i32_i64(wave_sizze_232620);\n                \n                while (slt32(wave_sizze_232620 * -1, readOffset_232678)) {\n                    int32_t read_i_232679 = readOffset_232678 +\n                            local_tid_232618;\n                    int64_t aggr_232680 = (int64_t) 0;\n                    int8_t flag_232681 = (int8_t) 0;\n                    \n                    if (sle32(0, read_i_232679)) {\n                        if (sle64(blockOff_232634 -\n                                  (sext_i32_i64(read_i_232679 + 1) *\n                                   segscan_group_sizze_207552 * (int64_t) 11 -\n                                   (int64_t) 1), sgm_idx_232635)) {\n                            flag_232681 = ((volatile __global\n                                            int8_t *) status_flags_mem_232611)[sext_i32_i64(read_i_232679)];\n                            if (flag_232681 == (int8_t) 2) {\n                                aggr_232680 = ((volatile __global\n                                                int64_t *) incprefixes_mem_232615)[sext_i32_i64(read_i_232679)];\n                            } else {\n                                if (flag_232681 == (int8_t) 1) {\n                                    aggr_232680 = ((volatile __global\n                                                    int64_t *) aggregates_mem_232613)[sext_i32_i64(read_i_232679)];\n                                }\n                            }\n                        } else {\n                            flag_232",
            "681 = (int8_t) 2;\n                        }\n                    }\n                    ((__local\n                      int64_t *) local_mem_232626)[squot64(warp_byte_offset_232624,\n                                                           (int64_t) 8) +\n                                                   sext_i32_i64(local_tid_232618)] =\n                        aggr_232680;\n                    ((__local\n                      int8_t *) local_mem_232626)[sext_i32_i64(local_tid_232618)] =\n                        flag_232681;\n                    flag_232681 = ((__local\n                                    int8_t *) local_mem_232626)[sext_i32_i64(wave_sizze_232620) -\n                                                                (int64_t) 1];\n                    if (slt8(flag_232681, (int8_t) 2)) {\n                        int8_t flg_x_232685;\n                        int8_t flg_y_232686;\n                        int64_t x_232682;\n                        int64_t x_232683;\n                        int32_t skip_threads_232687;\n                        \n                        // read input for in-block scan\n                        {\n                            flg_y_232686 = ((volatile __local\n                                             int8_t *) local_mem_232626)[sext_i32_i64(local_tid_232618)];\n                            x_232683 = ((volatile __local\n                                         int64_t *) local_mem_232626)[squot64(warp_byte_offset_232624,\n                                                                              (int64_t) 8) +\n                                                                      sext_i32_i64(local_tid_232618)];\n                            if ((local_tid_232618 - squot32(local_tid_232618,\n                                                            32) * 32) == 0) {\n                                x_232682 = x_232683;\n                                flg_x_232685 = flg_y_232686;\n                            }\n                        }\n           ",
            "             // in-block scan (hopefully no barriers needed)\n                        {\n                            skip_threads_232687 = 1;\n                            while (slt32(skip_threads_232687, 32)) {\n                                if (sle32(skip_threads_232687,\n                                          local_tid_232618 -\n                                          squot32(local_tid_232618, 32) * 32)) {\n                                    // read operands\n                                    {\n                                        flg_x_232685 = ((volatile __local\n                                                         int8_t *) local_mem_232626)[sext_i32_i64(local_tid_232618) -\n                                                                                     sext_i32_i64(skip_threads_232687)];\n                                        x_232682 = ((volatile __local\n                                                     int64_t *) local_mem_232626)[squot64(warp_byte_offset_232624,\n                                                                                          (int64_t) 8) +\n                                                                                  (sext_i32_i64(local_tid_232618) -\n                                                                                   sext_i32_i64(skip_threads_232687))];\n                                    }\n                                    // perform operation\n                                    {\n                                        if (flg_y_232686 == (int8_t) 2 ||\n                                            flg_y_232686 == (int8_t) 0) {\n                                            flg_x_232685 = flg_y_232686;\n                                            x_232682 = x_232683;\n                                        } else {\n                                            int64_t defunc_1_op_res_232684 =\n                                                    add64(x_232682, x_232683);\n                                ",
            "            \n                                            x_232682 = defunc_1_op_res_232684;\n                                        }\n                                    }\n                                    // write result\n                                    {\n                                        ((volatile __local\n                                          int8_t *) local_mem_232626)[sext_i32_i64(local_tid_232618)] =\n                                            flg_x_232685;\n                                        flg_y_232686 = flg_x_232685;\n                                        ((volatile __local\n                                          int64_t *) local_mem_232626)[squot64(warp_byte_offset_232624,\n                                                                               (int64_t) 8) +\n                                                                       sext_i32_i64(local_tid_232618)] =\n                                            x_232682;\n                                        x_232683 = x_232682;\n                                    }\n                                }\n                                skip_threads_232687 *= 2;\n                            }\n                        }\n                    }\n                    flag_232681 = ((__local\n                                    int8_t *) local_mem_232626)[sext_i32_i64(wave_sizze_232620) -\n                                                                (int64_t) 1];\n                    aggr_232680 = ((__local\n                                    int64_t *) local_mem_232626)[squot64(warp_byte_offset_232624,\n                                                                         (int64_t) 8) +\n                                                                 (sext_i32_i64(wave_sizze_232620) -\n                                                                  (int64_t) 1)];\n                    if (flag_232681 == (int8_t) 2) {\n                        readOffset_232678 = wave_sizze_232620 * -1;\n           ",
            "         } else {\n                        if (flag_232681 == (int8_t) 1) {\n                            readOffset_232678 -= wave_sizze_232620;\n                        }\n                    }\n                    if (slt8((int8_t) 0, flag_232681)) {\n                        int64_t x_232688 = aggr_232680;\n                        int64_t x_232689 = prefix_232674;\n                        int64_t defunc_1_op_res_232690 = add64(x_232688,\n                                                               x_232689);\n                        \n                        prefix_232674 = defunc_1_op_res_232690;\n                    }\n                    mem_fence_local();\n                }\n            }\n            if (local_tid_232618 == 0) {\n                if (boundary_232636 == sext_i64_i32(segscan_group_sizze_207552 *\n                    (int64_t) 11)) {\n                    int64_t x_232691 = prefix_232674;\n                    int64_t x_232692 = acc_232661;\n                    int64_t defunc_1_op_res_232693 = add64(x_232691, x_232692);\n                    \n                    ((volatile __global\n                      int64_t *) incprefixes_mem_232615)[dynamic_id_232633] =\n                        defunc_1_op_res_232693;\n                    mem_fence_global();\n                    ((volatile __global\n                      int8_t *) status_flags_mem_232611)[dynamic_id_232633] =\n                        (int8_t) 2;\n                }\n                ((__local\n                  int64_t *) local_mem_232626)[squot64(warp_byte_offset_232624,\n                                                       (int64_t) 8)] =\n                    prefix_232674;\n                acc_232661 = (int64_t) 0;\n            }\n        }\n        if (!(dynamic_id_232633 == (int64_t) 0)) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            prefix_232674 = ((__local\n                              int64_t *) local_mem_232626)[squot64(warp_byte_offset_232624,\n                                                                 ",
            "  (int64_t) 8)];\n            barrier(CLK_LOCAL_MEM_FENCE);\n        }\n    }\n    // Distribute results\n    {\n        int64_t x_232694;\n        int64_t x_232695;\n        int64_t x_232697 = prefix_232674;\n        int64_t x_232698 = acc_232661;\n        \n        if (slt32(local_tid_232618 * 11, boundary_232636) &&\n            !block_new_sgm_232675) {\n            int64_t defunc_1_op_res_232699 = add64(x_232697, x_232698);\n            \n            x_232694 = defunc_1_op_res_232699;\n        } else {\n            x_232694 = acc_232661;\n        }\n        \n        int32_t stopping_point_232700 = segsizze_compact_232637 -\n                srem32(local_tid_232618 * 11 - 1 + segsizze_compact_232637 -\n                       boundary_232636, segsizze_compact_232637);\n        \n        for (int64_t i_232701 = 0; i_232701 < (int64_t) 11; i_232701++) {\n            if (slt32(sext_i64_i32(i_232701), stopping_point_232700 - 1)) {\n                x_232695 = private_mem_232638[i_232701];\n                \n                int64_t defunc_1_op_res_232696 = add64(x_232694, x_232695);\n                \n                private_mem_232638[i_232701] = defunc_1_op_res_232696;\n            }\n        }\n    }\n    // Transpose scan output and Write it to global memory in coalesced fashion\n    {\n        for (int64_t i_232702 = 0; i_232702 < (int64_t) 11; i_232702++) {\n            int64_t sharedIdx_232703 = sext_i32_i64(local_tid_232618 * 11) +\n                    i_232702;\n            int64_t tmp_232704;\n            \n            tmp_232704 = private_mem_232638[i_232702];\n            ((__local int64_t *) local_mem_232626)[sharedIdx_232703] =\n                tmp_232704;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_232705 = 0; i_232705 < (int64_t) 11; i_232705++) {\n            int64_t flat_idx_232706 = blockOff_232634 +\n                    segscan_group_sizze_207552 * i_232705 +\n                    sext_i32_i64(local_tid_232618);\n            int64_t slice_232707 = defunc_0_f_res_203631;\n",
            "            int64_t slice_232708 = n_p_203492 * slice_232707;\n            int64_t slice_232709 = partition_sizze_203577 * slice_232708;\n            int64_t gtid_207556 = squot64(flat_idx_232706, slice_232708);\n            int64_t remnant_232710 = flat_idx_232706 - gtid_207556 *\n                    slice_232708;\n            int64_t gtid_207557 = squot64(remnant_232710, slice_232707);\n            int64_t remnant_232711 = remnant_232710 - gtid_207557 *\n                    slice_232707;\n            int64_t gtid_207558 = remnant_232711;\n            int64_t remnant_232712 = remnant_232711 - gtid_207558;\n            \n            if (slt64(flat_idx_232706, partition_sizze_203577 * n_p_203492 *\n                      defunc_0_f_res_203631)) {\n                int64_t tmp_232713;\n                \n                tmp_232713 = ((__local\n                               int64_t *) local_mem_232626)[flat_idx_232706 -\n                                                            blockOff_232634];\n                ((__global int64_t *) mem_229250)[gtid_207556 *\n                                                  (defunc_0_f_res_203631 *\n                                                   n_p_203492) + gtid_207557 *\n                                                  defunc_0_f_res_203631 +\n                                                  gtid_207558] = tmp_232713;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    // If this is the last block, reset the dynamicId\n    {\n        if (dynamic_id_232633 == sdiv_up64(partition_sizze_203577 * n_p_203492 *\n                                           defunc_0_f_res_203631,\n                                           segscan_group_sizze_207552 *\n                                           (int64_t) 11) - (int64_t) 1) {\n            ((__global int32_t *) mainziid_counter_mem_232609)[(int64_t) 0] = 0;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_207552\n}\n__kernel void mainzisegscan_218683(__global int *globa",
            "l_failure,\n                                   int failure_is_an_option, __global\n                                   int64_t *global_failure_args,\n                                   uint local_mem_234314_backing_offset_0,\n                                   int64_t n_p_203492, double i64_res_203507,\n                                   int64_t partition_sizze_203577,\n                                   int64_t C_len_203634,\n                                   int64_t lifted_single_ma_l_arg_204134,\n                                   __global unsigned char *mem_230500, __global\n                                   unsigned char *ext_mem_230512, __global\n                                   unsigned char *mem_230517, __global\n                                   unsigned char *mainziid_counter_mem_234297,\n                                   __global\n                                   unsigned char *status_flags_mem_234299,\n                                   __global\n                                   unsigned char *aggregates_mem_234301,\n                                   __global\n                                   unsigned char *incprefixes_mem_234303)\n{\n    #define segscan_group_sizze_218677 (mainzisegscan_group_sizze_218641)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *local_mem_234314_backing_0 =\n                           &shared_mem[local_mem_234314_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_234305;\n    int32_t local_tid_234306;\n    int64_t group_sizze_234309;\n    int32_t wave_sizze_234308;\n    int32_t group_tid_234307;\n    \n    global_tid_234305 = get_global_id(0);\n    local_tid_234306 = get_local_id(0);\n    group_sizze_234309 = get_local_size(0);\n    wave_sizze",
            "_234308 = LOCKSTEP_WIDTH;\n    group_tid_234307 = get_group_id(0);\n    \n    int32_t phys_tid_218683 = global_tid_234305;\n    int64_t byte_offsets_234310 = (int64_t) 0;\n    int64_t byte_offsets_234311 = segscan_group_sizze_218677 * (int64_t) 8;\n    int64_t warp_byte_offset_234312 = (int64_t) 32;\n    int64_t warp_byte_offset_234313 = (int64_t) 288;\n    \n    // Allocate reused shared memeory\n    { }\n    \n    __local unsigned char *local_mem_234314;\n    \n    local_mem_234314 = (__local unsigned char *) local_mem_234314_backing_0;\n    \n    int64_t trans_arr_len_234315 = (int64_t) 11 * segscan_group_sizze_218677;\n    int32_t dynamic_id_234321;\n    \n    if (local_tid_234306 == 0) {\n        dynamic_id_234321 = atomic_add_i32_global(&((volatile __global\n                                                     int *) mainziid_counter_mem_234297)[(int64_t) 0],\n                                                  (int) 1);\n        ((__local int32_t *) local_mem_234314)[(int64_t) 0] = dynamic_id_234321;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    dynamic_id_234321 = ((__local int32_t *) local_mem_234314)[(int64_t) 0];\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t blockOff_234322 = sext_i32_i64(dynamic_id_234321) * (int64_t) 11 *\n            segscan_group_sizze_218677;\n    int64_t sgm_idx_234323 = smod64(blockOff_234322,\n                                    lifted_single_ma_l_arg_204134);\n    int32_t boundary_234324 = sext_i64_i32(smin64((int64_t) 11 *\n                                                  segscan_group_sizze_218677,\n                                                  lifted_single_ma_l_arg_204134 -\n                                                  sgm_idx_234323));\n    int32_t segsizze_compact_234325 = sext_i64_i32(smin64((int64_t) 11 *\n                                                          segscan_group_sizze_218677,\n                                                          lifted_single_ma_l_arg_204134));\n    double private_mem_234326[(int64_t) 11];\n    \n    // Load a",
            "nd map\n    {\n        for (int64_t i_234328 = 0; i_234328 < (int64_t) 11; i_234328++) {\n            int64_t phys_tid_234329 = blockOff_234322 +\n                    sext_i32_i64(local_tid_234306) + i_234328 *\n                    segscan_group_sizze_218677;\n            int64_t slice_234330 = lifted_single_ma_l_arg_204134;\n            int64_t slice_234331 = partition_sizze_203577 * slice_234330;\n            int64_t gtid_218681 = squot64(phys_tid_234329, slice_234330);\n            int64_t remnant_234332 = phys_tid_234329 - gtid_218681 *\n                    slice_234330;\n            int64_t gtid_218682 = remnant_234332;\n            int64_t remnant_234333 = remnant_234332 - gtid_218682;\n            \n            if (slt64(phys_tid_234329, partition_sizze_203577 *\n                      lifted_single_ma_l_arg_204134)) {\n                bool cond_218690 = gtid_218682 == (int64_t) 0;\n                double defunc_0_f_res_218691;\n                \n                if (cond_218690) {\n                    double x_218688;\n                    \n                    x_218688 = ((__global\n                                 double *) ext_mem_230512)[gtid_218681];\n                    \n                    double defunc_0_f_res_t_res_218692 = x_218688 /\n                           i64_res_203507;\n                    \n                    defunc_0_f_res_218691 = defunc_0_f_res_t_res_218692;\n                } else {\n                    int64_t x_218693 = add64(n_p_203492, gtid_218682);\n                    int64_t i_218694 = sub64(x_218693, (int64_t) 1);\n                    bool x_218695 = sle64((int64_t) 0, i_218694);\n                    bool y_218696 = slt64(i_218694, C_len_203634);\n                    bool bounds_check_218697 = x_218695 && y_218696;\n                    bool index_certs_218698;\n                    \n                    if (!bounds_check_218697) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                 ",
            "                         44) == -1) {\n                                global_failure_args[0] = (int64_t) i_218694;\n                                global_failure_args[1] = (int64_t) C_len_203634;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    double x_218699;\n                    \n                    x_218699 = ((__global double *) mem_230500)[gtid_218681 *\n                                                                C_len_203634 +\n                                                                i_218694];\n                    \n                    int64_t i_218700 = sub64(gtid_218682, (int64_t) 1);\n                    bool x_218701 = sle64((int64_t) 0, i_218700);\n                    bool y_218702 = slt64(i_218700, C_len_203634);\n                    bool bounds_check_218703 = x_218701 && y_218702;\n                    bool index_certs_218704;\n                    \n                    if (!bounds_check_218703) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          45) == -1) {\n                                global_failure_args[0] = (int64_t) i_218700;\n                                global_failure_args[1] = (int64_t) C_len_203634;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    double y_218705;\n                    \n                    y_218705 = ((__global double *) mem_230500)[gtid_218681 *\n                                                                C_len_203634 +\n                                                                i_218700];\n                    \n           ",
            "         double x_218706 = x_218699 - y_218705;\n                    double defunc_0_f_res_f_res_218707 = x_218706 /\n                           i64_res_203507;\n                    \n                    defunc_0_f_res_218691 = defunc_0_f_res_f_res_218707;\n                }\n                private_mem_234326[i_234328] = defunc_0_f_res_218691;\n            } else {\n                private_mem_234326[i_234328] = 0.0;\n            }\n        }\n    }\n    // Transpose scan inputs\n    {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_234334 = 0; i_234334 < (int64_t) 11; i_234334++) {\n            int64_t sharedIdx_234335 = sext_i32_i64(local_tid_234306) +\n                    i_234334 * segscan_group_sizze_218677;\n            double tmp_234336;\n            \n            tmp_234336 = private_mem_234326[i_234334];\n            ((__local double *) local_mem_234314)[sharedIdx_234335] =\n                tmp_234336;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int32_t i_234337 = 0; i_234337 < 11; i_234337++) {\n            int32_t sharedIdx_234338 = local_tid_234306 * 11 + i_234337;\n            double tmp_234339;\n            \n            tmp_234339 = ((__local\n                           double *) local_mem_234314)[sext_i32_i64(sharedIdx_234338)];\n            private_mem_234326[sext_i32_i64(i_234337)] = tmp_234339;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    // Per thread scan\n    {\n        int32_t gidx_234340 = local_tid_234306 * 11 + 1;\n        \n        for (int64_t i_234341 = 0; i_234341 < (int64_t) 10; i_234341++) {\n            bool new_sgm_234342 = smod32(gidx_234340 + sext_i64_i32(i_234341) -\n                                         boundary_234324,\n                                         segsizze_compact_234325) == 0;\n            \n            if (!new_sgm_234342) {\n                double x_218684;\n                double x_218685;\n                \n                x_218684 = private_mem_234326[i_234341];\n                x_218685 = private_mem_",
            "234326[i_234341 + (int64_t) 1];\n                \n                double defunc_1_op_res_218686 = x_218684 + x_218685;\n                \n                private_mem_234326[i_234341 + (int64_t) 1] =\n                    defunc_1_op_res_218686;\n            }\n        }\n    }\n    // Publish results in shared memory\n    {\n        double tmp_234343;\n        \n        tmp_234343 = private_mem_234326[(int64_t) 10];\n        ((__local double *) local_mem_234314)[squot64(byte_offsets_234310,\n                                                      (int64_t) 8) +\n                                              sext_i32_i64(local_tid_234306)] =\n            tmp_234343;\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    \n    double acc_234347;\n    \n    // Scan results (with warp scan)\n    {\n        double x_234344;\n        double x_234345;\n        double x_234348;\n        double x_234349;\n        bool ltid_in_bounds_234351 = slt64(sext_i32_i64(local_tid_234306),\n                                           segscan_group_sizze_218677);\n        int32_t skip_threads_234352;\n        \n        // read input for in-block scan\n        {\n            if (ltid_in_bounds_234351) {\n                x_234345 = ((volatile __local\n                             double *) local_mem_234314)[squot64(byte_offsets_234310,\n                                                                 (int64_t) 8) +\n                                                         sext_i32_i64(local_tid_234306)];\n                if ((local_tid_234306 - squot32(local_tid_234306, 32) * 32) ==\n                    0) {\n                    x_234344 = x_234345;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_234352 = 1;\n            while (slt32(skip_threads_234352, 32)) {\n                bool thread_active_234353 = sle32(skip_threads_234352,\n                                                  local_tid_234306 -\n                                                  squot3",
            "2(local_tid_234306,\n                                                          32) * 32) &&\n                     ltid_in_bounds_234351;\n                \n                if (thread_active_234353) {\n                    // read operands\n                    {\n                        x_234344 = ((volatile __local\n                                     double *) local_mem_234314)[squot64(byte_offsets_234310,\n                                                                         (int64_t) 8) +\n                                                                 (sext_i32_i64(local_tid_234306) -\n                                                                  sext_i32_i64(skip_threads_234352))];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_234354 = slt32(smod32((local_tid_234306 + 1) *\n                                                        11 - 1 +\n                                                        segsizze_compact_234325 -\n                                                        boundary_234324,\n                                                        segsizze_compact_234325),\n                                                 (local_tid_234306 + 1) * 11 -\n                                                 1 - ((local_tid_234306 -\n                                                       skip_threads_234352 +\n                                                       1) * 11 - 1));\n                    \n                    if (thread_active_234353 && inactive_234354) {\n                        x_234344 = x_234345;\n                    }\n                    if (thread_active_234353) {\n                        if (!inactive_234354) {\n                            double defunc_1_op_res_234346 = x_234344 + x_234345;\n                            \n                            x_234344 = defunc_1_op_res_234346;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_23",
            "4308, skip_threads_234352)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_234353) {\n                    // write result\n                    {\n                        ((volatile __local\n                          double *) local_mem_234314)[squot64(byte_offsets_234310,\n                                                              (int64_t) 8) +\n                                                      sext_i32_i64(local_tid_234306)] =\n                            x_234344;\n                        x_234345 = x_234344;\n                    }\n                }\n                if (sle32(wave_sizze_234308, skip_threads_234352)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_234352 *= 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_234306 - squot32(local_tid_234306, 32) * 32) == 31 &&\n                ltid_in_bounds_234351) {\n                ((volatile __local\n                  double *) local_mem_234314)[squot64(byte_offsets_234310,\n                                                      (int64_t) 8) +\n                                              sext_i32_i64(squot32(local_tid_234306,\n                                                                   32))] =\n                    x_234344;\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_234355;\n            \n            // read input for in-block scan\n            {\n                if (squot32(local_tid_234306, 32) == 0 &&\n                    ltid_in_bounds_234351) {\n                    x_234349 = ((volatile __local\n                                 double *) local_mem_234314)[squot64(byte_offsets_234310,\n                                                           ",
            "          (int64_t) 8) +\n                                                             sext_i32_i64(local_tid_234306)];\n                    if ((local_tid_234306 - squot32(local_tid_234306, 32) *\n                         32) == 0) {\n                        x_234348 = x_234349;\n                    }\n                }\n            }\n            // in-block scan (hopefully no barriers needed)\n            {\n                skip_threads_234355 = 1;\n                while (slt32(skip_threads_234355, 32)) {\n                    bool thread_active_234356 = sle32(skip_threads_234355,\n                                                      local_tid_234306 -\n                                                      squot32(local_tid_234306,\n                                                              32) * 32) &&\n                         (squot32(local_tid_234306, 32) == 0 &&\n                          ltid_in_bounds_234351);\n                    \n                    if (thread_active_234356) {\n                        // read operands\n                        {\n                            x_234348 = ((volatile __local\n                                         double *) local_mem_234314)[squot64(byte_offsets_234310,\n                                                                             (int64_t) 8) +\n                                                                     (sext_i32_i64(local_tid_234306) -\n                                                                      sext_i32_i64(skip_threads_234355))];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_234357 = slt32(smod32((local_tid_234306 *\n                                                             32 + 32 - 1 + 1) *\n                                                            11 - 1 +\n                                                            segsizze_compact_234325 -\n                                                            ",
            "boundary_234324,\n                                                            segsizze_compact_234325),\n                                                     (local_tid_234306 * 32 +\n                                                      32 - 1 + 1) * 11 - 1 -\n                                                     (((local_tid_234306 -\n                                                        skip_threads_234355) *\n                                                       32 + 32 - 1 + 1) * 11 -\n                                                      1));\n                        \n                        if (thread_active_234356 && inactive_234357) {\n                            x_234348 = x_234349;\n                        }\n                        if (thread_active_234356) {\n                            if (!inactive_234357) {\n                                double defunc_1_op_res_234350 = x_234348 +\n                                       x_234349;\n                                \n                                x_234348 = defunc_1_op_res_234350;\n                            }\n                        }\n                    }\n                    if (sle32(wave_sizze_234308, skip_threads_234355)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    if (thread_active_234356) {\n                        // write result\n                        {\n                            ((volatile __local\n                              double *) local_mem_234314)[squot64(byte_offsets_234310,\n                                                                  (int64_t) 8) +\n                                                          sext_i32_i64(local_tid_234306)] =\n                                x_234348;\n                            x_234349 = x_234348;\n                        }\n                    }\n                    if (sle32(wave_sizze_234308, skip_threads_234355)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n               ",
            "     skip_threads_234355 *= 2;\n                }\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        bool no_carry_in_234358 = squot32(local_tid_234306, 32) == 0 ||\n             !ltid_in_bounds_234351;\n        \n        // carry-in for every block except the first\n        {\n            // read operands\n            {\n                if (!no_carry_in_234358) {\n                    x_234345 = x_234344;\n                    x_234344 = ((__local\n                                 double *) local_mem_234314)[squot64(byte_offsets_234310,\n                                                                     (int64_t) 8) +\n                                                             (sext_i32_i64(squot32(local_tid_234306,\n                                                                                   32)) -\n                                                              (int64_t) 1)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_234359 = slt32(smod32((local_tid_234306 + 1) *\n                                                    11 - 1 +\n                                                    segsizze_compact_234325 -\n                                                    boundary_234324,\n                                                    segsizze_compact_234325),\n                                             (local_tid_234306 + 1) * 11 - 1 -\n                                             ((squot32(local_tid_234306, 32) *\n                                               32 - 1 + 1) * 11 - 1));\n                \n                if (!no_carry_in_234358) {\n                    if (inactive_234359) {\n                        x_234344 = x_234345;\n                    }\n                }\n                if (!no_carry_in_234358) {\n                    if (!inactive_234359) {\n                        double defunc_1_op_res_234346 = x_234344 + x_234345;\n                        \n                        x_234344 = defunc",
            "_1_op_res_234346;\n                    }\n                }\n            }\n            // write final result\n            {\n                if (!no_carry_in_234358) {\n                    ((__local\n                      double *) local_mem_234314)[squot64(byte_offsets_234310,\n                                                          (int64_t) 8) +\n                                                  sext_i32_i64(local_tid_234306)] =\n                        x_234344;\n                }\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // restore correct values for first block\n        {\n            if (squot32(local_tid_234306, 32) == 0 && ltid_in_bounds_234351) {\n                ((__local\n                  double *) local_mem_234314)[squot64(byte_offsets_234310,\n                                                      (int64_t) 8) +\n                                              sext_i32_i64(local_tid_234306)] =\n                    x_234345;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (local_tid_234306 == 0) {\n            acc_234347 = ((__local\n                           double *) local_mem_234314)[squot64(byte_offsets_234310,\n                                                               (int64_t) 8) +\n                                                       (segscan_group_sizze_218677 -\n                                                        (int64_t) 1)];\n        } else {\n            acc_234347 = ((__local\n                           double *) local_mem_234314)[squot64(byte_offsets_234310,\n                                                               (int64_t) 8) +\n                                                       (sext_i32_i64(local_tid_234306) -\n                                                        (int64_t) 1)];\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    \n    double prefix_234360 = 0.0;\n    bool block_new_sgm_234361 = sgm_idx_234323 == (int64_t) 0;\n    \n    // Perform ",
            "lookback\n    {\n        if (block_new_sgm_234361 && local_tid_234306 == 0) {\n            ((volatile __global\n              double *) incprefixes_mem_234303)[dynamic_id_234321] = acc_234347;\n            mem_fence_global();\n            ((volatile __global\n              int8_t *) status_flags_mem_234299)[dynamic_id_234321] =\n                (int8_t) 2;\n            acc_234347 = 0.0;\n        }\n        if (!block_new_sgm_234361 && slt32(local_tid_234306,\n                                           wave_sizze_234308)) {\n            if (local_tid_234306 == 0) {\n                if (boundary_234324 == sext_i64_i32(segscan_group_sizze_218677 *\n                    (int64_t) 11)) {\n                    ((volatile __global\n                      double *) aggregates_mem_234301)[dynamic_id_234321] =\n                        acc_234347;\n                    mem_fence_global();\n                    ((volatile __global\n                      int8_t *) status_flags_mem_234299)[dynamic_id_234321] =\n                        (int8_t) 1;\n                } else {\n                    ((volatile __global\n                      double *) incprefixes_mem_234303)[dynamic_id_234321] =\n                        acc_234347;\n                    mem_fence_global();\n                    ((volatile __global\n                      int8_t *) status_flags_mem_234299)[dynamic_id_234321] =\n                        (int8_t) 2;\n                }\n                \n                int8_t tmp_234362;\n                \n                tmp_234362 = ((volatile __global\n                               int8_t *) status_flags_mem_234299)[dynamic_id_234321 -\n                                                                  (int64_t) 1];\n                ((volatile __local int8_t *) local_mem_234314)[(int64_t) 0] =\n                    tmp_234362;\n            }\n            mem_fence_local();\n            \n            int8_t status_234363;\n            \n            status_234363 = ((__local int8_t *) local_mem_234314)[(int64_t) 0];\n         ",
            "   if (status_234363 == (int8_t) 2) {\n                if (local_tid_234306 == 0) {\n                    prefix_234360 = ((volatile __global\n                                      double *) incprefixes_mem_234303)[dynamic_id_234321 -\n                                                                        (int64_t) 1];\n                }\n            } else {\n                int32_t readOffset_234364 = dynamic_id_234321 -\n                        sext_i32_i64(wave_sizze_234308);\n                \n                while (slt32(wave_sizze_234308 * -1, readOffset_234364)) {\n                    int32_t read_i_234365 = readOffset_234364 +\n                            local_tid_234306;\n                    double aggr_234366 = 0.0;\n                    int8_t flag_234367 = (int8_t) 0;\n                    \n                    if (sle32(0, read_i_234365)) {\n                        if (sle64(blockOff_234322 -\n                                  (sext_i32_i64(read_i_234365 + 1) *\n                                   segscan_group_sizze_218677 * (int64_t) 11 -\n                                   (int64_t) 1), sgm_idx_234323)) {\n                            flag_234367 = ((volatile __global\n                                            int8_t *) status_flags_mem_234299)[sext_i32_i64(read_i_234365)];\n                            if (flag_234367 == (int8_t) 2) {\n                                aggr_234366 = ((volatile __global\n                                                double *) incprefixes_mem_234303)[sext_i32_i64(read_i_234365)];\n                            } else {\n                                if (flag_234367 == (int8_t) 1) {\n                                    aggr_234366 = ((volatile __global\n                                                    double *) aggregates_mem_234301)[sext_i32_i64(read_i_234365)];\n                                }\n                            }\n                        } else {\n                            flag_234367 = (int8_t) 2;\n                        }\n        ",
            "            }\n                    ((__local\n                      double *) local_mem_234314)[squot64(warp_byte_offset_234312,\n                                                          (int64_t) 8) +\n                                                  sext_i32_i64(local_tid_234306)] =\n                        aggr_234366;\n                    ((__local\n                      int8_t *) local_mem_234314)[sext_i32_i64(local_tid_234306)] =\n                        flag_234367;\n                    flag_234367 = ((__local\n                                    int8_t *) local_mem_234314)[sext_i32_i64(wave_sizze_234308) -\n                                                                (int64_t) 1];\n                    if (slt8(flag_234367, (int8_t) 2)) {\n                        int8_t flg_x_234371;\n                        int8_t flg_y_234372;\n                        double x_234368;\n                        double x_234369;\n                        int32_t skip_threads_234373;\n                        \n                        // read input for in-block scan\n                        {\n                            flg_y_234372 = ((volatile __local\n                                             int8_t *) local_mem_234314)[sext_i32_i64(local_tid_234306)];\n                            x_234369 = ((volatile __local\n                                         double *) local_mem_234314)[squot64(warp_byte_offset_234312,\n                                                                             (int64_t) 8) +\n                                                                     sext_i32_i64(local_tid_234306)];\n                            if ((local_tid_234306 - squot32(local_tid_234306,\n                                                            32) * 32) == 0) {\n                                x_234368 = x_234369;\n                                flg_x_234371 = flg_y_234372;\n                            }\n                        }\n                        // in-block scan (hopefully no barriers needed)",
            "\n                        {\n                            skip_threads_234373 = 1;\n                            while (slt32(skip_threads_234373, 32)) {\n                                if (sle32(skip_threads_234373,\n                                          local_tid_234306 -\n                                          squot32(local_tid_234306, 32) * 32)) {\n                                    // read operands\n                                    {\n                                        flg_x_234371 = ((volatile __local\n                                                         int8_t *) local_mem_234314)[sext_i32_i64(local_tid_234306) -\n                                                                                     sext_i32_i64(skip_threads_234373)];\n                                        x_234368 = ((volatile __local\n                                                     double *) local_mem_234314)[squot64(warp_byte_offset_234312,\n                                                                                         (int64_t) 8) +\n                                                                                 (sext_i32_i64(local_tid_234306) -\n                                                                                  sext_i32_i64(skip_threads_234373))];\n                                    }\n                                    // perform operation\n                                    {\n                                        if (flg_y_234372 == (int8_t) 2 ||\n                                            flg_y_234372 == (int8_t) 0) {\n                                            flg_x_234371 = flg_y_234372;\n                                            x_234368 = x_234369;\n                                        } else {\n                                            double defunc_1_op_res_234370 =\n                                                   x_234368 + x_234369;\n                                            \n                                            x_234368 = defu",
            "nc_1_op_res_234370;\n                                        }\n                                    }\n                                    // write result\n                                    {\n                                        ((volatile __local\n                                          int8_t *) local_mem_234314)[sext_i32_i64(local_tid_234306)] =\n                                            flg_x_234371;\n                                        flg_y_234372 = flg_x_234371;\n                                        ((volatile __local\n                                          double *) local_mem_234314)[squot64(warp_byte_offset_234312,\n                                                                              (int64_t) 8) +\n                                                                      sext_i32_i64(local_tid_234306)] =\n                                            x_234368;\n                                        x_234369 = x_234368;\n                                    }\n                                }\n                                skip_threads_234373 *= 2;\n                            }\n                        }\n                    }\n                    flag_234367 = ((__local\n                                    int8_t *) local_mem_234314)[sext_i32_i64(wave_sizze_234308) -\n                                                                (int64_t) 1];\n                    aggr_234366 = ((__local\n                                    double *) local_mem_234314)[squot64(warp_byte_offset_234312,\n                                                                        (int64_t) 8) +\n                                                                (sext_i32_i64(wave_sizze_234308) -\n                                                                 (int64_t) 1)];\n                    if (flag_234367 == (int8_t) 2) {\n                        readOffset_234364 = wave_sizze_234308 * -1;\n                    } else {\n                        if (flag_234367 == (int8_t) 1) {\n    ",
            "                        readOffset_234364 -= wave_sizze_234308;\n                        }\n                    }\n                    if (slt8((int8_t) 0, flag_234367)) {\n                        double x_234374 = aggr_234366;\n                        double x_234375 = prefix_234360;\n                        double defunc_1_op_res_234376 = x_234374 + x_234375;\n                        \n                        prefix_234360 = defunc_1_op_res_234376;\n                    }\n                    mem_fence_local();\n                }\n            }\n            if (local_tid_234306 == 0) {\n                if (boundary_234324 == sext_i64_i32(segscan_group_sizze_218677 *\n                    (int64_t) 11)) {\n                    double x_234377 = prefix_234360;\n                    double x_234378 = acc_234347;\n                    double defunc_1_op_res_234379 = x_234377 + x_234378;\n                    \n                    ((volatile __global\n                      double *) incprefixes_mem_234303)[dynamic_id_234321] =\n                        defunc_1_op_res_234379;\n                    mem_fence_global();\n                    ((volatile __global\n                      int8_t *) status_flags_mem_234299)[dynamic_id_234321] =\n                        (int8_t) 2;\n                }\n                ((__local\n                  double *) local_mem_234314)[squot64(warp_byte_offset_234312,\n                                                      (int64_t) 8)] =\n                    prefix_234360;\n                acc_234347 = 0.0;\n            }\n        }\n        if (!(dynamic_id_234321 == (int64_t) 0)) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            prefix_234360 = ((__local\n                              double *) local_mem_234314)[squot64(warp_byte_offset_234312,\n                                                                  (int64_t) 8)];\n            barrier(CLK_LOCAL_MEM_FENCE);\n        }\n    }\n    // Distribute results\n    {\n        double x_234380;\n        double x_234381;\n        double x",
            "_234383 = prefix_234360;\n        double x_234384 = acc_234347;\n        \n        if (slt32(local_tid_234306 * 11, boundary_234324) &&\n            !block_new_sgm_234361) {\n            double defunc_1_op_res_234385 = x_234383 + x_234384;\n            \n            x_234380 = defunc_1_op_res_234385;\n        } else {\n            x_234380 = acc_234347;\n        }\n        \n        int32_t stopping_point_234386 = segsizze_compact_234325 -\n                srem32(local_tid_234306 * 11 - 1 + segsizze_compact_234325 -\n                       boundary_234324, segsizze_compact_234325);\n        \n        for (int64_t i_234387 = 0; i_234387 < (int64_t) 11; i_234387++) {\n            if (slt32(sext_i64_i32(i_234387), stopping_point_234386 - 1)) {\n                x_234381 = private_mem_234326[i_234387];\n                \n                double defunc_1_op_res_234382 = x_234380 + x_234381;\n                \n                private_mem_234326[i_234387] = defunc_1_op_res_234382;\n            }\n        }\n    }\n    // Transpose scan output and Write it to global memory in coalesced fashion\n    {\n        for (int64_t i_234388 = 0; i_234388 < (int64_t) 11; i_234388++) {\n            int64_t sharedIdx_234389 = sext_i32_i64(local_tid_234306 * 11) +\n                    i_234388;\n            double tmp_234390;\n            \n            tmp_234390 = private_mem_234326[i_234388];\n            ((__local double *) local_mem_234314)[sharedIdx_234389] =\n                tmp_234390;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_234391 = 0; i_234391 < (int64_t) 11; i_234391++) {\n            int64_t flat_idx_234392 = blockOff_234322 +\n                    segscan_group_sizze_218677 * i_234391 +\n                    sext_i32_i64(local_tid_234306);\n            int64_t slice_234393 = lifted_single_ma_l_arg_204134;\n            int64_t slice_234394 = partition_sizze_203577 * slice_234393;\n            int64_t gtid_218681 = squot64(flat_idx_234392, slice_234393);\n            int64_t remnant_234395 = ",
            "flat_idx_234392 - gtid_218681 *\n                    slice_234393;\n            int64_t gtid_218682 = remnant_234395;\n            int64_t remnant_234396 = remnant_234395 - gtid_218682;\n            \n            if (slt64(flat_idx_234392, partition_sizze_203577 *\n                      lifted_single_ma_l_arg_204134)) {\n                double tmp_234397;\n                \n                tmp_234397 = ((__local\n                               double *) local_mem_234314)[flat_idx_234392 -\n                                                           blockOff_234322];\n                ((__global double *) mem_230517)[gtid_218681 *\n                                                 lifted_single_ma_l_arg_204134 +\n                                                 gtid_218682] = tmp_234397;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    // If this is the last block, reset the dynamicId\n    {\n        if (dynamic_id_234321 == sdiv_up64(partition_sizze_203577 *\n                                           lifted_single_ma_l_arg_204134,\n                                           segscan_group_sizze_218677 *\n                                           (int64_t) 11) - (int64_t) 1) {\n            ((__global int32_t *) mainziid_counter_mem_234297)[(int64_t) 0] = 0;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_218677\n}\n__kernel void mainzisegscan_218814(__global int *global_failure,\n                                   int failure_is_an_option, __global\n                                   int64_t *global_failure_args,\n                                   uint local_mem_234495_backing_offset_0,\n                                   int64_t n_p_203492, double i64_res_203507,\n                                   int64_t partition_sizze_203577,\n                                   int64_t lifted_single_ma_l_arg_204134,\n                                   int64_t dyn_lifted_single_ma_l_arg_204144,\n                                   __global unsigned char *mem_230",
            "517, __global\n                                   unsigned char *ext_mem_230529, __global\n                                   unsigned char *mem_230534, __global\n                                   unsigned char *mainziid_counter_mem_234478,\n                                   __global\n                                   unsigned char *status_flags_mem_234480,\n                                   __global\n                                   unsigned char *aggregates_mem_234482,\n                                   __global\n                                   unsigned char *incprefixes_mem_234484)\n{\n    #define segscan_group_sizze_218808 (mainzisegscan_group_sizze_218772)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *local_mem_234495_backing_0 =\n                           &shared_mem[local_mem_234495_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_234486;\n    int32_t local_tid_234487;\n    int64_t group_sizze_234490;\n    int32_t wave_sizze_234489;\n    int32_t group_tid_234488;\n    \n    global_tid_234486 = get_global_id(0);\n    local_tid_234487 = get_local_id(0);\n    group_sizze_234490 = get_local_size(0);\n    wave_sizze_234489 = LOCKSTEP_WIDTH;\n    group_tid_234488 = get_group_id(0);\n    \n    int32_t phys_tid_218814 = global_tid_234486;\n    int64_t byte_offsets_234491 = (int64_t) 0;\n    int64_t byte_offsets_234492 = segscan_group_sizze_218808 * (int64_t) 8;\n    int64_t warp_byte_offset_234493 = (int64_t) 32;\n    int64_t warp_byte_offset_234494 = (int64_t) 288;\n    \n    // Allocate reused shared memeory\n    { }\n    \n    __local unsigned char *local_mem_234495;\n    \n    local_mem_234495 = (__local unsigned char *) local_mem_234495_backing_0;\n    \n    int64_t trans_arr_len_2",
            "34496 = (int64_t) 11 * segscan_group_sizze_218808;\n    int32_t dynamic_id_234502;\n    \n    if (local_tid_234487 == 0) {\n        dynamic_id_234502 = atomic_add_i32_global(&((volatile __global\n                                                     int *) mainziid_counter_mem_234478)[(int64_t) 0],\n                                                  (int) 1);\n        ((__local int32_t *) local_mem_234495)[(int64_t) 0] = dynamic_id_234502;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    dynamic_id_234502 = ((__local int32_t *) local_mem_234495)[(int64_t) 0];\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t blockOff_234503 = sext_i32_i64(dynamic_id_234502) * (int64_t) 11 *\n            segscan_group_sizze_218808;\n    int64_t sgm_idx_234504 = smod64(blockOff_234503,\n                                    dyn_lifted_single_ma_l_arg_204144);\n    int32_t boundary_234505 = sext_i64_i32(smin64((int64_t) 11 *\n                                                  segscan_group_sizze_218808,\n                                                  dyn_lifted_single_ma_l_arg_204144 -\n                                                  sgm_idx_234504));\n    int32_t segsizze_compact_234506 = sext_i64_i32(smin64((int64_t) 11 *\n                                                          segscan_group_sizze_218808,\n                                                          dyn_lifted_single_ma_l_arg_204144));\n    double private_mem_234507[(int64_t) 11];\n    \n    // Load and map\n    {\n        for (int64_t i_234509 = 0; i_234509 < (int64_t) 11; i_234509++) {\n            int64_t phys_tid_234510 = blockOff_234503 +\n                    sext_i32_i64(local_tid_234487) + i_234509 *\n                    segscan_group_sizze_218808;\n            int64_t slice_234511 = dyn_lifted_single_ma_l_arg_204144;\n            int64_t slice_234512 = partition_sizze_203577 * slice_234511;\n            int64_t gtid_218812 = squot64(phys_tid_234510, slice_234511);\n            int64_t remnant_234513 = phys_tid_234510 - gtid_218812 *\n         ",
            "           slice_234511;\n            int64_t gtid_218813 = remnant_234513;\n            int64_t remnant_234514 = remnant_234513 - gtid_218813;\n            \n            if (slt64(phys_tid_234510, partition_sizze_203577 *\n                      dyn_lifted_single_ma_l_arg_204144)) {\n                bool cond_218821 = gtid_218813 == (int64_t) 0;\n                double defunc_0_f_res_218822;\n                \n                if (cond_218821) {\n                    double x_218819;\n                    \n                    x_218819 = ((__global\n                                 double *) ext_mem_230529)[gtid_218812];\n                    \n                    double defunc_0_f_res_t_res_218823 = x_218819 /\n                           i64_res_203507;\n                    \n                    defunc_0_f_res_218822 = defunc_0_f_res_t_res_218823;\n                } else {\n                    int64_t x_218824 = add64(n_p_203492, gtid_218813);\n                    int64_t i_218825 = sub64(x_218824, (int64_t) 1);\n                    bool x_218826 = sle64((int64_t) 0, i_218825);\n                    bool y_218827 = slt64(i_218825,\n                                          lifted_single_ma_l_arg_204134);\n                    bool bounds_check_218828 = x_218826 && y_218827;\n                    bool index_certs_218829;\n                    \n                    if (!bounds_check_218828) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          46) == -1) {\n                                global_failure_args[0] = (int64_t) i_218825;\n                                global_failure_args[1] =\n                                    (int64_t) lifted_single_ma_l_arg_204134;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n          ",
            "          double x_218830;\n                    \n                    x_218830 = ((__global double *) mem_230517)[gtid_218812 *\n                                                                lifted_single_ma_l_arg_204134 +\n                                                                i_218825];\n                    \n                    int64_t i_218831 = sub64(gtid_218813, (int64_t) 1);\n                    bool x_218832 = sle64((int64_t) 0, i_218831);\n                    bool y_218833 = slt64(i_218831,\n                                          lifted_single_ma_l_arg_204134);\n                    bool bounds_check_218834 = x_218832 && y_218833;\n                    bool index_certs_218835;\n                    \n                    if (!bounds_check_218834) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          47) == -1) {\n                                global_failure_args[0] = (int64_t) i_218831;\n                                global_failure_args[1] =\n                                    (int64_t) lifted_single_ma_l_arg_204134;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    double y_218836;\n                    \n                    y_218836 = ((__global double *) mem_230517)[gtid_218812 *\n                                                                lifted_single_ma_l_arg_204134 +\n                                                                i_218831];\n                    \n                    double x_218837 = x_218830 - y_218836;\n                    double defunc_0_f_res_f_res_218838 = x_218837 /\n                           i64_res_203507;\n                    \n                    defunc_0_f_res_218822 = defunc_0_f_res_f_res_218838;\n                }\n              ",
            "  private_mem_234507[i_234509] = defunc_0_f_res_218822;\n            } else {\n                private_mem_234507[i_234509] = 0.0;\n            }\n        }\n    }\n    // Transpose scan inputs\n    {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_234515 = 0; i_234515 < (int64_t) 11; i_234515++) {\n            int64_t sharedIdx_234516 = sext_i32_i64(local_tid_234487) +\n                    i_234515 * segscan_group_sizze_218808;\n            double tmp_234517;\n            \n            tmp_234517 = private_mem_234507[i_234515];\n            ((__local double *) local_mem_234495)[sharedIdx_234516] =\n                tmp_234517;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int32_t i_234518 = 0; i_234518 < 11; i_234518++) {\n            int32_t sharedIdx_234519 = local_tid_234487 * 11 + i_234518;\n            double tmp_234520;\n            \n            tmp_234520 = ((__local\n                           double *) local_mem_234495)[sext_i32_i64(sharedIdx_234519)];\n            private_mem_234507[sext_i32_i64(i_234518)] = tmp_234520;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    // Per thread scan\n    {\n        int32_t gidx_234521 = local_tid_234487 * 11 + 1;\n        \n        for (int64_t i_234522 = 0; i_234522 < (int64_t) 10; i_234522++) {\n            bool new_sgm_234523 = smod32(gidx_234521 + sext_i64_i32(i_234522) -\n                                         boundary_234505,\n                                         segsizze_compact_234506) == 0;\n            \n            if (!new_sgm_234523) {\n                double x_218815;\n                double x_218816;\n                \n                x_218815 = private_mem_234507[i_234522];\n                x_218816 = private_mem_234507[i_234522 + (int64_t) 1];\n                \n                double defunc_1_op_res_218817 = x_218815 + x_218816;\n                \n                private_mem_234507[i_234522 + (int64_t) 1] =\n                    defunc_1_op_res_218817;\n            }\n        }\n    }\n    // Publish ",
            "results in shared memory\n    {\n        double tmp_234524;\n        \n        tmp_234524 = private_mem_234507[(int64_t) 10];\n        ((__local double *) local_mem_234495)[squot64(byte_offsets_234491,\n                                                      (int64_t) 8) +\n                                              sext_i32_i64(local_tid_234487)] =\n            tmp_234524;\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    \n    double acc_234528;\n    \n    // Scan results (with warp scan)\n    {\n        double x_234525;\n        double x_234526;\n        double x_234529;\n        double x_234530;\n        bool ltid_in_bounds_234532 = slt64(sext_i32_i64(local_tid_234487),\n                                           segscan_group_sizze_218808);\n        int32_t skip_threads_234533;\n        \n        // read input for in-block scan\n        {\n            if (ltid_in_bounds_234532) {\n                x_234526 = ((volatile __local\n                             double *) local_mem_234495)[squot64(byte_offsets_234491,\n                                                                 (int64_t) 8) +\n                                                         sext_i32_i64(local_tid_234487)];\n                if ((local_tid_234487 - squot32(local_tid_234487, 32) * 32) ==\n                    0) {\n                    x_234525 = x_234526;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_234533 = 1;\n            while (slt32(skip_threads_234533, 32)) {\n                bool thread_active_234534 = sle32(skip_threads_234533,\n                                                  local_tid_234487 -\n                                                  squot32(local_tid_234487,\n                                                          32) * 32) &&\n                     ltid_in_bounds_234532;\n                \n                if (thread_active_234534) {\n                    // read operands\n                    {\n                        x_2345",
            "25 = ((volatile __local\n                                     double *) local_mem_234495)[squot64(byte_offsets_234491,\n                                                                         (int64_t) 8) +\n                                                                 (sext_i32_i64(local_tid_234487) -\n                                                                  sext_i32_i64(skip_threads_234533))];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_234535 = slt32(smod32((local_tid_234487 + 1) *\n                                                        11 - 1 +\n                                                        segsizze_compact_234506 -\n                                                        boundary_234505,\n                                                        segsizze_compact_234506),\n                                                 (local_tid_234487 + 1) * 11 -\n                                                 1 - ((local_tid_234487 -\n                                                       skip_threads_234533 +\n                                                       1) * 11 - 1));\n                    \n                    if (thread_active_234534 && inactive_234535) {\n                        x_234525 = x_234526;\n                    }\n                    if (thread_active_234534) {\n                        if (!inactive_234535) {\n                            double defunc_1_op_res_234527 = x_234525 + x_234526;\n                            \n                            x_234525 = defunc_1_op_res_234527;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_234489, skip_threads_234533)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_234534) {\n                    // write result\n                    {\n                        ((volatile __local\n                          double *) local_",
            "mem_234495)[squot64(byte_offsets_234491,\n                                                              (int64_t) 8) +\n                                                      sext_i32_i64(local_tid_234487)] =\n                            x_234525;\n                        x_234526 = x_234525;\n                    }\n                }\n                if (sle32(wave_sizze_234489, skip_threads_234533)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_234533 *= 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_234487 - squot32(local_tid_234487, 32) * 32) == 31 &&\n                ltid_in_bounds_234532) {\n                ((volatile __local\n                  double *) local_mem_234495)[squot64(byte_offsets_234491,\n                                                      (int64_t) 8) +\n                                              sext_i32_i64(squot32(local_tid_234487,\n                                                                   32))] =\n                    x_234525;\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_234536;\n            \n            // read input for in-block scan\n            {\n                if (squot32(local_tid_234487, 32) == 0 &&\n                    ltid_in_bounds_234532) {\n                    x_234530 = ((volatile __local\n                                 double *) local_mem_234495)[squot64(byte_offsets_234491,\n                                                                     (int64_t) 8) +\n                                                             sext_i32_i64(local_tid_234487)];\n                    if ((local_tid_234487 - squot32(local_tid_234487, 32) *\n                         32) == 0) {\n                        x_234529 = x_234530;\n        ",
            "            }\n                }\n            }\n            // in-block scan (hopefully no barriers needed)\n            {\n                skip_threads_234536 = 1;\n                while (slt32(skip_threads_234536, 32)) {\n                    bool thread_active_234537 = sle32(skip_threads_234536,\n                                                      local_tid_234487 -\n                                                      squot32(local_tid_234487,\n                                                              32) * 32) &&\n                         (squot32(local_tid_234487, 32) == 0 &&\n                          ltid_in_bounds_234532);\n                    \n                    if (thread_active_234537) {\n                        // read operands\n                        {\n                            x_234529 = ((volatile __local\n                                         double *) local_mem_234495)[squot64(byte_offsets_234491,\n                                                                             (int64_t) 8) +\n                                                                     (sext_i32_i64(local_tid_234487) -\n                                                                      sext_i32_i64(skip_threads_234536))];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_234538 = slt32(smod32((local_tid_234487 *\n                                                             32 + 32 - 1 + 1) *\n                                                            11 - 1 +\n                                                            segsizze_compact_234506 -\n                                                            boundary_234505,\n                                                            segsizze_compact_234506),\n                                                     (local_tid_234487 * 32 +\n                                                      32 - 1 + 1) * 11 - 1 -\n                           ",
            "                          (((local_tid_234487 -\n                                                        skip_threads_234536) *\n                                                       32 + 32 - 1 + 1) * 11 -\n                                                      1));\n                        \n                        if (thread_active_234537 && inactive_234538) {\n                            x_234529 = x_234530;\n                        }\n                        if (thread_active_234537) {\n                            if (!inactive_234538) {\n                                double defunc_1_op_res_234531 = x_234529 +\n                                       x_234530;\n                                \n                                x_234529 = defunc_1_op_res_234531;\n                            }\n                        }\n                    }\n                    if (sle32(wave_sizze_234489, skip_threads_234536)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    if (thread_active_234537) {\n                        // write result\n                        {\n                            ((volatile __local\n                              double *) local_mem_234495)[squot64(byte_offsets_234491,\n                                                                  (int64_t) 8) +\n                                                          sext_i32_i64(local_tid_234487)] =\n                                x_234529;\n                            x_234530 = x_234529;\n                        }\n                    }\n                    if (sle32(wave_sizze_234489, skip_threads_234536)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    skip_threads_234536 *= 2;\n                }\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        bool no_carry_in_234539 = squot32(local_tid_234487, 32) == 0 ||\n             !ltid_in_bounds_234532;\n        \n        // carry-in for every block except the ",
            "first\n        {\n            // read operands\n            {\n                if (!no_carry_in_234539) {\n                    x_234526 = x_234525;\n                    x_234525 = ((__local\n                                 double *) local_mem_234495)[squot64(byte_offsets_234491,\n                                                                     (int64_t) 8) +\n                                                             (sext_i32_i64(squot32(local_tid_234487,\n                                                                                   32)) -\n                                                              (int64_t) 1)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_234540 = slt32(smod32((local_tid_234487 + 1) *\n                                                    11 - 1 +\n                                                    segsizze_compact_234506 -\n                                                    boundary_234505,\n                                                    segsizze_compact_234506),\n                                             (local_tid_234487 + 1) * 11 - 1 -\n                                             ((squot32(local_tid_234487, 32) *\n                                               32 - 1 + 1) * 11 - 1));\n                \n                if (!no_carry_in_234539) {\n                    if (inactive_234540) {\n                        x_234525 = x_234526;\n                    }\n                }\n                if (!no_carry_in_234539) {\n                    if (!inactive_234540) {\n                        double defunc_1_op_res_234527 = x_234525 + x_234526;\n                        \n                        x_234525 = defunc_1_op_res_234527;\n                    }\n                }\n            }\n            // write final result\n            {\n                if (!no_carry_in_234539) {\n                    ((__local\n                      double *) local_mem_234495)[squot64(byte_offsets_234491,\n             ",
            "                                             (int64_t) 8) +\n                                                  sext_i32_i64(local_tid_234487)] =\n                        x_234525;\n                }\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // restore correct values for first block\n        {\n            if (squot32(local_tid_234487, 32) == 0 && ltid_in_bounds_234532) {\n                ((__local\n                  double *) local_mem_234495)[squot64(byte_offsets_234491,\n                                                      (int64_t) 8) +\n                                              sext_i32_i64(local_tid_234487)] =\n                    x_234526;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (local_tid_234487 == 0) {\n            acc_234528 = ((__local\n                           double *) local_mem_234495)[squot64(byte_offsets_234491,\n                                                               (int64_t) 8) +\n                                                       (segscan_group_sizze_218808 -\n                                                        (int64_t) 1)];\n        } else {\n            acc_234528 = ((__local\n                           double *) local_mem_234495)[squot64(byte_offsets_234491,\n                                                               (int64_t) 8) +\n                                                       (sext_i32_i64(local_tid_234487) -\n                                                        (int64_t) 1)];\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    \n    double prefix_234541 = 0.0;\n    bool block_new_sgm_234542 = sgm_idx_234504 == (int64_t) 0;\n    \n    // Perform lookback\n    {\n        if (block_new_sgm_234542 && local_tid_234487 == 0) {\n            ((volatile __global\n              double *) incprefixes_mem_234484)[dynamic_id_234502] = acc_234528;\n            mem_fence_global();\n            ((volatile __global\n              int8_t *) status_f",
            "lags_mem_234480)[dynamic_id_234502] =\n                (int8_t) 2;\n            acc_234528 = 0.0;\n        }\n        if (!block_new_sgm_234542 && slt32(local_tid_234487,\n                                           wave_sizze_234489)) {\n            if (local_tid_234487 == 0) {\n                if (boundary_234505 == sext_i64_i32(segscan_group_sizze_218808 *\n                    (int64_t) 11)) {\n                    ((volatile __global\n                      double *) aggregates_mem_234482)[dynamic_id_234502] =\n                        acc_234528;\n                    mem_fence_global();\n                    ((volatile __global\n                      int8_t *) status_flags_mem_234480)[dynamic_id_234502] =\n                        (int8_t) 1;\n                } else {\n                    ((volatile __global\n                      double *) incprefixes_mem_234484)[dynamic_id_234502] =\n                        acc_234528;\n                    mem_fence_global();\n                    ((volatile __global\n                      int8_t *) status_flags_mem_234480)[dynamic_id_234502] =\n                        (int8_t) 2;\n                }\n                \n                int8_t tmp_234543;\n                \n                tmp_234543 = ((volatile __global\n                               int8_t *) status_flags_mem_234480)[dynamic_id_234502 -\n                                                                  (int64_t) 1];\n                ((volatile __local int8_t *) local_mem_234495)[(int64_t) 0] =\n                    tmp_234543;\n            }\n            mem_fence_local();\n            \n            int8_t status_234544;\n            \n            status_234544 = ((__local int8_t *) local_mem_234495)[(int64_t) 0];\n            if (status_234544 == (int8_t) 2) {\n                if (local_tid_234487 == 0) {\n                    prefix_234541 = ((volatile __global\n                                      double *) incprefixes_mem_234484)[dynamic_id_234502 -\n                                                      ",
            "                  (int64_t) 1];\n                }\n            } else {\n                int32_t readOffset_234545 = dynamic_id_234502 -\n                        sext_i32_i64(wave_sizze_234489);\n                \n                while (slt32(wave_sizze_234489 * -1, readOffset_234545)) {\n                    int32_t read_i_234546 = readOffset_234545 +\n                            local_tid_234487;\n                    double aggr_234547 = 0.0;\n                    int8_t flag_234548 = (int8_t) 0;\n                    \n                    if (sle32(0, read_i_234546)) {\n                        if (sle64(blockOff_234503 -\n                                  (sext_i32_i64(read_i_234546 + 1) *\n                                   segscan_group_sizze_218808 * (int64_t) 11 -\n                                   (int64_t) 1), sgm_idx_234504)) {\n                            flag_234548 = ((volatile __global\n                                            int8_t *) status_flags_mem_234480)[sext_i32_i64(read_i_234546)];\n                            if (flag_234548 == (int8_t) 2) {\n                                aggr_234547 = ((volatile __global\n                                                double *) incprefixes_mem_234484)[sext_i32_i64(read_i_234546)];\n                            } else {\n                                if (flag_234548 == (int8_t) 1) {\n                                    aggr_234547 = ((volatile __global\n                                                    double *) aggregates_mem_234482)[sext_i32_i64(read_i_234546)];\n                                }\n                            }\n                        } else {\n                            flag_234548 = (int8_t) 2;\n                        }\n                    }\n                    ((__local\n                      double *) local_mem_234495)[squot64(warp_byte_offset_234493,\n                                                          (int64_t) 8) +\n                                                  sext_i32_i64(local_tid_234487)] =\n ",
            "                       aggr_234547;\n                    ((__local\n                      int8_t *) local_mem_234495)[sext_i32_i64(local_tid_234487)] =\n                        flag_234548;\n                    flag_234548 = ((__local\n                                    int8_t *) local_mem_234495)[sext_i32_i64(wave_sizze_234489) -\n                                                                (int64_t) 1];\n                    if (slt8(flag_234548, (int8_t) 2)) {\n                        int8_t flg_x_234552;\n                        int8_t flg_y_234553;\n                        double x_234549;\n                        double x_234550;\n                        int32_t skip_threads_234554;\n                        \n                        // read input for in-block scan\n                        {\n                            flg_y_234553 = ((volatile __local\n                                             int8_t *) local_mem_234495)[sext_i32_i64(local_tid_234487)];\n                            x_234550 = ((volatile __local\n                                         double *) local_mem_234495)[squot64(warp_byte_offset_234493,\n                                                                             (int64_t) 8) +\n                                                                     sext_i32_i64(local_tid_234487)];\n                            if ((local_tid_234487 - squot32(local_tid_234487,\n                                                            32) * 32) == 0) {\n                                x_234549 = x_234550;\n                                flg_x_234552 = flg_y_234553;\n                            }\n                        }\n                        // in-block scan (hopefully no barriers needed)\n                        {\n                            skip_threads_234554 = 1;\n                            while (slt32(skip_threads_234554, 32)) {\n                                if (sle32(skip_threads_234554,\n                                          local_tid_234487 -\n            ",
            "                              squot32(local_tid_234487, 32) * 32)) {\n                                    // read operands\n                                    {\n                                        flg_x_234552 = ((volatile __local\n                                                         int8_t *) local_mem_234495)[sext_i32_i64(local_tid_234487) -\n                                                                                     sext_i32_i64(skip_threads_234554)];\n                                        x_234549 = ((volatile __local\n                                                     double *) local_mem_234495)[squot64(warp_byte_offset_234493,\n                                                                                         (int64_t) 8) +\n                                                                                 (sext_i32_i64(local_tid_234487) -\n                                                                                  sext_i32_i64(skip_threads_234554))];\n                                    }\n                                    // perform operation\n                                    {\n                                        if (flg_y_234553 == (int8_t) 2 ||\n                                            flg_y_234553 == (int8_t) 0) {\n                                            flg_x_234552 = flg_y_234553;\n                                            x_234549 = x_234550;\n                                        } else {\n                                            double defunc_1_op_res_234551 =\n                                                   x_234549 + x_234550;\n                                            \n                                            x_234549 = defunc_1_op_res_234551;\n                                        }\n                                    }\n                                    // write result\n                                    {\n                                        ((volatile __local\n                                    ",
            "      int8_t *) local_mem_234495)[sext_i32_i64(local_tid_234487)] =\n                                            flg_x_234552;\n                                        flg_y_234553 = flg_x_234552;\n                                        ((volatile __local\n                                          double *) local_mem_234495)[squot64(warp_byte_offset_234493,\n                                                                              (int64_t) 8) +\n                                                                      sext_i32_i64(local_tid_234487)] =\n                                            x_234549;\n                                        x_234550 = x_234549;\n                                    }\n                                }\n                                skip_threads_234554 *= 2;\n                            }\n                        }\n                    }\n                    flag_234548 = ((__local\n                                    int8_t *) local_mem_234495)[sext_i32_i64(wave_sizze_234489) -\n                                                                (int64_t) 1];\n                    aggr_234547 = ((__local\n                                    double *) local_mem_234495)[squot64(warp_byte_offset_234493,\n                                                                        (int64_t) 8) +\n                                                                (sext_i32_i64(wave_sizze_234489) -\n                                                                 (int64_t) 1)];\n                    if (flag_234548 == (int8_t) 2) {\n                        readOffset_234545 = wave_sizze_234489 * -1;\n                    } else {\n                        if (flag_234548 == (int8_t) 1) {\n                            readOffset_234545 -= wave_sizze_234489;\n                        }\n                    }\n                    if (slt8((int8_t) 0, flag_234548)) {\n                        double x_234555 = aggr_234547;\n                        double x_234556 = prefix_234541;\n    ",
            "                    double defunc_1_op_res_234557 = x_234555 + x_234556;\n                        \n                        prefix_234541 = defunc_1_op_res_234557;\n                    }\n                    mem_fence_local();\n                }\n            }\n            if (local_tid_234487 == 0) {\n                if (boundary_234505 == sext_i64_i32(segscan_group_sizze_218808 *\n                    (int64_t) 11)) {\n                    double x_234558 = prefix_234541;\n                    double x_234559 = acc_234528;\n                    double defunc_1_op_res_234560 = x_234558 + x_234559;\n                    \n                    ((volatile __global\n                      double *) incprefixes_mem_234484)[dynamic_id_234502] =\n                        defunc_1_op_res_234560;\n                    mem_fence_global();\n                    ((volatile __global\n                      int8_t *) status_flags_mem_234480)[dynamic_id_234502] =\n                        (int8_t) 2;\n                }\n                ((__local\n                  double *) local_mem_234495)[squot64(warp_byte_offset_234493,\n                                                      (int64_t) 8)] =\n                    prefix_234541;\n                acc_234528 = 0.0;\n            }\n        }\n        if (!(dynamic_id_234502 == (int64_t) 0)) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            prefix_234541 = ((__local\n                              double *) local_mem_234495)[squot64(warp_byte_offset_234493,\n                                                                  (int64_t) 8)];\n            barrier(CLK_LOCAL_MEM_FENCE);\n        }\n    }\n    // Distribute results\n    {\n        double x_234561;\n        double x_234562;\n        double x_234564 = prefix_234541;\n        double x_234565 = acc_234528;\n        \n        if (slt32(local_tid_234487 * 11, boundary_234505) &&\n            !block_new_sgm_234542) {\n            double defunc_1_op_res_234566 = x_234564 + x_234565;\n            \n            x_234561 = defunc_1_op_re",
            "s_234566;\n        } else {\n            x_234561 = acc_234528;\n        }\n        \n        int32_t stopping_point_234567 = segsizze_compact_234506 -\n                srem32(local_tid_234487 * 11 - 1 + segsizze_compact_234506 -\n                       boundary_234505, segsizze_compact_234506);\n        \n        for (int64_t i_234568 = 0; i_234568 < (int64_t) 11; i_234568++) {\n            if (slt32(sext_i64_i32(i_234568), stopping_point_234567 - 1)) {\n                x_234562 = private_mem_234507[i_234568];\n                \n                double defunc_1_op_res_234563 = x_234561 + x_234562;\n                \n                private_mem_234507[i_234568] = defunc_1_op_res_234563;\n            }\n        }\n    }\n    // Transpose scan output and Write it to global memory in coalesced fashion\n    {\n        for (int64_t i_234569 = 0; i_234569 < (int64_t) 11; i_234569++) {\n            int64_t sharedIdx_234570 = sext_i32_i64(local_tid_234487 * 11) +\n                    i_234569;\n            double tmp_234571;\n            \n            tmp_234571 = private_mem_234507[i_234569];\n            ((__local double *) local_mem_234495)[sharedIdx_234570] =\n                tmp_234571;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_234572 = 0; i_234572 < (int64_t) 11; i_234572++) {\n            int64_t flat_idx_234573 = blockOff_234503 +\n                    segscan_group_sizze_218808 * i_234572 +\n                    sext_i32_i64(local_tid_234487);\n            int64_t slice_234574 = dyn_lifted_single_ma_l_arg_204144;\n            int64_t slice_234575 = partition_sizze_203577 * slice_234574;\n            int64_t gtid_218812 = squot64(flat_idx_234573, slice_234574);\n            int64_t remnant_234576 = flat_idx_234573 - gtid_218812 *\n                    slice_234574;\n            int64_t gtid_218813 = remnant_234576;\n            int64_t remnant_234577 = remnant_234576 - gtid_218813;\n            \n            if (slt64(flat_idx_234573, partition_sizze_203577 *\n                     ",
            " dyn_lifted_single_ma_l_arg_204144)) {\n                double tmp_234578;\n                \n                tmp_234578 = ((__local\n                               double *) local_mem_234495)[flat_idx_234573 -\n                                                           blockOff_234503];\n                ((__global double *) mem_230534)[gtid_218812 *\n                                                 dyn_lifted_single_ma_l_arg_204144 +\n                                                 gtid_218813] = tmp_234578;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    // If this is the last block, reset the dynamicId\n    {\n        if (dynamic_id_234502 == sdiv_up64(partition_sizze_203577 *\n                                           dyn_lifted_single_ma_l_arg_204144,\n                                           segscan_group_sizze_218808 *\n                                           (int64_t) 11) - (int64_t) 1) {\n            ((__global int32_t *) mainziid_counter_mem_234478)[(int64_t) 0] = 0;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_218808\n}\n__kernel void mainzisegscan_218945(__global int *global_failure,\n                                   int failure_is_an_option, __global\n                                   int64_t *global_failure_args,\n                                   uint local_mem_234676_backing_offset_0,\n                                   int64_t n_203490,\n                                   int64_t partition_sizze_203577,\n                                   int64_t dyn_lifted_single_ma_l_arg_204144,\n                                   __global unsigned char *mem_230534, __global\n                                   unsigned char *ext_mem_230546, __global\n                                   unsigned char *mem_230551, __global\n                                   unsigned char *mainziid_counter_mem_234659,\n                                   __global\n                                   unsigned char *status_flags_mem_234661,\n          ",
            "                         __global\n                                   unsigned char *aggregates_mem_234663,\n                                   __global\n                                   unsigned char *incprefixes_mem_234665)\n{\n    #define segscan_group_sizze_218939 (mainzisegscan_group_sizze_218903)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *local_mem_234676_backing_0 =\n                           &shared_mem[local_mem_234676_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_234667;\n    int32_t local_tid_234668;\n    int64_t group_sizze_234671;\n    int32_t wave_sizze_234670;\n    int32_t group_tid_234669;\n    \n    global_tid_234667 = get_global_id(0);\n    local_tid_234668 = get_local_id(0);\n    group_sizze_234671 = get_local_size(0);\n    wave_sizze_234670 = LOCKSTEP_WIDTH;\n    group_tid_234669 = get_group_id(0);\n    \n    int32_t phys_tid_218945 = global_tid_234667;\n    int64_t byte_offsets_234672 = (int64_t) 0;\n    int64_t byte_offsets_234673 = segscan_group_sizze_218939 * (int64_t) 8;\n    int64_t warp_byte_offset_234674 = (int64_t) 32;\n    int64_t warp_byte_offset_234675 = (int64_t) 288;\n    \n    // Allocate reused shared memeory\n    { }\n    \n    __local unsigned char *local_mem_234676;\n    \n    local_mem_234676 = (__local unsigned char *) local_mem_234676_backing_0;\n    \n    int64_t trans_arr_len_234677 = (int64_t) 11 * segscan_group_sizze_218939;\n    int32_t dynamic_id_234683;\n    \n    if (local_tid_234668 == 0) {\n        dynamic_id_234683 = atomic_add_i32_global(&((volatile __global\n                                                     int *) mainziid_counter_mem_234659)[(int64_t) 0],\n                                                  (int) 1);\n        ((__lo",
            "cal int32_t *) local_mem_234676)[(int64_t) 0] = dynamic_id_234683;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    dynamic_id_234683 = ((__local int32_t *) local_mem_234676)[(int64_t) 0];\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t blockOff_234684 = sext_i32_i64(dynamic_id_234683) * (int64_t) 11 *\n            segscan_group_sizze_218939;\n    int64_t sgm_idx_234685 = smod64(blockOff_234684, n_203490);\n    int32_t boundary_234686 = sext_i64_i32(smin64((int64_t) 11 *\n                                                  segscan_group_sizze_218939,\n                                                  n_203490 - sgm_idx_234685));\n    int32_t segsizze_compact_234687 = sext_i64_i32(smin64((int64_t) 11 *\n                                                          segscan_group_sizze_218939,\n                                                          n_203490));\n    double private_mem_234688[(int64_t) 11];\n    \n    // Load and map\n    {\n        for (int64_t i_234690 = 0; i_234690 < (int64_t) 11; i_234690++) {\n            int64_t phys_tid_234691 = blockOff_234684 +\n                    sext_i32_i64(local_tid_234668) + i_234690 *\n                    segscan_group_sizze_218939;\n            int64_t slice_234692 = n_203490;\n            int64_t slice_234693 = partition_sizze_203577 * slice_234692;\n            int64_t gtid_218943 = squot64(phys_tid_234691, slice_234692);\n            int64_t remnant_234694 = phys_tid_234691 - gtid_218943 *\n                    slice_234692;\n            int64_t gtid_218944 = remnant_234694;\n            int64_t remnant_234695 = remnant_234694 - gtid_218944;\n            \n            if (slt64(phys_tid_234691, partition_sizze_203577 * n_203490)) {\n                bool cond_218952 = gtid_218944 == (int64_t) 0;\n                double defunc_0_f_res_218953;\n                \n                if (cond_218952) {\n                    double x_218950;\n                    \n                    x_218950 = ((__global\n                                 double *) ext_mem_230546)[gt",
            "id_218943];\n                    \n                    double defunc_0_f_res_t_res_218954 = x_218950 / 3.0;\n                    \n                    defunc_0_f_res_218953 = defunc_0_f_res_t_res_218954;\n                } else {\n                    int64_t x_218955 = add64((int64_t) 3, gtid_218944);\n                    int64_t i_218956 = sub64(x_218955, (int64_t) 1);\n                    bool x_218957 = sle64((int64_t) 0, i_218956);\n                    bool y_218958 = slt64(i_218956,\n                                          dyn_lifted_single_ma_l_arg_204144);\n                    bool bounds_check_218959 = x_218957 && y_218958;\n                    bool index_certs_218960;\n                    \n                    if (!bounds_check_218959) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          48) == -1) {\n                                global_failure_args[0] = (int64_t) i_218956;\n                                global_failure_args[1] =\n                                    (int64_t) dyn_lifted_single_ma_l_arg_204144;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    double x_218961;\n                    \n                    x_218961 = ((__global double *) mem_230534)[gtid_218943 *\n                                                                dyn_lifted_single_ma_l_arg_204144 +\n                                                                i_218956];\n                    \n                    int64_t i_218962 = sub64(gtid_218944, (int64_t) 1);\n                    bool x_218963 = sle64((int64_t) 0, i_218962);\n                    bool y_218964 = slt64(i_218962,\n                                          dyn_lifted_single_ma_l_arg_204144);\n                    bool bounds_check_21",
            "8965 = x_218963 && y_218964;\n                    bool index_certs_218966;\n                    \n                    if (!bounds_check_218965) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          49) == -1) {\n                                global_failure_args[0] = (int64_t) i_218962;\n                                global_failure_args[1] =\n                                    (int64_t) dyn_lifted_single_ma_l_arg_204144;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    double y_218967;\n                    \n                    y_218967 = ((__global double *) mem_230534)[gtid_218943 *\n                                                                dyn_lifted_single_ma_l_arg_204144 +\n                                                                i_218962];\n                    \n                    double x_218968 = x_218961 - y_218967;\n                    double defunc_0_f_res_f_res_218969 = x_218968 / 3.0;\n                    \n                    defunc_0_f_res_218953 = defunc_0_f_res_f_res_218969;\n                }\n                private_mem_234688[i_234690] = defunc_0_f_res_218953;\n            } else {\n                private_mem_234688[i_234690] = 0.0;\n            }\n        }\n    }\n    // Transpose scan inputs\n    {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_234696 = 0; i_234696 < (int64_t) 11; i_234696++) {\n            int64_t sharedIdx_234697 = sext_i32_i64(local_tid_234668) +\n                    i_234696 * segscan_group_sizze_218939;\n            double tmp_234698;\n            \n            tmp_234698 = private_mem_234688[i_234696];\n            ((__local double *) local_mem_234676)[sharedIdx_234697] =\n                tmp_234698;\n        }\n        ",
            "barrier(CLK_LOCAL_MEM_FENCE);\n        for (int32_t i_234699 = 0; i_234699 < 11; i_234699++) {\n            int32_t sharedIdx_234700 = local_tid_234668 * 11 + i_234699;\n            double tmp_234701;\n            \n            tmp_234701 = ((__local\n                           double *) local_mem_234676)[sext_i32_i64(sharedIdx_234700)];\n            private_mem_234688[sext_i32_i64(i_234699)] = tmp_234701;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    // Per thread scan\n    {\n        int32_t gidx_234702 = local_tid_234668 * 11 + 1;\n        \n        for (int64_t i_234703 = 0; i_234703 < (int64_t) 10; i_234703++) {\n            bool new_sgm_234704 = smod32(gidx_234702 + sext_i64_i32(i_234703) -\n                                         boundary_234686,\n                                         segsizze_compact_234687) == 0;\n            \n            if (!new_sgm_234704) {\n                double x_218946;\n                double x_218947;\n                \n                x_218946 = private_mem_234688[i_234703];\n                x_218947 = private_mem_234688[i_234703 + (int64_t) 1];\n                \n                double defunc_1_op_res_218948 = x_218946 + x_218947;\n                \n                private_mem_234688[i_234703 + (int64_t) 1] =\n                    defunc_1_op_res_218948;\n            }\n        }\n    }\n    // Publish results in shared memory\n    {\n        double tmp_234705;\n        \n        tmp_234705 = private_mem_234688[(int64_t) 10];\n        ((__local double *) local_mem_234676)[squot64(byte_offsets_234672,\n                                                      (int64_t) 8) +\n                                              sext_i32_i64(local_tid_234668)] =\n            tmp_234705;\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    \n    double acc_234709;\n    \n    // Scan results (with warp scan)\n    {\n        double x_234706;\n        double x_234707;\n        double x_234710;\n        double x_234711;\n        bool ltid_in_bounds_234713 = slt64(sext_i32_i64(local_",
            "tid_234668),\n                                           segscan_group_sizze_218939);\n        int32_t skip_threads_234714;\n        \n        // read input for in-block scan\n        {\n            if (ltid_in_bounds_234713) {\n                x_234707 = ((volatile __local\n                             double *) local_mem_234676)[squot64(byte_offsets_234672,\n                                                                 (int64_t) 8) +\n                                                         sext_i32_i64(local_tid_234668)];\n                if ((local_tid_234668 - squot32(local_tid_234668, 32) * 32) ==\n                    0) {\n                    x_234706 = x_234707;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_234714 = 1;\n            while (slt32(skip_threads_234714, 32)) {\n                bool thread_active_234715 = sle32(skip_threads_234714,\n                                                  local_tid_234668 -\n                                                  squot32(local_tid_234668,\n                                                          32) * 32) &&\n                     ltid_in_bounds_234713;\n                \n                if (thread_active_234715) {\n                    // read operands\n                    {\n                        x_234706 = ((volatile __local\n                                     double *) local_mem_234676)[squot64(byte_offsets_234672,\n                                                                         (int64_t) 8) +\n                                                                 (sext_i32_i64(local_tid_234668) -\n                                                                  sext_i32_i64(skip_threads_234714))];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_234716 = slt32(smod32((local_tid_234668 + 1) *\n                                                        11 - 1 +\n   ",
            "                                                     segsizze_compact_234687 -\n                                                        boundary_234686,\n                                                        segsizze_compact_234687),\n                                                 (local_tid_234668 + 1) * 11 -\n                                                 1 - ((local_tid_234668 -\n                                                       skip_threads_234714 +\n                                                       1) * 11 - 1));\n                    \n                    if (thread_active_234715 && inactive_234716) {\n                        x_234706 = x_234707;\n                    }\n                    if (thread_active_234715) {\n                        if (!inactive_234716) {\n                            double defunc_1_op_res_234708 = x_234706 + x_234707;\n                            \n                            x_234706 = defunc_1_op_res_234708;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_234670, skip_threads_234714)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_234715) {\n                    // write result\n                    {\n                        ((volatile __local\n                          double *) local_mem_234676)[squot64(byte_offsets_234672,\n                                                              (int64_t) 8) +\n                                                      sext_i32_i64(local_tid_234668)] =\n                            x_234706;\n                        x_234707 = x_234706;\n                    }\n                }\n                if (sle32(wave_sizze_234670, skip_threads_234714)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_234714 *= 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_234668 - squot32(local_tid_234668, 32) * 32) == 31 &&\n                ltid_in_bounds_234713) {\n                ((volatile __local\n                  double *) local_mem_234676)[squot64(byte_offsets_234672,\n                                                      (int64_t) 8) +\n                                              sext_i32_i64(squot32(local_tid_234668,\n                                                                   32))] =\n                    x_234706;\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_234717;\n            \n            // read input for in-block scan\n            {\n                if (squot32(local_tid_234668, 32) == 0 &&\n                    ltid_in_bounds_234713) {\n                    x_234711 = ((volatile __local\n                                 double *) local_mem_234676)[squot64(byte_offsets_234672,\n                                                                     (int64_t) 8) +\n                                                             sext_i32_i64(local_tid_234668)];\n                    if ((local_tid_234668 - squot32(local_tid_234668, 32) *\n                         32) == 0) {\n                        x_234710 = x_234711;\n                    }\n                }\n            }\n            // in-block scan (hopefully no barriers needed)\n            {\n                skip_threads_234717 = 1;\n                while (slt32(skip_threads_234717, 32)) {\n                    bool thread_active_234718 = sle32(skip_threads_234717,\n                                                      local_tid_234668 -\n                                                      squot32(local_tid_234668,\n                                                              32) * 32) &&\n                         (squot32(local_tid_234668, 32) == 0 &&\n                          ltid_in_bounds_234713);\n                 ",
            "   \n                    if (thread_active_234718) {\n                        // read operands\n                        {\n                            x_234710 = ((volatile __local\n                                         double *) local_mem_234676)[squot64(byte_offsets_234672,\n                                                                             (int64_t) 8) +\n                                                                     (sext_i32_i64(local_tid_234668) -\n                                                                      sext_i32_i64(skip_threads_234717))];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_234719 = slt32(smod32((local_tid_234668 *\n                                                             32 + 32 - 1 + 1) *\n                                                            11 - 1 +\n                                                            segsizze_compact_234687 -\n                                                            boundary_234686,\n                                                            segsizze_compact_234687),\n                                                     (local_tid_234668 * 32 +\n                                                      32 - 1 + 1) * 11 - 1 -\n                                                     (((local_tid_234668 -\n                                                        skip_threads_234717) *\n                                                       32 + 32 - 1 + 1) * 11 -\n                                                      1));\n                        \n                        if (thread_active_234718 && inactive_234719) {\n                            x_234710 = x_234711;\n                        }\n                        if (thread_active_234718) {\n                            if (!inactive_234719) {\n                                double defunc_1_op_res_234712 = x_234710 +\n                                     ",
            "  x_234711;\n                                \n                                x_234710 = defunc_1_op_res_234712;\n                            }\n                        }\n                    }\n                    if (sle32(wave_sizze_234670, skip_threads_234717)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    if (thread_active_234718) {\n                        // write result\n                        {\n                            ((volatile __local\n                              double *) local_mem_234676)[squot64(byte_offsets_234672,\n                                                                  (int64_t) 8) +\n                                                          sext_i32_i64(local_tid_234668)] =\n                                x_234710;\n                            x_234711 = x_234710;\n                        }\n                    }\n                    if (sle32(wave_sizze_234670, skip_threads_234717)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    skip_threads_234717 *= 2;\n                }\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        bool no_carry_in_234720 = squot32(local_tid_234668, 32) == 0 ||\n             !ltid_in_bounds_234713;\n        \n        // carry-in for every block except the first\n        {\n            // read operands\n            {\n                if (!no_carry_in_234720) {\n                    x_234707 = x_234706;\n                    x_234706 = ((__local\n                                 double *) local_mem_234676)[squot64(byte_offsets_234672,\n                                                                     (int64_t) 8) +\n                                                             (sext_i32_i64(squot32(local_tid_234668,\n                                                                                   32)) -\n                                                              (int64_t) 1)];\n                }\n        ",
            "    }\n            // perform operation\n            {\n                bool inactive_234721 = slt32(smod32((local_tid_234668 + 1) *\n                                                    11 - 1 +\n                                                    segsizze_compact_234687 -\n                                                    boundary_234686,\n                                                    segsizze_compact_234687),\n                                             (local_tid_234668 + 1) * 11 - 1 -\n                                             ((squot32(local_tid_234668, 32) *\n                                               32 - 1 + 1) * 11 - 1));\n                \n                if (!no_carry_in_234720) {\n                    if (inactive_234721) {\n                        x_234706 = x_234707;\n                    }\n                }\n                if (!no_carry_in_234720) {\n                    if (!inactive_234721) {\n                        double defunc_1_op_res_234708 = x_234706 + x_234707;\n                        \n                        x_234706 = defunc_1_op_res_234708;\n                    }\n                }\n            }\n            // write final result\n            {\n                if (!no_carry_in_234720) {\n                    ((__local\n                      double *) local_mem_234676)[squot64(byte_offsets_234672,\n                                                          (int64_t) 8) +\n                                                  sext_i32_i64(local_tid_234668)] =\n                        x_234706;\n                }\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // restore correct values for first block\n        {\n            if (squot32(local_tid_234668, 32) == 0 && ltid_in_bounds_234713) {\n                ((__local\n                  double *) local_mem_234676)[squot64(byte_offsets_234672,\n                                                      (int64_t) 8) +\n                                              sext_i32_i64(local_tid_234668)] =\n     ",
            "               x_234707;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (local_tid_234668 == 0) {\n            acc_234709 = ((__local\n                           double *) local_mem_234676)[squot64(byte_offsets_234672,\n                                                               (int64_t) 8) +\n                                                       (segscan_group_sizze_218939 -\n                                                        (int64_t) 1)];\n        } else {\n            acc_234709 = ((__local\n                           double *) local_mem_234676)[squot64(byte_offsets_234672,\n                                                               (int64_t) 8) +\n                                                       (sext_i32_i64(local_tid_234668) -\n                                                        (int64_t) 1)];\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    \n    double prefix_234722 = 0.0;\n    bool block_new_sgm_234723 = sgm_idx_234685 == (int64_t) 0;\n    \n    // Perform lookback\n    {\n        if (block_new_sgm_234723 && local_tid_234668 == 0) {\n            ((volatile __global\n              double *) incprefixes_mem_234665)[dynamic_id_234683] = acc_234709;\n            mem_fence_global();\n            ((volatile __global\n              int8_t *) status_flags_mem_234661)[dynamic_id_234683] =\n                (int8_t) 2;\n            acc_234709 = 0.0;\n        }\n        if (!block_new_sgm_234723 && slt32(local_tid_234668,\n                                           wave_sizze_234670)) {\n            if (local_tid_234668 == 0) {\n                if (boundary_234686 == sext_i64_i32(segscan_group_sizze_218939 *\n                    (int64_t) 11)) {\n                    ((volatile __global\n                      double *) aggregates_mem_234663)[dynamic_id_234683] =\n                        acc_234709;\n                    mem_fence_global();\n                    ((volatile __global\n                      int8_t ",
            "*) status_flags_mem_234661)[dynamic_id_234683] =\n                        (int8_t) 1;\n                } else {\n                    ((volatile __global\n                      double *) incprefixes_mem_234665)[dynamic_id_234683] =\n                        acc_234709;\n                    mem_fence_global();\n                    ((volatile __global\n                      int8_t *) status_flags_mem_234661)[dynamic_id_234683] =\n                        (int8_t) 2;\n                }\n                \n                int8_t tmp_234724;\n                \n                tmp_234724 = ((volatile __global\n                               int8_t *) status_flags_mem_234661)[dynamic_id_234683 -\n                                                                  (int64_t) 1];\n                ((volatile __local int8_t *) local_mem_234676)[(int64_t) 0] =\n                    tmp_234724;\n            }\n            mem_fence_local();\n            \n            int8_t status_234725;\n            \n            status_234725 = ((__local int8_t *) local_mem_234676)[(int64_t) 0];\n            if (status_234725 == (int8_t) 2) {\n                if (local_tid_234668 == 0) {\n                    prefix_234722 = ((volatile __global\n                                      double *) incprefixes_mem_234665)[dynamic_id_234683 -\n                                                                        (int64_t) 1];\n                }\n            } else {\n                int32_t readOffset_234726 = dynamic_id_234683 -\n                        sext_i32_i64(wave_sizze_234670);\n                \n                while (slt32(wave_sizze_234670 * -1, readOffset_234726)) {\n                    int32_t read_i_234727 = readOffset_234726 +\n                            local_tid_234668;\n                    double aggr_234728 = 0.0;\n                    int8_t flag_234729 = (int8_t) 0;\n                    \n                    if (sle32(0, read_i_234727)) {\n                        if (sle64(blockOff_234684 -\n                                  (",
            "sext_i32_i64(read_i_234727 + 1) *\n                                   segscan_group_sizze_218939 * (int64_t) 11 -\n                                   (int64_t) 1), sgm_idx_234685)) {\n                            flag_234729 = ((volatile __global\n                                            int8_t *) status_flags_mem_234661)[sext_i32_i64(read_i_234727)];\n                            if (flag_234729 == (int8_t) 2) {\n                                aggr_234728 = ((volatile __global\n                                                double *) incprefixes_mem_234665)[sext_i32_i64(read_i_234727)];\n                            } else {\n                                if (flag_234729 == (int8_t) 1) {\n                                    aggr_234728 = ((volatile __global\n                                                    double *) aggregates_mem_234663)[sext_i32_i64(read_i_234727)];\n                                }\n                            }\n                        } else {\n                            flag_234729 = (int8_t) 2;\n                        }\n                    }\n                    ((__local\n                      double *) local_mem_234676)[squot64(warp_byte_offset_234674,\n                                                          (int64_t) 8) +\n                                                  sext_i32_i64(local_tid_234668)] =\n                        aggr_234728;\n                    ((__local\n                      int8_t *) local_mem_234676)[sext_i32_i64(local_tid_234668)] =\n                        flag_234729;\n                    flag_234729 = ((__local\n                                    int8_t *) local_mem_234676)[sext_i32_i64(wave_sizze_234670) -\n                                                                (int64_t) 1];\n                    if (slt8(flag_234729, (int8_t) 2)) {\n                        int8_t flg_x_234733;\n                        int8_t flg_y_234734;\n                        double x_234730;\n                        double x_234731;\n                ",
            "        int32_t skip_threads_234735;\n                        \n                        // read input for in-block scan\n                        {\n                            flg_y_234734 = ((volatile __local\n                                             int8_t *) local_mem_234676)[sext_i32_i64(local_tid_234668)];\n                            x_234731 = ((volatile __local\n                                         double *) local_mem_234676)[squot64(warp_byte_offset_234674,\n                                                                             (int64_t) 8) +\n                                                                     sext_i32_i64(local_tid_234668)];\n                            if ((local_tid_234668 - squot32(local_tid_234668,\n                                                            32) * 32) == 0) {\n                                x_234730 = x_234731;\n                                flg_x_234733 = flg_y_234734;\n                            }\n                        }\n                        // in-block scan (hopefully no barriers needed)\n                        {\n                            skip_threads_234735 = 1;\n                            while (slt32(skip_threads_234735, 32)) {\n                                if (sle32(skip_threads_234735,\n                                          local_tid_234668 -\n                                          squot32(local_tid_234668, 32) * 32)) {\n                                    // read operands\n                                    {\n                                        flg_x_234733 = ((volatile __local\n                                                         int8_t *) local_mem_234676)[sext_i32_i64(local_tid_234668) -\n                                                                                     sext_i32_i64(skip_threads_234735)];\n                                        x_234730 = ((volatile __local\n                                                     double *) local_mem_234676)[squot64(warp_byte_offset_234",
            "674,\n                                                                                         (int64_t) 8) +\n                                                                                 (sext_i32_i64(local_tid_234668) -\n                                                                                  sext_i32_i64(skip_threads_234735))];\n                                    }\n                                    // perform operation\n                                    {\n                                        if (flg_y_234734 == (int8_t) 2 ||\n                                            flg_y_234734 == (int8_t) 0) {\n                                            flg_x_234733 = flg_y_234734;\n                                            x_234730 = x_234731;\n                                        } else {\n                                            double defunc_1_op_res_234732 =\n                                                   x_234730 + x_234731;\n                                            \n                                            x_234730 = defunc_1_op_res_234732;\n                                        }\n                                    }\n                                    // write result\n                                    {\n                                        ((volatile __local\n                                          int8_t *) local_mem_234676)[sext_i32_i64(local_tid_234668)] =\n                                            flg_x_234733;\n                                        flg_y_234734 = flg_x_234733;\n                                        ((volatile __local\n                                          double *) local_mem_234676)[squot64(warp_byte_offset_234674,\n                                                                              (int64_t) 8) +\n                                                                      sext_i32_i64(local_tid_234668)] =\n                                            x_234730;\n                                        x_23",
            "4731 = x_234730;\n                                    }\n                                }\n                                skip_threads_234735 *= 2;\n                            }\n                        }\n                    }\n                    flag_234729 = ((__local\n                                    int8_t *) local_mem_234676)[sext_i32_i64(wave_sizze_234670) -\n                                                                (int64_t) 1];\n                    aggr_234728 = ((__local\n                                    double *) local_mem_234676)[squot64(warp_byte_offset_234674,\n                                                                        (int64_t) 8) +\n                                                                (sext_i32_i64(wave_sizze_234670) -\n                                                                 (int64_t) 1)];\n                    if (flag_234729 == (int8_t) 2) {\n                        readOffset_234726 = wave_sizze_234670 * -1;\n                    } else {\n                        if (flag_234729 == (int8_t) 1) {\n                            readOffset_234726 -= wave_sizze_234670;\n                        }\n                    }\n                    if (slt8((int8_t) 0, flag_234729)) {\n                        double x_234736 = aggr_234728;\n                        double x_234737 = prefix_234722;\n                        double defunc_1_op_res_234738 = x_234736 + x_234737;\n                        \n                        prefix_234722 = defunc_1_op_res_234738;\n                    }\n                    mem_fence_local();\n                }\n            }\n            if (local_tid_234668 == 0) {\n                if (boundary_234686 == sext_i64_i32(segscan_group_sizze_218939 *\n                    (int64_t) 11)) {\n                    double x_234739 = prefix_234722;\n                    double x_234740 = acc_234709;\n                    double defunc_1_op_res_234741 = x_234739 + x_234740;\n                    \n                    ((volatile __global\n ",
            "                     double *) incprefixes_mem_234665)[dynamic_id_234683] =\n                        defunc_1_op_res_234741;\n                    mem_fence_global();\n                    ((volatile __global\n                      int8_t *) status_flags_mem_234661)[dynamic_id_234683] =\n                        (int8_t) 2;\n                }\n                ((__local\n                  double *) local_mem_234676)[squot64(warp_byte_offset_234674,\n                                                      (int64_t) 8)] =\n                    prefix_234722;\n                acc_234709 = 0.0;\n            }\n        }\n        if (!(dynamic_id_234683 == (int64_t) 0)) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            prefix_234722 = ((__local\n                              double *) local_mem_234676)[squot64(warp_byte_offset_234674,\n                                                                  (int64_t) 8)];\n            barrier(CLK_LOCAL_MEM_FENCE);\n        }\n    }\n    // Distribute results\n    {\n        double x_234742;\n        double x_234743;\n        double x_234745 = prefix_234722;\n        double x_234746 = acc_234709;\n        \n        if (slt32(local_tid_234668 * 11, boundary_234686) &&\n            !block_new_sgm_234723) {\n            double defunc_1_op_res_234747 = x_234745 + x_234746;\n            \n            x_234742 = defunc_1_op_res_234747;\n        } else {\n            x_234742 = acc_234709;\n        }\n        \n        int32_t stopping_point_234748 = segsizze_compact_234687 -\n                srem32(local_tid_234668 * 11 - 1 + segsizze_compact_234687 -\n                       boundary_234686, segsizze_compact_234687);\n        \n        for (int64_t i_234749 = 0; i_234749 < (int64_t) 11; i_234749++) {\n            if (slt32(sext_i64_i32(i_234749), stopping_point_234748 - 1)) {\n                x_234743 = private_mem_234688[i_234749];\n                \n                double defunc_1_op_res_234744 = x_234742 + x_234743;\n                \n                private_mem_234688[i_234749",
            "] = defunc_1_op_res_234744;\n            }\n        }\n    }\n    // Transpose scan output and Write it to global memory in coalesced fashion\n    {\n        for (int64_t i_234750 = 0; i_234750 < (int64_t) 11; i_234750++) {\n            int64_t sharedIdx_234751 = sext_i32_i64(local_tid_234668 * 11) +\n                    i_234750;\n            double tmp_234752;\n            \n            tmp_234752 = private_mem_234688[i_234750];\n            ((__local double *) local_mem_234676)[sharedIdx_234751] =\n                tmp_234752;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_234753 = 0; i_234753 < (int64_t) 11; i_234753++) {\n            int64_t flat_idx_234754 = blockOff_234684 +\n                    segscan_group_sizze_218939 * i_234753 +\n                    sext_i32_i64(local_tid_234668);\n            int64_t slice_234755 = n_203490;\n            int64_t slice_234756 = partition_sizze_203577 * slice_234755;\n            int64_t gtid_218943 = squot64(flat_idx_234754, slice_234755);\n            int64_t remnant_234757 = flat_idx_234754 - gtid_218943 *\n                    slice_234755;\n            int64_t gtid_218944 = remnant_234757;\n            int64_t remnant_234758 = remnant_234757 - gtid_218944;\n            \n            if (slt64(flat_idx_234754, partition_sizze_203577 * n_203490)) {\n                double tmp_234759;\n                \n                tmp_234759 = ((__local\n                               double *) local_mem_234676)[flat_idx_234754 -\n                                                           blockOff_234684];\n                ((__global double *) mem_230551)[gtid_218943 * n_203490 +\n                                                 gtid_218944] = tmp_234759;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    // If this is the last block, reset the dynamicId\n    {\n        if (dynamic_id_234683 == sdiv_up64(partition_sizze_203577 * n_203490,\n                                           segscan_group_sizze_218939 *\n            ",
            "                               (int64_t) 11) - (int64_t) 1) {\n            ((__global int32_t *) mainziid_counter_mem_234659)[(int64_t) 0] = 0;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_218939\n}\n__kernel void mainzisegscan_227915(__global int *global_failure,\n                                   uint local_mem_236721_backing_offset_0,\n                                   int64_t n_203490,\n                                   int64_t partition_sizze_203577,\n                                   unsigned char cond_f_res_227801_bits,\n                                   unsigned char cond_f_res_227802_bits,\n                                   int64_t unsign_arg_227803,\n                                   int64_t unsign_arg_227804, __global\n                                   unsigned char *mem_param_231733, __global\n                                   unsigned char *mem_231769, __global\n                                   unsigned char *mem_231773, __global\n                                   unsigned char *mem_231777, __global\n                                   unsigned char *mem_231781, __global\n                                   unsigned char *mem_231785, __global\n                                   unsigned char *mainziid_counter_mem_236686,\n                                   __global\n                                   unsigned char *status_flags_mem_236688,\n                                   __global\n                                   unsigned char *aggregates_mem_236690,\n                                   __global\n                                   unsigned char *incprefixes_mem_236692,\n                                   __global\n                                   unsigned char *aggregates_mem_236694,\n                                   __global\n                                   unsigned char *incprefixes_mem_236696,\n                                   __global\n                                   unsigned char *aggregates_mem_236698,\n                 ",
            "                  __global\n                                   unsigned char *incprefixes_mem_236700,\n                                   __global\n                                   unsigned char *aggregates_mem_236702,\n                                   __global\n                                   unsigned char *incprefixes_mem_236704)\n{\n    bool cond_f_res_227801 = cond_f_res_227801_bits;\n    bool cond_f_res_227802 = cond_f_res_227802_bits;\n    \n    #define segscan_group_sizze_227905 (mainzisegscan_group_sizze_227625)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *local_mem_236721_backing_0 =\n                           &shared_mem[local_mem_236721_backing_offset_0];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236706;\n    int32_t local_tid_236707;\n    int64_t group_sizze_236710;\n    int32_t wave_sizze_236709;\n    int32_t group_tid_236708;\n    \n    global_tid_236706 = get_global_id(0);\n    local_tid_236707 = get_local_id(0);\n    group_sizze_236710 = get_local_size(0);\n    wave_sizze_236709 = LOCKSTEP_WIDTH;\n    group_tid_236708 = get_group_id(0);\n    \n    int32_t phys_tid_227915 = global_tid_236706;\n    int64_t byte_offsets_236711 = (int64_t) 0;\n    int64_t byte_offsets_236712 = segscan_group_sizze_227905 * (int64_t) 8;\n    int64_t byte_offsets_236713 = sdiv_up64(segscan_group_sizze_227905 *\n                                            (int64_t) 8, (int64_t) 8) *\n            (int64_t) 8 + segscan_group_sizze_227905 * (int64_t) 8;\n    int64_t byte_offsets_236714 =\n            sdiv_up64(sdiv_up64(segscan_group_sizze_227905 * (int64_t) 8,\n                                (int64_t) 8) * (int64_t) 8 +\n                      segscan_group_sizze_227905 * (int64_t) 8, (int64_t) 8) *\n            (int64_t) 8 + segscan_group_sizze_227905 * (int64_t) 8;\n    int64_t byte_offsets_236715 =\n            sdiv_up64(sdiv_up64(sdiv_up64(segscan_group_sizze_227905 *\n                  ",
            "                        (int64_t) 8, (int64_t) 8) *\n                                (int64_t) 8 + segscan_group_sizze_227905 *\n                                (int64_t) 8, (int64_t) 8) * (int64_t) 8 +\n                      segscan_group_sizze_227905 * (int64_t) 8, (int64_t) 8) *\n            (int64_t) 8 + segscan_group_sizze_227905 * (int64_t) 8;\n    int64_t warp_byte_offset_236716 = (int64_t) 32;\n    int64_t warp_byte_offset_236717 = (int64_t) 288;\n    int64_t warp_byte_offset_236718 = (int64_t) 544;\n    int64_t warp_byte_offset_236719 = (int64_t) 800;\n    int64_t warp_byte_offset_236720 = (int64_t) 1056;\n    \n    // Allocate reused shared memeory\n    { }\n    \n    __local unsigned char *local_mem_236721;\n    \n    local_mem_236721 = (__local unsigned char *) local_mem_236721_backing_0;\n    \n    int64_t trans_arr_len_236722 = (int64_t) 3 * segscan_group_sizze_227905;\n    int32_t dynamic_id_236737;\n    \n    if (local_tid_236707 == 0) {\n        dynamic_id_236737 = atomic_add_i32_global(&((volatile __global\n                                                     int *) mainziid_counter_mem_236686)[(int64_t) 0],\n                                                  (int) 1);\n        ((__local int32_t *) local_mem_236721)[(int64_t) 0] = dynamic_id_236737;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    dynamic_id_236737 = ((__local int32_t *) local_mem_236721)[(int64_t) 0];\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t blockOff_236738 = sext_i32_i64(dynamic_id_236737) * (int64_t) 3 *\n            segscan_group_sizze_227905;\n    int64_t sgm_idx_236739 = smod64(blockOff_236738, n_203490);\n    int32_t boundary_236740 = sext_i64_i32(smin64((int64_t) 3 *\n                                                  segscan_group_sizze_227905,\n                                                  n_203490 - sgm_idx_236739));\n    int32_t segsizze_compact_236741 = sext_i64_i32(smin64((int64_t) 3 *\n                                                          segscan_group_sizze_227905,\n                     ",
            "                                     n_203490));\n    int64_t private_mem_236742[(int64_t) 3];\n    int64_t private_mem_236744[(int64_t) 3];\n    int64_t private_mem_236746[(int64_t) 3];\n    int64_t private_mem_236748[(int64_t) 3];\n    \n    // Load and map\n    {\n        for (int64_t i_236750 = 0; i_236750 < (int64_t) 3; i_236750++) {\n            int64_t phys_tid_236751 = blockOff_236738 +\n                    sext_i32_i64(local_tid_236707) + i_236750 *\n                    segscan_group_sizze_227905;\n            int64_t slice_236752 = n_203490;\n            int64_t slice_236753 = partition_sizze_203577 * slice_236752;\n            int64_t gtid_227913 = squot64(phys_tid_236751, slice_236752);\n            int64_t remnant_236754 = phys_tid_236751 - gtid_227913 *\n                    slice_236752;\n            int64_t gtid_227914 = remnant_236754;\n            int64_t remnant_236755 = remnant_236754 - gtid_227914;\n            \n            if (slt64(phys_tid_236751, partition_sizze_203577 * n_203490)) {\n                double x_227929;\n                \n                x_227929 = ((__global double *) mem_param_231733)[gtid_227913 *\n                                                                  n_203490 +\n                                                                  gtid_227914];\n                \n                int64_t i64_arg_227930;\n                \n                i64_arg_227930 = futrts_to_bits64(x_227929);\n                \n                int64_t unsign_arg_227931 = ashr64(i64_arg_227930,\n                                                   unsign_arg_227803);\n                int64_t unsign_arg_227932 = (int64_t) 1 & unsign_arg_227931;\n                int32_t to_i32_res_227933 = zext_i64_i32(unsign_arg_227932);\n                int64_t unsign_arg_227934 = ashr64(i64_arg_227930,\n                                                   (int64_t) 63);\n                int64_t unsign_arg_227935 = (int64_t) 1 & unsign_arg_227934;\n                int32_t to_i32_res_227936 = zext_i64_i3",
            "2(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_227801 && x_227938;\n                bool cond_227940 = cond_227937 || y_227939;\n                int32_t defunc_1_get_bit_res_227941;\n                \n                if (cond_227940) {\n                    int32_t defunc_1_get_bit_res_t_res_227942 = 1 ^\n                            to_i32_res_227933;\n                    \n                    defunc_1_get_bit_res_227941 =\n                        defunc_1_get_bit_res_t_res_227942;\n                } else {\n                    defunc_1_get_bit_res_227941 = to_i32_res_227933;\n                }\n                \n                int32_t x_227943 = mul32(2, defunc_1_get_bit_res_227941);\n                int64_t unsign_arg_227944 = ashr64(i64_arg_227930,\n                                                   unsign_arg_227804);\n                int64_t unsign_arg_227945 = (int64_t) 1 & unsign_arg_227944;\n                int32_t to_i32_res_227946 = zext_i64_i32(unsign_arg_227945);\n                bool y_227947 = cond_f_res_227802 && x_227938;\n                bool cond_227948 = cond_227937 || y_227947;\n                int32_t defunc_1_get_bit_res_227949;\n                \n                if (cond_227948) {\n                    int32_t defunc_1_get_bit_res_t_res_227950 = 1 ^\n                            to_i32_res_227946;\n                    \n                    defunc_1_get_bit_res_227949 =\n                        defunc_1_get_bit_res_t_res_227950;\n                } else {\n                    defunc_1_get_bit_res_227949 = to_i32_res_227946;\n                }\n                \n                int32_t defunc_0_f_res_227951 = add32(x_227943,\n                                                      defunc_1_get_bit_res_227949);\n                bool cond_227952 = defunc_0_f_res_227951 == 0;\n                int64_t defunc_0_f_res_227953 = btoi_bool_i64(cond_227952);\n                ",
            "int64_t defunc_0_f_res_227954;\n                int64_t defunc_0_f_res_227955;\n                int64_t defunc_0_f_res_227956;\n                \n                if (cond_227952) {\n                    defunc_0_f_res_227954 = (int64_t) 0;\n                    defunc_0_f_res_227955 = (int64_t) 0;\n                    defunc_0_f_res_227956 = (int64_t) 0;\n                } else {\n                    bool cond_227957 = defunc_0_f_res_227951 == 1;\n                    int64_t defunc_0_f_res_f_res_227958 =\n                            btoi_bool_i64(cond_227957);\n                    int64_t defunc_0_f_res_f_res_227959;\n                    int64_t defunc_0_f_res_f_res_227960;\n                    \n                    if (cond_227957) {\n                        defunc_0_f_res_f_res_227959 = (int64_t) 0;\n                        defunc_0_f_res_f_res_227960 = (int64_t) 0;\n                    } else {\n                        bool cond_227961 = defunc_0_f_res_227951 == 2;\n                        int64_t defunc_0_f_res_f_res_f_res_227962 =\n                                btoi_bool_i64(cond_227961);\n                        bool cond_neg_227963 = !cond_227961;\n                        int64_t defunc_0_f_res_f_res_f_res_227964 =\n                                btoi_bool_i64(cond_neg_227963);\n                        \n                        defunc_0_f_res_f_res_227959 =\n                            defunc_0_f_res_f_res_f_res_227962;\n                        defunc_0_f_res_f_res_227960 =\n                            defunc_0_f_res_f_res_f_res_227964;\n                    }\n                    defunc_0_f_res_227954 = defunc_0_f_res_f_res_227958;\n                    defunc_0_f_res_227955 = defunc_0_f_res_f_res_227959;\n                    defunc_0_f_res_227956 = defunc_0_f_res_f_res_227960;\n                }\n                ((__global int32_t *) mem_231785)[gtid_227913 * n_203490 +\n                                                  gtid_227914] =\n                    defunc_0_f_res_227951;\n                ",
            "private_mem_236742[i_236750] = defunc_0_f_res_227953;\n                private_mem_236744[i_236750] = defunc_0_f_res_227954;\n                private_mem_236746[i_236750] = defunc_0_f_res_227955;\n                private_mem_236748[i_236750] = defunc_0_f_res_227956;\n            } else {\n                private_mem_236742[i_236750] = (int64_t) 0;\n                private_mem_236744[i_236750] = (int64_t) 0;\n                private_mem_236746[i_236750] = (int64_t) 0;\n                private_mem_236748[i_236750] = (int64_t) 0;\n            }\n        }\n    }\n    // Transpose scan inputs\n    {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_236756 = 0; i_236756 < (int64_t) 3; i_236756++) {\n            int64_t sharedIdx_236757 = sext_i32_i64(local_tid_236707) +\n                    i_236756 * segscan_group_sizze_227905;\n            int64_t tmp_236758;\n            \n            tmp_236758 = private_mem_236742[i_236756];\n            ((__local int64_t *) local_mem_236721)[sharedIdx_236757] =\n                tmp_236758;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int32_t i_236759 = 0; i_236759 < 3; i_236759++) {\n            int32_t sharedIdx_236760 = local_tid_236707 * 3 + i_236759;\n            int64_t tmp_236761;\n            \n            tmp_236761 = ((__local\n                           int64_t *) local_mem_236721)[sext_i32_i64(sharedIdx_236760)];\n            private_mem_236742[sext_i32_i64(i_236759)] = tmp_236761;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_236762 = 0; i_236762 < (int64_t) 3; i_236762++) {\n            int64_t sharedIdx_236763 = sext_i32_i64(local_tid_236707) +\n                    i_236762 * segscan_group_sizze_227905;\n            int64_t tmp_236764;\n            \n            tmp_236764 = private_mem_236744[i_236762];\n            ((__local int64_t *) local_mem_236721)[sharedIdx_236763] =\n                tmp_236764;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int32_t i_236765 = 0; i_236765 < 3; ",
            "i_236765++) {\n            int32_t sharedIdx_236766 = local_tid_236707 * 3 + i_236765;\n            int64_t tmp_236767;\n            \n            tmp_236767 = ((__local\n                           int64_t *) local_mem_236721)[sext_i32_i64(sharedIdx_236766)];\n            private_mem_236744[sext_i32_i64(i_236765)] = tmp_236767;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_236768 = 0; i_236768 < (int64_t) 3; i_236768++) {\n            int64_t sharedIdx_236769 = sext_i32_i64(local_tid_236707) +\n                    i_236768 * segscan_group_sizze_227905;\n            int64_t tmp_236770;\n            \n            tmp_236770 = private_mem_236746[i_236768];\n            ((__local int64_t *) local_mem_236721)[sharedIdx_236769] =\n                tmp_236770;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int32_t i_236771 = 0; i_236771 < 3; i_236771++) {\n            int32_t sharedIdx_236772 = local_tid_236707 * 3 + i_236771;\n            int64_t tmp_236773;\n            \n            tmp_236773 = ((__local\n                           int64_t *) local_mem_236721)[sext_i32_i64(sharedIdx_236772)];\n            private_mem_236746[sext_i32_i64(i_236771)] = tmp_236773;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_236774 = 0; i_236774 < (int64_t) 3; i_236774++) {\n            int64_t sharedIdx_236775 = sext_i32_i64(local_tid_236707) +\n                    i_236774 * segscan_group_sizze_227905;\n            int64_t tmp_236776;\n            \n            tmp_236776 = private_mem_236748[i_236774];\n            ((__local int64_t *) local_mem_236721)[sharedIdx_236775] =\n                tmp_236776;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int32_t i_236777 = 0; i_236777 < 3; i_236777++) {\n            int32_t sharedIdx_236778 = local_tid_236707 * 3 + i_236777;\n            int64_t tmp_236779;\n            \n            tmp_236779 = ((__local\n                           int64_t *) local_mem_236721)[sext_i32_i64(sharedIdx_236778)];\n ",
            "           private_mem_236748[sext_i32_i64(i_236777)] = tmp_236779;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    // Per thread scan\n    {\n        int32_t gidx_236780 = local_tid_236707 * 3 + 1;\n        \n        for (int64_t i_236781 = 0; i_236781 < (int64_t) 2; i_236781++) {\n            bool new_sgm_236782 = smod32(gidx_236780 + sext_i64_i32(i_236781) -\n                                         boundary_236740,\n                                         segsizze_compact_236741) == 0;\n            \n            if (!new_sgm_236782) {\n                int64_t x_227916;\n                int64_t x_227920;\n                \n                x_227916 = private_mem_236742[i_236781];\n                x_227920 = private_mem_236742[i_236781 + (int64_t) 1];\n                \n                int64_t x_227917;\n                int64_t x_227921;\n                \n                x_227917 = private_mem_236744[i_236781];\n                x_227921 = private_mem_236744[i_236781 + (int64_t) 1];\n                \n                int64_t x_227918;\n                int64_t x_227922;\n                \n                x_227918 = private_mem_236746[i_236781];\n                x_227922 = private_mem_236746[i_236781 + (int64_t) 1];\n                \n                int64_t x_227919;\n                int64_t x_227923;\n                \n                x_227919 = private_mem_236748[i_236781];\n                x_227923 = private_mem_236748[i_236781 + (int64_t) 1];\n                \n                int64_t defunc_1_op_res_227924 = add64(x_227916, x_227920);\n                int64_t defunc_1_op_res_227925 = add64(x_227917, x_227921);\n                int64_t defunc_1_op_res_227926 = add64(x_227918, x_227922);\n                int64_t defunc_1_op_res_227927 = add64(x_227919, x_227923);\n                \n                private_mem_236742[i_236781 + (int64_t) 1] =\n                    defunc_1_op_res_227924;\n                private_mem_236744[i_236781 + (int64_t) 1] =\n                    defunc_1_op_res_227925;\n  ",
            "              private_mem_236746[i_236781 + (int64_t) 1] =\n                    defunc_1_op_res_227926;\n                private_mem_236748[i_236781 + (int64_t) 1] =\n                    defunc_1_op_res_227927;\n            }\n        }\n    }\n    // Publish results in shared memory\n    {\n        int64_t tmp_236783;\n        \n        tmp_236783 = private_mem_236742[(int64_t) 2];\n        ((__local int64_t *) local_mem_236721)[squot64(byte_offsets_236711,\n                                                       (int64_t) 8) +\n                                               sext_i32_i64(local_tid_236707)] =\n            tmp_236783;\n        \n        int64_t tmp_236784;\n        \n        tmp_236784 = private_mem_236744[(int64_t) 2];\n        ((__local int64_t *) local_mem_236721)[squot64(byte_offsets_236712,\n                                                       (int64_t) 8) +\n                                               sext_i32_i64(local_tid_236707)] =\n            tmp_236784;\n        \n        int64_t tmp_236785;\n        \n        tmp_236785 = private_mem_236746[(int64_t) 2];\n        ((__local int64_t *) local_mem_236721)[squot64(byte_offsets_236713,\n                                                       (int64_t) 8) +\n                                               sext_i32_i64(local_tid_236707)] =\n            tmp_236785;\n        \n        int64_t tmp_236786;\n        \n        tmp_236786 = private_mem_236748[(int64_t) 2];\n        ((__local int64_t *) local_mem_236721)[squot64(byte_offsets_236714,\n                                                       (int64_t) 8) +\n                                               sext_i32_i64(local_tid_236707)] =\n            tmp_236786;\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    \n    int64_t acc_236799;\n    int64_t acc_236800;\n    int64_t acc_236801;\n    int64_t acc_236802;\n    \n    // Scan results (with warp scan)\n    {\n        int64_t x_236787;\n        int64_t x_236788;\n        int64_t x_236789;\n        int64_t x_236790;\n        int64_t x_236791",
            ";\n        int64_t x_236792;\n        int64_t x_236793;\n        int64_t x_236794;\n        int64_t x_236803;\n        int64_t x_236804;\n        int64_t x_236805;\n        int64_t x_236806;\n        int64_t x_236807;\n        int64_t x_236808;\n        int64_t x_236809;\n        int64_t x_236810;\n        bool ltid_in_bounds_236815 = slt64(sext_i32_i64(local_tid_236707),\n                                           segscan_group_sizze_227905);\n        int32_t skip_threads_236816;\n        \n        // read input for in-block scan\n        {\n            if (ltid_in_bounds_236815) {\n                x_236791 = ((volatile __local\n                             int64_t *) local_mem_236721)[squot64(byte_offsets_236711,\n                                                                  (int64_t) 8) +\n                                                          sext_i32_i64(local_tid_236707)];\n                x_236792 = ((volatile __local\n                             int64_t *) local_mem_236721)[squot64(byte_offsets_236712,\n                                                                  (int64_t) 8) +\n                                                          sext_i32_i64(local_tid_236707)];\n                x_236793 = ((volatile __local\n                             int64_t *) local_mem_236721)[squot64(byte_offsets_236713,\n                                                                  (int64_t) 8) +\n                                                          sext_i32_i64(local_tid_236707)];\n                x_236794 = ((volatile __local\n                             int64_t *) local_mem_236721)[squot64(byte_offsets_236714,\n                                                                  (int64_t) 8) +\n                                                          sext_i32_i64(local_tid_236707)];\n                if ((local_tid_236707 - squot32(local_tid_236707, 32) * 32) ==\n                    0) {\n                    x_236787 = x_236791;\n                    x_236788 = x_236792;\n                    x_",
            "236789 = x_236793;\n                    x_236790 = x_236794;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_236816 = 1;\n            while (slt32(skip_threads_236816, 32)) {\n                bool thread_active_236817 = sle32(skip_threads_236816,\n                                                  local_tid_236707 -\n                                                  squot32(local_tid_236707,\n                                                          32) * 32) &&\n                     ltid_in_bounds_236815;\n                \n                if (thread_active_236817) {\n                    // read operands\n                    {\n                        x_236787 = ((volatile __local\n                                     int64_t *) local_mem_236721)[squot64(byte_offsets_236711,\n                                                                          (int64_t) 8) +\n                                                                  (sext_i32_i64(local_tid_236707) -\n                                                                   sext_i32_i64(skip_threads_236816))];\n                        x_236788 = ((volatile __local\n                                     int64_t *) local_mem_236721)[squot64(byte_offsets_236712,\n                                                                          (int64_t) 8) +\n                                                                  (sext_i32_i64(local_tid_236707) -\n                                                                   sext_i32_i64(skip_threads_236816))];\n                        x_236789 = ((volatile __local\n                                     int64_t *) local_mem_236721)[squot64(byte_offsets_236713,\n                                                                          (int64_t) 8) +\n                                                                  (sext_i32_i64(local_tid_236707) -\n                                                                   se",
            "xt_i32_i64(skip_threads_236816))];\n                        x_236790 = ((volatile __local\n                                     int64_t *) local_mem_236721)[squot64(byte_offsets_236714,\n                                                                          (int64_t) 8) +\n                                                                  (sext_i32_i64(local_tid_236707) -\n                                                                   sext_i32_i64(skip_threads_236816))];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_236818 = slt32(smod32((local_tid_236707 + 1) *\n                                                        3 - 1 +\n                                                        segsizze_compact_236741 -\n                                                        boundary_236740,\n                                                        segsizze_compact_236741),\n                                                 (local_tid_236707 + 1) * 3 -\n                                                 1 - ((local_tid_236707 -\n                                                       skip_threads_236816 +\n                                                       1) * 3 - 1));\n                    \n                    if (thread_active_236817 && inactive_236818) {\n                        x_236787 = x_236791;\n                        x_236788 = x_236792;\n                        x_236789 = x_236793;\n                        x_236790 = x_236794;\n                    }\n                    if (thread_active_236817) {\n                        if (!inactive_236818) {\n                            int64_t defunc_1_op_res_236795 = add64(x_236787,\n                                                                   x_236791);\n                            int64_t defunc_1_op_res_236796 = add64(x_236788,\n                                                                   x_236792);\n                            int64_t defunc_1_op_res_",
            "236797 = add64(x_236789,\n                                                                   x_236793);\n                            int64_t defunc_1_op_res_236798 = add64(x_236790,\n                                                                   x_236794);\n                            \n                            x_236787 = defunc_1_op_res_236795;\n                            x_236788 = defunc_1_op_res_236796;\n                            x_236789 = defunc_1_op_res_236797;\n                            x_236790 = defunc_1_op_res_236798;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_236709, skip_threads_236816)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_236817) {\n                    // write result\n                    {\n                        ((volatile __local\n                          int64_t *) local_mem_236721)[squot64(byte_offsets_236711,\n                                                               (int64_t) 8) +\n                                                       sext_i32_i64(local_tid_236707)] =\n                            x_236787;\n                        x_236791 = x_236787;\n                        ((volatile __local\n                          int64_t *) local_mem_236721)[squot64(byte_offsets_236712,\n                                                               (int64_t) 8) +\n                                                       sext_i32_i64(local_tid_236707)] =\n                            x_236788;\n                        x_236792 = x_236788;\n                        ((volatile __local\n                          int64_t *) local_mem_236721)[squot64(byte_offsets_236713,\n                                                               (int64_t) 8) +\n                                                       sext_i32_i64(local_tid_236707)] =\n                            x_236789;\n                        x_236793 = x_236789;\n                        (",
            "(volatile __local\n                          int64_t *) local_mem_236721)[squot64(byte_offsets_236714,\n                                                               (int64_t) 8) +\n                                                       sext_i32_i64(local_tid_236707)] =\n                            x_236790;\n                        x_236794 = x_236790;\n                    }\n                }\n                if (sle32(wave_sizze_236709, skip_threads_236816)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_236816 *= 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_236707 - squot32(local_tid_236707, 32) * 32) == 31 &&\n                ltid_in_bounds_236815) {\n                ((volatile __local\n                  int64_t *) local_mem_236721)[squot64(byte_offsets_236711,\n                                                       (int64_t) 8) +\n                                               sext_i32_i64(squot32(local_tid_236707,\n                                                                    32))] =\n                    x_236787;\n                ((volatile __local\n                  int64_t *) local_mem_236721)[squot64(byte_offsets_236712,\n                                                       (int64_t) 8) +\n                                               sext_i32_i64(squot32(local_tid_236707,\n                                                                    32))] =\n                    x_236788;\n                ((volatile __local\n                  int64_t *) local_mem_236721)[squot64(byte_offsets_236713,\n                                                       (int64_t) 8) +\n                                               sext_i32_i64(squot32(local_tid_236707,\n                                                                    32))] =\n                    x_236789;\n                ((volatile __local\n             ",
            "     int64_t *) local_mem_236721)[squot64(byte_offsets_236714,\n                                                       (int64_t) 8) +\n                                               sext_i32_i64(squot32(local_tid_236707,\n                                                                    32))] =\n                    x_236790;\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_236819;\n            \n            // read input for in-block scan\n            {\n                if (squot32(local_tid_236707, 32) == 0 &&\n                    ltid_in_bounds_236815) {\n                    x_236807 = ((volatile __local\n                                 int64_t *) local_mem_236721)[squot64(byte_offsets_236711,\n                                                                      (int64_t) 8) +\n                                                              sext_i32_i64(local_tid_236707)];\n                    x_236808 = ((volatile __local\n                                 int64_t *) local_mem_236721)[squot64(byte_offsets_236712,\n                                                                      (int64_t) 8) +\n                                                              sext_i32_i64(local_tid_236707)];\n                    x_236809 = ((volatile __local\n                                 int64_t *) local_mem_236721)[squot64(byte_offsets_236713,\n                                                                      (int64_t) 8) +\n                                                              sext_i32_i64(local_tid_236707)];\n                    x_236810 = ((volatile __local\n                                 int64_t *) local_mem_236721)[squot64(byte_offsets_236714,\n                                                                      (int64_t) 8) +\n                                                              sext_i32_i64(local_tid_236707)];\n              ",
            "      if ((local_tid_236707 - squot32(local_tid_236707, 32) *\n                         32) == 0) {\n                        x_236803 = x_236807;\n                        x_236804 = x_236808;\n                        x_236805 = x_236809;\n                        x_236806 = x_236810;\n                    }\n                }\n            }\n            // in-block scan (hopefully no barriers needed)\n            {\n                skip_threads_236819 = 1;\n                while (slt32(skip_threads_236819, 32)) {\n                    bool thread_active_236820 = sle32(skip_threads_236819,\n                                                      local_tid_236707 -\n                                                      squot32(local_tid_236707,\n                                                              32) * 32) &&\n                         (squot32(local_tid_236707, 32) == 0 &&\n                          ltid_in_bounds_236815);\n                    \n                    if (thread_active_236820) {\n                        // read operands\n                        {\n                            x_236803 = ((volatile __local\n                                         int64_t *) local_mem_236721)[squot64(byte_offsets_236711,\n                                                                              (int64_t) 8) +\n                                                                      (sext_i32_i64(local_tid_236707) -\n                                                                       sext_i32_i64(skip_threads_236819))];\n                            x_236804 = ((volatile __local\n                                         int64_t *) local_mem_236721)[squot64(byte_offsets_236712,\n                                                                              (int64_t) 8) +\n                                                                      (sext_i32_i64(local_tid_236707) -\n                                                                       sext_i32_i64(skip_threads_236819))];\n                  ",
            "          x_236805 = ((volatile __local\n                                         int64_t *) local_mem_236721)[squot64(byte_offsets_236713,\n                                                                              (int64_t) 8) +\n                                                                      (sext_i32_i64(local_tid_236707) -\n                                                                       sext_i32_i64(skip_threads_236819))];\n                            x_236806 = ((volatile __local\n                                         int64_t *) local_mem_236721)[squot64(byte_offsets_236714,\n                                                                              (int64_t) 8) +\n                                                                      (sext_i32_i64(local_tid_236707) -\n                                                                       sext_i32_i64(skip_threads_236819))];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_236821 = slt32(smod32((local_tid_236707 *\n                                                             32 + 32 - 1 + 1) *\n                                                            3 - 1 +\n                                                            segsizze_compact_236741 -\n                                                            boundary_236740,\n                                                            segsizze_compact_236741),\n                                                     (local_tid_236707 * 32 +\n                                                      32 - 1 + 1) * 3 - 1 -\n                                                     (((local_tid_236707 -\n                                                        skip_threads_236819) *\n                                                       32 + 32 - 1 + 1) * 3 -\n                                                      1));\n                        \n                        if (thread_a",
            "ctive_236820 && inactive_236821) {\n                            x_236803 = x_236807;\n                            x_236804 = x_236808;\n                            x_236805 = x_236809;\n                            x_236806 = x_236810;\n                        }\n                        if (thread_active_236820) {\n                            if (!inactive_236821) {\n                                int64_t defunc_1_op_res_236811 = add64(x_236803,\n                                                                       x_236807);\n                                int64_t defunc_1_op_res_236812 = add64(x_236804,\n                                                                       x_236808);\n                                int64_t defunc_1_op_res_236813 = add64(x_236805,\n                                                                       x_236809);\n                                int64_t defunc_1_op_res_236814 = add64(x_236806,\n                                                                       x_236810);\n                                \n                                x_236803 = defunc_1_op_res_236811;\n                                x_236804 = defunc_1_op_res_236812;\n                                x_236805 = defunc_1_op_res_236813;\n                                x_236806 = defunc_1_op_res_236814;\n                            }\n                        }\n                    }\n                    if (sle32(wave_sizze_236709, skip_threads_236819)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    if (thread_active_236820) {\n                        // write result\n                        {\n                            ((volatile __local\n                              int64_t *) local_mem_236721)[squot64(byte_offsets_236711,\n                                                                   (int64_t) 8) +\n                                                           sext_i32_i64(local_tid_236707)] =\n                                x_2",
            "36803;\n                            x_236807 = x_236803;\n                            ((volatile __local\n                              int64_t *) local_mem_236721)[squot64(byte_offsets_236712,\n                                                                   (int64_t) 8) +\n                                                           sext_i32_i64(local_tid_236707)] =\n                                x_236804;\n                            x_236808 = x_236804;\n                            ((volatile __local\n                              int64_t *) local_mem_236721)[squot64(byte_offsets_236713,\n                                                                   (int64_t) 8) +\n                                                           sext_i32_i64(local_tid_236707)] =\n                                x_236805;\n                            x_236809 = x_236805;\n                            ((volatile __local\n                              int64_t *) local_mem_236721)[squot64(byte_offsets_236714,\n                                                                   (int64_t) 8) +\n                                                           sext_i32_i64(local_tid_236707)] =\n                                x_236806;\n                            x_236810 = x_236806;\n                        }\n                    }\n                    if (sle32(wave_sizze_236709, skip_threads_236819)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    skip_threads_236819 *= 2;\n                }\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        bool no_carry_in_236822 = squot32(local_tid_236707, 32) == 0 ||\n             !ltid_in_bounds_236815;\n        \n        // carry-in for every block except the first\n        {\n            // read operands\n            {\n                if (!no_carry_in_236822) {\n                    x_236791 = x_236787;\n                    x_236792 = x_236788;\n                    x_236793 = x_236789;\n                   ",
            " x_236794 = x_236790;\n                    x_236787 = ((__local\n                                 int64_t *) local_mem_236721)[squot64(byte_offsets_236711,\n                                                                      (int64_t) 8) +\n                                                              (sext_i32_i64(squot32(local_tid_236707,\n                                                                                    32)) -\n                                                               (int64_t) 1)];\n                    x_236788 = ((__local\n                                 int64_t *) local_mem_236721)[squot64(byte_offsets_236712,\n                                                                      (int64_t) 8) +\n                                                              (sext_i32_i64(squot32(local_tid_236707,\n                                                                                    32)) -\n                                                               (int64_t) 1)];\n                    x_236789 = ((__local\n                                 int64_t *) local_mem_236721)[squot64(byte_offsets_236713,\n                                                                      (int64_t) 8) +\n                                                              (sext_i32_i64(squot32(local_tid_236707,\n                                                                                    32)) -\n                                                               (int64_t) 1)];\n                    x_236790 = ((__local\n                                 int64_t *) local_mem_236721)[squot64(byte_offsets_236714,\n                                                                      (int64_t) 8) +\n                                                              (sext_i32_i64(squot32(local_tid_236707,\n                                                                                    32)) -\n                                                               (int64_t) 1)];\n                }\n        ",
            "    }\n            // perform operation\n            {\n                bool inactive_236823 = slt32(smod32((local_tid_236707 + 1) * 3 -\n                                                    1 +\n                                                    segsizze_compact_236741 -\n                                                    boundary_236740,\n                                                    segsizze_compact_236741),\n                                             (local_tid_236707 + 1) * 3 - 1 -\n                                             ((squot32(local_tid_236707, 32) *\n                                               32 - 1 + 1) * 3 - 1));\n                \n                if (!no_carry_in_236822) {\n                    if (inactive_236823) {\n                        x_236787 = x_236791;\n                        x_236788 = x_236792;\n                        x_236789 = x_236793;\n                        x_236790 = x_236794;\n                    }\n                }\n                if (!no_carry_in_236822) {\n                    if (!inactive_236823) {\n                        int64_t defunc_1_op_res_236795 = add64(x_236787,\n                                                               x_236791);\n                        int64_t defunc_1_op_res_236796 = add64(x_236788,\n                                                               x_236792);\n                        int64_t defunc_1_op_res_236797 = add64(x_236789,\n                                                               x_236793);\n                        int64_t defunc_1_op_res_236798 = add64(x_236790,\n                                                               x_236794);\n                        \n                        x_236787 = defunc_1_op_res_236795;\n                        x_236788 = defunc_1_op_res_236796;\n                        x_236789 = defunc_1_op_res_236797;\n                        x_236790 = defunc_1_op_res_236798;\n                    }\n                }\n            }\n            // write final result\n           ",
            " {\n                if (!no_carry_in_236822) {\n                    ((__local\n                      int64_t *) local_mem_236721)[squot64(byte_offsets_236711,\n                                                           (int64_t) 8) +\n                                                   sext_i32_i64(local_tid_236707)] =\n                        x_236787;\n                    ((__local\n                      int64_t *) local_mem_236721)[squot64(byte_offsets_236712,\n                                                           (int64_t) 8) +\n                                                   sext_i32_i64(local_tid_236707)] =\n                        x_236788;\n                    ((__local\n                      int64_t *) local_mem_236721)[squot64(byte_offsets_236713,\n                                                           (int64_t) 8) +\n                                                   sext_i32_i64(local_tid_236707)] =\n                        x_236789;\n                    ((__local\n                      int64_t *) local_mem_236721)[squot64(byte_offsets_236714,\n                                                           (int64_t) 8) +\n                                                   sext_i32_i64(local_tid_236707)] =\n                        x_236790;\n                }\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // restore correct values for first block\n        {\n            if (squot32(local_tid_236707, 32) == 0 && ltid_in_bounds_236815) {\n                ((__local\n                  int64_t *) local_mem_236721)[squot64(byte_offsets_236711,\n                                                       (int64_t) 8) +\n                                               sext_i32_i64(local_tid_236707)] =\n                    x_236791;\n                ((__local\n                  int64_t *) local_mem_236721)[squot64(byte_offsets_236712,\n                                                       (int64_t) 8) +\n                                               sext_i32_i64(local_ti",
            "d_236707)] =\n                    x_236792;\n                ((__local\n                  int64_t *) local_mem_236721)[squot64(byte_offsets_236713,\n                                                       (int64_t) 8) +\n                                               sext_i32_i64(local_tid_236707)] =\n                    x_236793;\n                ((__local\n                  int64_t *) local_mem_236721)[squot64(byte_offsets_236714,\n                                                       (int64_t) 8) +\n                                               sext_i32_i64(local_tid_236707)] =\n                    x_236794;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (local_tid_236707 == 0) {\n            acc_236799 = ((__local\n                           int64_t *) local_mem_236721)[squot64(byte_offsets_236711,\n                                                                (int64_t) 8) +\n                                                        (segscan_group_sizze_227905 -\n                                                         (int64_t) 1)];\n            acc_236800 = ((__local\n                           int64_t *) local_mem_236721)[squot64(byte_offsets_236712,\n                                                                (int64_t) 8) +\n                                                        (segscan_group_sizze_227905 -\n                                                         (int64_t) 1)];\n            acc_236801 = ((__local\n                           int64_t *) local_mem_236721)[squot64(byte_offsets_236713,\n                                                                (int64_t) 8) +\n                                                        (segscan_group_sizze_227905 -\n                                                         (int64_t) 1)];\n            acc_236802 = ((__local\n                           int64_t *) local_mem_236721)[squot64(byte_offsets_236714,\n                                                               ",
            " (int64_t) 8) +\n                                                        (segscan_group_sizze_227905 -\n                                                         (int64_t) 1)];\n        } else {\n            acc_236799 = ((__local\n                           int64_t *) local_mem_236721)[squot64(byte_offsets_236711,\n                                                                (int64_t) 8) +\n                                                        (sext_i32_i64(local_tid_236707) -\n                                                         (int64_t) 1)];\n            acc_236800 = ((__local\n                           int64_t *) local_mem_236721)[squot64(byte_offsets_236712,\n                                                                (int64_t) 8) +\n                                                        (sext_i32_i64(local_tid_236707) -\n                                                         (int64_t) 1)];\n            acc_236801 = ((__local\n                           int64_t *) local_mem_236721)[squot64(byte_offsets_236713,\n                                                                (int64_t) 8) +\n                                                        (sext_i32_i64(local_tid_236707) -\n                                                         (int64_t) 1)];\n            acc_236802 = ((__local\n                           int64_t *) local_mem_236721)[squot64(byte_offsets_236714,\n                                                                (int64_t) 8) +\n                                                        (sext_i32_i64(local_tid_236707) -\n                                                         (int64_t) 1)];\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    \n    int64_t prefix_236824 = (int64_t) 0;\n    int64_t prefix_236825 = (int64_t) 0;\n    int64_t prefix_236826 = (int64_t) 0;\n    int64_t prefix_236827 = (int64_t) 0;\n    bool block_new_sgm_236828 = sgm_idx_236739 == (int64_t) 0;\n    \n    // Perform lookback\n    {\n        if (block_new_sgm_236828 && local_ti",
            "d_236707 == 0) {\n            ((volatile __global\n              int64_t *) incprefixes_mem_236692)[dynamic_id_236737] =\n                acc_236799;\n            ((volatile __global\n              int64_t *) incprefixes_mem_236696)[dynamic_id_236737] =\n                acc_236800;\n            ((volatile __global\n              int64_t *) incprefixes_mem_236700)[dynamic_id_236737] =\n                acc_236801;\n            ((volatile __global\n              int64_t *) incprefixes_mem_236704)[dynamic_id_236737] =\n                acc_236802;\n            mem_fence_global();\n            ((volatile __global\n              int8_t *) status_flags_mem_236688)[dynamic_id_236737] =\n                (int8_t) 2;\n            acc_236799 = (int64_t) 0;\n            acc_236800 = (int64_t) 0;\n            acc_236801 = (int64_t) 0;\n            acc_236802 = (int64_t) 0;\n        }\n        if (!block_new_sgm_236828 && slt32(local_tid_236707,\n                                           wave_sizze_236709)) {\n            if (local_tid_236707 == 0) {\n                if (boundary_236740 == sext_i64_i32(segscan_group_sizze_227905 *\n                    (int64_t) 3)) {\n                    ((volatile __global\n                      int64_t *) aggregates_mem_236690)[dynamic_id_236737] =\n                        acc_236799;\n                    ((volatile __global\n                      int64_t *) aggregates_mem_236694)[dynamic_id_236737] =\n                        acc_236800;\n                    ((volatile __global\n                      int64_t *) aggregates_mem_236698)[dynamic_id_236737] =\n                        acc_236801;\n                    ((volatile __global\n                      int64_t *) aggregates_mem_236702)[dynamic_id_236737] =\n                        acc_236802;\n                    mem_fence_global();\n                    ((volatile __global\n                      int8_t *) status_flags_mem_236688)[dynamic_id_236737] =\n                        (int8_t) 1;\n                } else {\n                    ((vo",
            "latile __global\n                      int64_t *) incprefixes_mem_236692)[dynamic_id_236737] =\n                        acc_236799;\n                    ((volatile __global\n                      int64_t *) incprefixes_mem_236696)[dynamic_id_236737] =\n                        acc_236800;\n                    ((volatile __global\n                      int64_t *) incprefixes_mem_236700)[dynamic_id_236737] =\n                        acc_236801;\n                    ((volatile __global\n                      int64_t *) incprefixes_mem_236704)[dynamic_id_236737] =\n                        acc_236802;\n                    mem_fence_global();\n                    ((volatile __global\n                      int8_t *) status_flags_mem_236688)[dynamic_id_236737] =\n                        (int8_t) 2;\n                }\n                \n                int8_t tmp_236829;\n                \n                tmp_236829 = ((volatile __global\n                               int8_t *) status_flags_mem_236688)[dynamic_id_236737 -\n                                                                  (int64_t) 1];\n                ((volatile __local int8_t *) local_mem_236721)[(int64_t) 0] =\n                    tmp_236829;\n            }\n            mem_fence_local();\n            \n            int8_t status_236830;\n            \n            status_236830 = ((__local int8_t *) local_mem_236721)[(int64_t) 0];\n            if (status_236830 == (int8_t) 2) {\n                if (local_tid_236707 == 0) {\n                    prefix_236824 = ((volatile __global\n                                      int64_t *) incprefixes_mem_236692)[dynamic_id_236737 -\n                                                                         (int64_t) 1];\n                    prefix_236825 = ((volatile __global\n                                      int64_t *) incprefixes_mem_236696)[dynamic_id_236737 -\n                                                                         (int64_t) 1];\n                    prefix_236826 = ((volatile __glob",
            "al\n                                      int64_t *) incprefixes_mem_236700)[dynamic_id_236737 -\n                                                                         (int64_t) 1];\n                    prefix_236827 = ((volatile __global\n                                      int64_t *) incprefixes_mem_236704)[dynamic_id_236737 -\n                                                                         (int64_t) 1];\n                }\n            } else {\n                int32_t readOffset_236831 = dynamic_id_236737 -\n                        sext_i32_i64(wave_sizze_236709);\n                \n                while (slt32(wave_sizze_236709 * -1, readOffset_236831)) {\n                    int32_t read_i_236832 = readOffset_236831 +\n                            local_tid_236707;\n                    int64_t aggr_236833 = (int64_t) 0;\n                    int64_t aggr_236834 = (int64_t) 0;\n                    int64_t aggr_236835 = (int64_t) 0;\n                    int64_t aggr_236836 = (int64_t) 0;\n                    int8_t flag_236837 = (int8_t) 0;\n                    \n                    if (sle32(0, read_i_236832)) {\n                        if (sle64(blockOff_236738 -\n                                  (sext_i32_i64(read_i_236832 + 1) *\n                                   segscan_group_sizze_227905 * (int64_t) 3 -\n                                   (int64_t) 1), sgm_idx_236739)) {\n                            flag_236837 = ((volatile __global\n                                            int8_t *) status_flags_mem_236688)[sext_i32_i64(read_i_236832)];\n                            if (flag_236837 == (int8_t) 2) {\n                                aggr_236833 = ((volatile __global\n                                                int64_t *) incprefixes_mem_236692)[sext_i32_i64(read_i_236832)];\n                                aggr_236834 = ((volatile __global\n                                                int64_t *) incprefixes_mem_236696)[sext_i32_i64(read_i_236832)];\n                 ",
            "               aggr_236835 = ((volatile __global\n                                                int64_t *) incprefixes_mem_236700)[sext_i32_i64(read_i_236832)];\n                                aggr_236836 = ((volatile __global\n                                                int64_t *) incprefixes_mem_236704)[sext_i32_i64(read_i_236832)];\n                            } else {\n                                if (flag_236837 == (int8_t) 1) {\n                                    aggr_236833 = ((volatile __global\n                                                    int64_t *) aggregates_mem_236690)[sext_i32_i64(read_i_236832)];\n                                    aggr_236834 = ((volatile __global\n                                                    int64_t *) aggregates_mem_236694)[sext_i32_i64(read_i_236832)];\n                                    aggr_236835 = ((volatile __global\n                                                    int64_t *) aggregates_mem_236698)[sext_i32_i64(read_i_236832)];\n                                    aggr_236836 = ((volatile __global\n                                                    int64_t *) aggregates_mem_236702)[sext_i32_i64(read_i_236832)];\n                                }\n                            }\n                        } else {\n                            flag_236837 = (int8_t) 2;\n                        }\n                    }\n                    ((__local\n                      int64_t *) local_mem_236721)[squot64(warp_byte_offset_236716,\n                                                           (int64_t) 8) +\n                                                   sext_i32_i64(local_tid_236707)] =\n                        aggr_236833;\n                    ((__local\n                      int64_t *) local_mem_236721)[squot64(warp_byte_offset_236717,\n                                                           (int64_t) 8) +\n                                                   sext_i32_i64(local_tid_236707)] =\n                        aggr_23",
            "6834;\n                    ((__local\n                      int64_t *) local_mem_236721)[squot64(warp_byte_offset_236718,\n                                                           (int64_t) 8) +\n                                                   sext_i32_i64(local_tid_236707)] =\n                        aggr_236835;\n                    ((__local\n                      int64_t *) local_mem_236721)[squot64(warp_byte_offset_236719,\n                                                           (int64_t) 8) +\n                                                   sext_i32_i64(local_tid_236707)] =\n                        aggr_236836;\n                    ((__local\n                      int8_t *) local_mem_236721)[sext_i32_i64(local_tid_236707)] =\n                        flag_236837;\n                    flag_236837 = ((__local\n                                    int8_t *) local_mem_236721)[sext_i32_i64(wave_sizze_236709) -\n                                                                (int64_t) 1];\n                    if (slt8(flag_236837, (int8_t) 2)) {\n                        int8_t flg_x_236850;\n                        int8_t flg_y_236851;\n                        int64_t x_236838;\n                        int64_t x_236839;\n                        int64_t x_236840;\n                        int64_t x_236841;\n                        int64_t x_236842;\n                        int64_t x_236843;\n                        int64_t x_236844;\n                        int64_t x_236845;\n                        int32_t skip_threads_236852;\n                        \n                        // read input for in-block scan\n                        {\n                            flg_y_236851 = ((volatile __local\n                                             int8_t *) local_mem_236721)[sext_i32_i64(local_tid_236707)];\n                            x_236842 = ((volatile __local\n                                         int64_t *) local_mem_236721)[squot64(warp_byte_offset_236716,\n                               ",
            "                                               (int64_t) 8) +\n                                                                      sext_i32_i64(local_tid_236707)];\n                            x_236843 = ((volatile __local\n                                         int64_t *) local_mem_236721)[squot64(warp_byte_offset_236717,\n                                                                              (int64_t) 8) +\n                                                                      sext_i32_i64(local_tid_236707)];\n                            x_236844 = ((volatile __local\n                                         int64_t *) local_mem_236721)[squot64(warp_byte_offset_236718,\n                                                                              (int64_t) 8) +\n                                                                      sext_i32_i64(local_tid_236707)];\n                            x_236845 = ((volatile __local\n                                         int64_t *) local_mem_236721)[squot64(warp_byte_offset_236719,\n                                                                              (int64_t) 8) +\n                                                                      sext_i32_i64(local_tid_236707)];\n                            if ((local_tid_236707 - squot32(local_tid_236707,\n                                                            32) * 32) == 0) {\n                                x_236838 = x_236842;\n                                x_236839 = x_236843;\n                                x_236840 = x_236844;\n                                x_236841 = x_236845;\n                                flg_x_236850 = flg_y_236851;\n                            }\n                        }\n                        // in-block scan (hopefully no barriers needed)\n                        {\n                            skip_threads_236852 = 1;\n                            while (slt32(skip_threads_236852, 32)) {\n                                if (sle32(skip_threads_2368",
            "52,\n                                          local_tid_236707 -\n                                          squot32(local_tid_236707, 32) * 32)) {\n                                    // read operands\n                                    {\n                                        flg_x_236850 = ((volatile __local\n                                                         int8_t *) local_mem_236721)[sext_i32_i64(local_tid_236707) -\n                                                                                     sext_i32_i64(skip_threads_236852)];\n                                        x_236838 = ((volatile __local\n                                                     int64_t *) local_mem_236721)[squot64(warp_byte_offset_236716,\n                                                                                          (int64_t) 8) +\n                                                                                  (sext_i32_i64(local_tid_236707) -\n                                                                                   sext_i32_i64(skip_threads_236852))];\n                                        x_236839 = ((volatile __local\n                                                     int64_t *) local_mem_236721)[squot64(warp_byte_offset_236717,\n                                                                                          (int64_t) 8) +\n                                                                                  (sext_i32_i64(local_tid_236707) -\n                                                                                   sext_i32_i64(skip_threads_236852))];\n                                        x_236840 = ((volatile __local\n                                                     int64_t *) local_mem_236721)[squot64(warp_byte_offset_236718,\n                                                                                          (int64_t) 8) +\n                                                                                  (sext_i32_i64(local_tid_23",
            "6707) -\n                                                                                   sext_i32_i64(skip_threads_236852))];\n                                        x_236841 = ((volatile __local\n                                                     int64_t *) local_mem_236721)[squot64(warp_byte_offset_236719,\n                                                                                          (int64_t) 8) +\n                                                                                  (sext_i32_i64(local_tid_236707) -\n                                                                                   sext_i32_i64(skip_threads_236852))];\n                                    }\n                                    // perform operation\n                                    {\n                                        if (flg_y_236851 == (int8_t) 2 ||\n                                            flg_y_236851 == (int8_t) 0) {\n                                            flg_x_236850 = flg_y_236851;\n                                            x_236838 = x_236842;\n                                            x_236839 = x_236843;\n                                            x_236840 = x_236844;\n                                            x_236841 = x_236845;\n                                        } else {\n                                            int64_t defunc_1_op_res_236846 =\n                                                    add64(x_236838, x_236842);\n                                            int64_t defunc_1_op_res_236847 =\n                                                    add64(x_236839, x_236843);\n                                            int64_t defunc_1_op_res_236848 =\n                                                    add64(x_236840, x_236844);\n                                            int64_t defunc_1_op_res_236849 =\n                                                    add64(x_236841, x_236845);\n                                            \n              ",
            "                              x_236838 = defunc_1_op_res_236846;\n                                            x_236839 = defunc_1_op_res_236847;\n                                            x_236840 = defunc_1_op_res_236848;\n                                            x_236841 = defunc_1_op_res_236849;\n                                        }\n                                    }\n                                    // write result\n                                    {\n                                        ((volatile __local\n                                          int8_t *) local_mem_236721)[sext_i32_i64(local_tid_236707)] =\n                                            flg_x_236850;\n                                        flg_y_236851 = flg_x_236850;\n                                        ((volatile __local\n                                          int64_t *) local_mem_236721)[squot64(warp_byte_offset_236716,\n                                                                               (int64_t) 8) +\n                                                                       sext_i32_i64(local_tid_236707)] =\n                                            x_236838;\n                                        x_236842 = x_236838;\n                                        ((volatile __local\n                                          int64_t *) local_mem_236721)[squot64(warp_byte_offset_236717,\n                                                                               (int64_t) 8) +\n                                                                       sext_i32_i64(local_tid_236707)] =\n                                            x_236839;\n                                        x_236843 = x_236839;\n                                        ((volatile __local\n                                          int64_t *) local_mem_236721)[squot64(warp_byte_offset_236718,\n                                                                               (int64_t) 8) +\n                           ",
            "                                            sext_i32_i64(local_tid_236707)] =\n                                            x_236840;\n                                        x_236844 = x_236840;\n                                        ((volatile __local\n                                          int64_t *) local_mem_236721)[squot64(warp_byte_offset_236719,\n                                                                               (int64_t) 8) +\n                                                                       sext_i32_i64(local_tid_236707)] =\n                                            x_236841;\n                                        x_236845 = x_236841;\n                                    }\n                                }\n                                skip_threads_236852 *= 2;\n                            }\n                        }\n                    }\n                    flag_236837 = ((__local\n                                    int8_t *) local_mem_236721)[sext_i32_i64(wave_sizze_236709) -\n                                                                (int64_t) 1];\n                    aggr_236833 = ((__local\n                                    int64_t *) local_mem_236721)[squot64(warp_byte_offset_236716,\n                                                                         (int64_t) 8) +\n                                                                 (sext_i32_i64(wave_sizze_236709) -\n                                                                  (int64_t) 1)];\n                    aggr_236834 = ((__local\n                                    int64_t *) local_mem_236721)[squot64(warp_byte_offset_236717,\n                                                                         (int64_t) 8) +\n                                                                 (sext_i32_i64(wave_sizze_236709) -\n                                                                  (int64_t) 1)];\n                    aggr_236835 = ((__local\n                                    ",
            "int64_t *) local_mem_236721)[squot64(warp_byte_offset_236718,\n                                                                         (int64_t) 8) +\n                                                                 (sext_i32_i64(wave_sizze_236709) -\n                                                                  (int64_t) 1)];\n                    aggr_236836 = ((__local\n                                    int64_t *) local_mem_236721)[squot64(warp_byte_offset_236719,\n                                                                         (int64_t) 8) +\n                                                                 (sext_i32_i64(wave_sizze_236709) -\n                                                                  (int64_t) 1)];\n                    if (flag_236837 == (int8_t) 2) {\n                        readOffset_236831 = wave_sizze_236709 * -1;\n                    } else {\n                        if (flag_236837 == (int8_t) 1) {\n                            readOffset_236831 -= wave_sizze_236709;\n                        }\n                    }\n                    if (slt8((int8_t) 0, flag_236837)) {\n                        int64_t x_236853 = aggr_236833;\n                        int64_t x_236854 = aggr_236834;\n                        int64_t x_236855 = aggr_236835;\n                        int64_t x_236856 = aggr_236836;\n                        int64_t x_236857 = prefix_236824;\n                        int64_t x_236858 = prefix_236825;\n                        int64_t x_236859 = prefix_236826;\n                        int64_t x_236860 = prefix_236827;\n                        int64_t defunc_1_op_res_236861 = add64(x_236853,\n                                                               x_236857);\n                        int64_t defunc_1_op_res_236862 = add64(x_236854,\n                                                               x_236858);\n                        int64_t defunc_1_op_res_236863 = add64(x_236855,\n                                                       ",
            "        x_236859);\n                        int64_t defunc_1_op_res_236864 = add64(x_236856,\n                                                               x_236860);\n                        \n                        prefix_236824 = defunc_1_op_res_236861;\n                        prefix_236825 = defunc_1_op_res_236862;\n                        prefix_236826 = defunc_1_op_res_236863;\n                        prefix_236827 = defunc_1_op_res_236864;\n                    }\n                    mem_fence_local();\n                }\n            }\n            if (local_tid_236707 == 0) {\n                if (boundary_236740 == sext_i64_i32(segscan_group_sizze_227905 *\n                    (int64_t) 3)) {\n                    int64_t x_236865 = prefix_236824;\n                    int64_t x_236866 = prefix_236825;\n                    int64_t x_236867 = prefix_236826;\n                    int64_t x_236868 = prefix_236827;\n                    int64_t x_236869 = acc_236799;\n                    int64_t x_236870 = acc_236800;\n                    int64_t x_236871 = acc_236801;\n                    int64_t x_236872 = acc_236802;\n                    int64_t defunc_1_op_res_236873 = add64(x_236865, x_236869);\n                    int64_t defunc_1_op_res_236874 = add64(x_236866, x_236870);\n                    int64_t defunc_1_op_res_236875 = add64(x_236867, x_236871);\n                    int64_t defunc_1_op_res_236876 = add64(x_236868, x_236872);\n                    \n                    ((volatile __global\n                      int64_t *) incprefixes_mem_236692)[dynamic_id_236737] =\n                        defunc_1_op_res_236873;\n                    ((volatile __global\n                      int64_t *) incprefixes_mem_236696)[dynamic_id_236737] =\n                        defunc_1_op_res_236874;\n                    ((volatile __global\n                      int64_t *) incprefixes_mem_236700)[dynamic_id_236737] =\n                        defunc_1_op_res_236875;\n                    ((volatile __global\n   ",
            "                   int64_t *) incprefixes_mem_236704)[dynamic_id_236737] =\n                        defunc_1_op_res_236876;\n                    mem_fence_global();\n                    ((volatile __global\n                      int8_t *) status_flags_mem_236688)[dynamic_id_236737] =\n                        (int8_t) 2;\n                }\n                ((__local\n                  int64_t *) local_mem_236721)[squot64(warp_byte_offset_236716,\n                                                       (int64_t) 8)] =\n                    prefix_236824;\n                ((__local\n                  int64_t *) local_mem_236721)[squot64(warp_byte_offset_236717,\n                                                       (int64_t) 8)] =\n                    prefix_236825;\n                ((__local\n                  int64_t *) local_mem_236721)[squot64(warp_byte_offset_236718,\n                                                       (int64_t) 8)] =\n                    prefix_236826;\n                ((__local\n                  int64_t *) local_mem_236721)[squot64(warp_byte_offset_236719,\n                                                       (int64_t) 8)] =\n                    prefix_236827;\n                acc_236799 = (int64_t) 0;\n                acc_236800 = (int64_t) 0;\n                acc_236801 = (int64_t) 0;\n                acc_236802 = (int64_t) 0;\n            }\n        }\n        if (!(dynamic_id_236737 == (int64_t) 0)) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            prefix_236824 = ((__local\n                              int64_t *) local_mem_236721)[squot64(warp_byte_offset_236716,\n                                                                   (int64_t) 8)];\n            prefix_236825 = ((__local\n                              int64_t *) local_mem_236721)[squot64(warp_byte_offset_236717,\n                                                                   (int64_t) 8)];\n            prefix_236826 = ((__local\n                              int64_t *) local_mem_236721)[squot64(war",
            "p_byte_offset_236718,\n                                                                   (int64_t) 8)];\n            prefix_236827 = ((__local\n                              int64_t *) local_mem_236721)[squot64(warp_byte_offset_236719,\n                                                                   (int64_t) 8)];\n            barrier(CLK_LOCAL_MEM_FENCE);\n        }\n    }\n    // Distribute results\n    {\n        int64_t x_236877;\n        int64_t x_236881;\n        int64_t x_236889 = prefix_236824;\n        int64_t x_236893 = acc_236799;\n        int64_t x_236878;\n        int64_t x_236882;\n        int64_t x_236890 = prefix_236825;\n        int64_t x_236894 = acc_236800;\n        int64_t x_236879;\n        int64_t x_236883;\n        int64_t x_236891 = prefix_236826;\n        int64_t x_236895 = acc_236801;\n        int64_t x_236880;\n        int64_t x_236884;\n        int64_t x_236892 = prefix_236827;\n        int64_t x_236896 = acc_236802;\n        \n        if (slt32(local_tid_236707 * 3, boundary_236740) &&\n            !block_new_sgm_236828) {\n            int64_t defunc_1_op_res_236897 = add64(x_236889, x_236893);\n            int64_t defunc_1_op_res_236898 = add64(x_236890, x_236894);\n            int64_t defunc_1_op_res_236899 = add64(x_236891, x_236895);\n            int64_t defunc_1_op_res_236900 = add64(x_236892, x_236896);\n            \n            x_236877 = defunc_1_op_res_236897;\n            x_236878 = defunc_1_op_res_236898;\n            x_236879 = defunc_1_op_res_236899;\n            x_236880 = defunc_1_op_res_236900;\n        } else {\n            x_236877 = acc_236799;\n            x_236878 = acc_236800;\n            x_236879 = acc_236801;\n            x_236880 = acc_236802;\n        }\n        \n        int32_t stopping_point_236901 = segsizze_compact_236741 -\n                srem32(local_tid_236707 * 3 - 1 + segsizze_compact_236741 -\n                       boundary_236740, segsizze_compact_236741);\n        \n        for (int64_t i_236902 = 0; i_236902 < (int64_t) 3; i_236902++) {\n ",
            "           if (slt32(sext_i64_i32(i_236902), stopping_point_236901 - 1)) {\n                x_236881 = private_mem_236742[i_236902];\n                x_236882 = private_mem_236744[i_236902];\n                x_236883 = private_mem_236746[i_236902];\n                x_236884 = private_mem_236748[i_236902];\n                \n                int64_t defunc_1_op_res_236885 = add64(x_236877, x_236881);\n                int64_t defunc_1_op_res_236886 = add64(x_236878, x_236882);\n                int64_t defunc_1_op_res_236887 = add64(x_236879, x_236883);\n                int64_t defunc_1_op_res_236888 = add64(x_236880, x_236884);\n                \n                private_mem_236742[i_236902] = defunc_1_op_res_236885;\n                private_mem_236744[i_236902] = defunc_1_op_res_236886;\n                private_mem_236746[i_236902] = defunc_1_op_res_236887;\n                private_mem_236748[i_236902] = defunc_1_op_res_236888;\n            }\n        }\n    }\n    // Transpose scan output and Write it to global memory in coalesced fashion\n    {\n        for (int64_t i_236903 = 0; i_236903 < (int64_t) 3; i_236903++) {\n            int64_t sharedIdx_236904 = sext_i32_i64(local_tid_236707 * 3) +\n                    i_236903;\n            int64_t tmp_236905;\n            \n            tmp_236905 = private_mem_236742[i_236903];\n            ((__local int64_t *) local_mem_236721)[sharedIdx_236904] =\n                tmp_236905;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_236906 = 0; i_236906 < (int64_t) 3; i_236906++) {\n            int64_t flat_idx_236907 = blockOff_236738 +\n                    segscan_group_sizze_227905 * i_236906 +\n                    sext_i32_i64(local_tid_236707);\n            int64_t slice_236908 = n_203490;\n            int64_t slice_236909 = partition_sizze_203577 * slice_236908;\n            int64_t gtid_227913 = squot64(flat_idx_236907, slice_236908);\n            int64_t remnant_236910 = flat_idx_236907 - gtid_227913 *\n                    slice_2369",
            "08;\n            int64_t gtid_227914 = remnant_236910;\n            int64_t remnant_236911 = remnant_236910 - gtid_227914;\n            \n            if (slt64(flat_idx_236907, partition_sizze_203577 * n_203490)) {\n                int64_t tmp_236912;\n                \n                tmp_236912 = ((__local\n                               int64_t *) local_mem_236721)[flat_idx_236907 -\n                                                            blockOff_236738];\n                ((__global int64_t *) mem_231769)[gtid_227913 * n_203490 +\n                                                  gtid_227914] = tmp_236912;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_236913 = 0; i_236913 < (int64_t) 3; i_236913++) {\n            int64_t sharedIdx_236914 = sext_i32_i64(local_tid_236707 * 3) +\n                    i_236913;\n            int64_t tmp_236915;\n            \n            tmp_236915 = private_mem_236744[i_236913];\n            ((__local int64_t *) local_mem_236721)[sharedIdx_236914] =\n                tmp_236915;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_236916 = 0; i_236916 < (int64_t) 3; i_236916++) {\n            int64_t flat_idx_236917 = blockOff_236738 +\n                    segscan_group_sizze_227905 * i_236916 +\n                    sext_i32_i64(local_tid_236707);\n            int64_t slice_236918 = n_203490;\n            int64_t slice_236919 = partition_sizze_203577 * slice_236918;\n            int64_t gtid_227913 = squot64(flat_idx_236917, slice_236918);\n            int64_t remnant_236920 = flat_idx_236917 - gtid_227913 *\n                    slice_236918;\n            int64_t gtid_227914 = remnant_236920;\n            int64_t remnant_236921 = remnant_236920 - gtid_227914;\n            \n            if (slt64(flat_idx_236917, partition_sizze_203577 * n_203490)) {\n                int64_t tmp_236922;\n                \n                tmp_236922 = ((__local\n                               int64_t *) local_mem_236721)[flat_",
            "idx_236917 -\n                                                            blockOff_236738];\n                ((__global int64_t *) mem_231773)[gtid_227913 * n_203490 +\n                                                  gtid_227914] = tmp_236922;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_236923 = 0; i_236923 < (int64_t) 3; i_236923++) {\n            int64_t sharedIdx_236924 = sext_i32_i64(local_tid_236707 * 3) +\n                    i_236923;\n            int64_t tmp_236925;\n            \n            tmp_236925 = private_mem_236746[i_236923];\n            ((__local int64_t *) local_mem_236721)[sharedIdx_236924] =\n                tmp_236925;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_236926 = 0; i_236926 < (int64_t) 3; i_236926++) {\n            int64_t flat_idx_236927 = blockOff_236738 +\n                    segscan_group_sizze_227905 * i_236926 +\n                    sext_i32_i64(local_tid_236707);\n            int64_t slice_236928 = n_203490;\n            int64_t slice_236929 = partition_sizze_203577 * slice_236928;\n            int64_t gtid_227913 = squot64(flat_idx_236927, slice_236928);\n            int64_t remnant_236930 = flat_idx_236927 - gtid_227913 *\n                    slice_236928;\n            int64_t gtid_227914 = remnant_236930;\n            int64_t remnant_236931 = remnant_236930 - gtid_227914;\n            \n            if (slt64(flat_idx_236927, partition_sizze_203577 * n_203490)) {\n                int64_t tmp_236932;\n                \n                tmp_236932 = ((__local\n                               int64_t *) local_mem_236721)[flat_idx_236927 -\n                                                            blockOff_236738];\n                ((__global int64_t *) mem_231777)[gtid_227913 * n_203490 +\n                                                  gtid_227914] = tmp_236932;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_236933 = 0; i_236933 < (int64_t) 3; i_23",
            "6933++) {\n            int64_t sharedIdx_236934 = sext_i32_i64(local_tid_236707 * 3) +\n                    i_236933;\n            int64_t tmp_236935;\n            \n            tmp_236935 = private_mem_236748[i_236933];\n            ((__local int64_t *) local_mem_236721)[sharedIdx_236934] =\n                tmp_236935;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_236936 = 0; i_236936 < (int64_t) 3; i_236936++) {\n            int64_t flat_idx_236937 = blockOff_236738 +\n                    segscan_group_sizze_227905 * i_236936 +\n                    sext_i32_i64(local_tid_236707);\n            int64_t slice_236938 = n_203490;\n            int64_t slice_236939 = partition_sizze_203577 * slice_236938;\n            int64_t gtid_227913 = squot64(flat_idx_236937, slice_236938);\n            int64_t remnant_236940 = flat_idx_236937 - gtid_227913 *\n                    slice_236938;\n            int64_t gtid_227914 = remnant_236940;\n            int64_t remnant_236941 = remnant_236940 - gtid_227914;\n            \n            if (slt64(flat_idx_236937, partition_sizze_203577 * n_203490)) {\n                int64_t tmp_236942;\n                \n                tmp_236942 = ((__local\n                               int64_t *) local_mem_236721)[flat_idx_236937 -\n                                                            blockOff_236738];\n                ((__global int64_t *) mem_231781)[gtid_227913 * n_203490 +\n                                                  gtid_227914] = tmp_236942;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    // If this is the last block, reset the dynamicId\n    {\n        if (dynamic_id_236737 == sdiv_up64(partition_sizze_203577 * n_203490,\n                                           segscan_group_sizze_227905 *\n                                           (int64_t) 3) - (int64_t) 1) {\n            ((__global int32_t *) mainziid_counter_mem_236686)[(int64_t) 0] = 0;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segsca",
            "n_group_sizze_227905\n}\n", NULL};
static const char *tuning_param_names[] =
                  {"builtin#replicate_f64.group_size_232969",
                   "builtin#replicate_i64.group_size_232510",
                   "builtin#replicate_i8.group_size_232268",
                   "main.group_size_232528", "main.group_size_232729",
                   "main.group_size_234766", "main.group_size_234965",
                   "main.group_size_235215", "main.group_size_235593",
                   "main.group_size_235815", "main.group_size_236088",
                   "main.segmap_group_size_206871",
                   "main.segmap_group_size_206925",
                   "main.segmap_group_size_207082",
                   "main.segmap_group_size_207350",
                   "main.segmap_group_size_208205",
                   "main.segmap_group_size_208444",
                   "main.segmap_group_size_208475",
                   "main.segmap_group_size_209207",
                   "main.segmap_group_size_209411",
                   "main.segmap_group_size_209437",
                   "main.segmap_group_size_209833",
                   "main.segmap_group_size_210037",
                   "main.segmap_group_size_210063",
                   "main.segmap_group_size_210236",
                   "main.segmap_group_size_210299",
                   "main.segmap_group_size_210441",
                   "main.segmap_group_size_210636",
                   "main.segmap_group_size_210971",
                   "main.segmap_group_size_211146",
                   "main.segmap_group_size_211232",
                   "main.segmap_group_size_212133",
                   "main.segmap_group_size_212389",
                   "main.segmap_group_size_212822",
                   "main.segmap_group_size_213054",
                   "main.segmap_group_size_213157",
                   "main.segmap_group_size_214306",
                   "main.segmap_group_size_214626",
                   "main.segmap_group_size_215167",
                   "main.segmap_group_size_215454",
                   "main.segmap_group_size_215584",
                   "main.segmap_group_size_218115",
                   "main.segmap_group_size_218511",
                   "main.segmap_group_size_218582",
                   "main.segmap_group_size_218713",
                   "main.segmap_group_size_218844",
                   "main.segmap_group_size_218975",
                   "main.segmap_group_size_219116",
                   "main.segmap_group_size_219247",
                   "main.segmap_group_size_219608",
                   "main.segmap_group_size_219808",
                   "main.segmap_group_size_219990",
                   "main.segmap_group_size_220473",
                   "main.segmap_group_size_220737",
                   "main.segmap_group_size_220968",
                   "main.segmap_group_size_222226",
                   "main.segmap_group_size_222413",
                   "main.segmap_group_size_222454",
                   "main.segmap_group_size_222643",
                   "main.segmap_group_size_222781",
                   "main.segmap_group_size_222980",
                   "main.segmap_group_size_223036",
                   "main.segmap_group_size_223296",
                   "main.segmap_group_size_223544",
                   "main.segmap_group_size_223733",
                   "main.segmap_group_size_223986",
                   "main.segmap_group_size_224042",
                   "main.segmap_group_size_224370",
                   "main.segmap_group_size_224682",
                   "main.segmap_group_size_224920",
                   "main.segmap_group_size_225240",
                   "main.segmap_group_size_225296",
                   "main.segmap_group_size_225786",
                   "main.segmap_group_size_225842",
                   "main.segmap_group_size_226098",
                   "main.segmap_group_size_226154",
                   "main.segmap_group_size_226502",
                   "main.segmap_group_size_226558",
                   "main.segmap_group_size_226771",
                   "main.segmap_group_size_227027",
                   "main.segmap_group_size_227070",
                   "main.segmap_group_size_227158",
                   "main.segmap_group_size_227577",
                   "main.segmap_group_size_228020",
                   "main.segmap_group_size_228055",
                   "main.segmap_group_size_228124",
                   "main.segmap_group_size_228214",
                   "main.segmap_num_groups_206873",
                   "main.segmap_num_groups_210443",
                   "main.segmap_num_groups_210638",
                   "main.segmap_num_groups_212135",
                   "main.segmap_num_groups_212391",
                   "main.segmap_num_groups_214308",
                   "main.segmap_num_groups_214628",
                   "main.segmap_num_groups_218977",
                   "main.segmap_num_groups_219610",
                   "main.segmap_num_groups_220475",
                   "main.segmap_num_groups_222456",
                   "main.segmap_num_groups_223298",
                   "main.segmap_num_groups_224372",
                   "main.segmap_num_groups_227160",
                   "main.segmap_num_groups_228216",
                   "main.segred_group_size_211074",
                   "main.segred_group_size_211176",
                   "main.segred_group_size_212960",
                   "main.segred_group_size_213093",
                   "main.segred_group_size_215343",
                   "main.segred_group_size_215512",
                   "main.segred_group_size_218608",
                   "main.segred_group_size_218739",
                   "main.segred_group_size_218870",
                   "main.segred_group_size_219193",
                   "main.segred_group_size_219260",
                   "main.segred_group_size_219918",
                   "main.segred_group_size_220012",
                   "main.segred_group_size_220883",
                   "main.segred_group_size_221009",
                   "main.segred_group_size_222724",
                   "main.segred_group_size_222794",
                   "main.segred_group_size_223658",
                   "main.segred_group_size_223755",
                   "main.segred_group_size_224832",
                   "main.segred_group_size_224961",
                   "main.segred_group_size_228067",
                   "main.segred_num_groups_211076",
                   "main.segred_num_groups_211178",
                   "main.segred_num_groups_212962",
                   "main.segred_num_groups_213095",
                   "main.segred_num_groups_215345",
                   "main.segred_num_groups_215514",
                   "main.segred_num_groups_218610",
                   "main.segred_num_groups_218741",
                   "main.segred_num_groups_218872",
                   "main.segred_num_groups_219195",
                   "main.segred_num_groups_219262",
                   "main.segred_num_groups_219920",
                   "main.segred_num_groups_220014",
                   "main.segred_num_groups_220885",
                   "main.segred_num_groups_221011",
                   "main.segred_num_groups_222726",
                   "main.segred_num_groups_222796",
                   "main.segred_num_groups_223660",
                   "main.segred_num_groups_223757",
                   "main.segred_num_groups_224834",
                   "main.segred_num_groups_224963",
                   "main.segred_num_groups_228069",
                   "main.segscan_group_size_206861",
                   "main.segscan_group_size_206981",
                   "main.segscan_group_size_207419",
                   "main.segscan_group_size_218641",
                   "main.segscan_group_size_218772",
                   "main.segscan_group_size_218903",
                   "main.segscan_group_size_227625",
                   "main.segscan_num_groups_206863",
                   "main.segscan_num_groups_206983",
                   "main.segscan_num_groups_207421",
                   "main.segscan_num_groups_218643",
                   "main.segscan_num_groups_218774",
                   "main.segscan_num_groups_218905",
                   "main.segscan_num_groups_227627", "main.suff_intra_par_0",
                   "main.suff_intra_par_1", "main.suff_intra_par_13",
                   "main.suff_intra_par_17", "main.suff_intra_par_2",
                   "main.suff_intra_par_3", "main.suff_intra_par_34",
                   "main.suff_intra_par_36", "main.suff_intra_par_37",
                   "main.suff_intra_par_4", "main.suff_intra_par_5",
                   "main.suff_intra_par_6", "main.suff_intra_par_9",
                   "main.suff_outer_par_10", "main.suff_outer_par_11",
                   "main.suff_outer_par_12", "main.suff_outer_par_14",
                   "main.suff_outer_par_15", "main.suff_outer_par_16",
                   "main.suff_outer_par_18", "main.suff_outer_par_19",
                   "main.suff_outer_par_20", "main.suff_outer_par_21",
                   "main.suff_outer_par_22", "main.suff_outer_par_23",
                   "main.suff_outer_par_24", "main.suff_outer_par_25",
                   "main.suff_outer_par_26", "main.suff_outer_par_27",
                   "main.suff_outer_par_28", "main.suff_outer_par_29",
                   "main.suff_outer_par_30", "main.suff_outer_par_31",
                   "main.suff_outer_par_32", "main.suff_outer_par_33",
                   "main.suff_outer_par_35", "main.suff_outer_par_38",
                   "main.suff_outer_par_7", "main.suff_outer_par_8"};
static const char *tuning_param_vars[] =
                  {"builtinzhreplicate_f64zigroup_sizze_232969",
                   "builtinzhreplicate_i64zigroup_sizze_232510",
                   "builtinzhreplicate_i8zigroup_sizze_232268",
                   "mainzigroup_sizze_232528", "mainzigroup_sizze_232729",
                   "mainzigroup_sizze_234766", "mainzigroup_sizze_234965",
                   "mainzigroup_sizze_235215", "mainzigroup_sizze_235593",
                   "mainzigroup_sizze_235815", "mainzigroup_sizze_236088",
                   "mainzisegmap_group_sizze_206871",
                   "mainzisegmap_group_sizze_206925",
                   "mainzisegmap_group_sizze_207082",
                   "mainzisegmap_group_sizze_207350",
                   "mainzisegmap_group_sizze_208205",
                   "mainzisegmap_group_sizze_208444",
                   "mainzisegmap_group_sizze_208475",
                   "mainzisegmap_group_sizze_209207",
                   "mainzisegmap_group_sizze_209411",
                   "mainzisegmap_group_sizze_209437",
                   "mainzisegmap_group_sizze_209833",
                   "mainzisegmap_group_sizze_210037",
                   "mainzisegmap_group_sizze_210063",
                   "mainzisegmap_group_sizze_210236",
                   "mainzisegmap_group_sizze_210299",
                   "mainzisegmap_group_sizze_210441",
                   "mainzisegmap_group_sizze_210636",
                   "mainzisegmap_group_sizze_210971",
                   "mainzisegmap_group_sizze_211146",
                   "mainzisegmap_group_sizze_211232",
                   "mainzisegmap_group_sizze_212133",
                   "mainzisegmap_group_sizze_212389",
                   "mainzisegmap_group_sizze_212822",
                   "mainzisegmap_group_sizze_213054",
                   "mainzisegmap_group_sizze_213157",
                   "mainzisegmap_group_sizze_214306",
                   "mainzisegmap_group_sizze_214626",
                   "mainzisegmap_group_sizze_215167",
                   "mainzisegmap_group_sizze_215454",
                   "mainzisegmap_group_sizze_215584",
                   "mainzisegmap_group_sizze_218115",
                   "mainzisegmap_group_sizze_218511",
                   "mainzisegmap_group_sizze_218582",
                   "mainzisegmap_group_sizze_218713",
                   "mainzisegmap_group_sizze_218844",
                   "mainzisegmap_group_sizze_218975",
                   "mainzisegmap_group_sizze_219116",
                   "mainzisegmap_group_sizze_219247",
                   "mainzisegmap_group_sizze_219608",
                   "mainzisegmap_group_sizze_219808",
                   "mainzisegmap_group_sizze_219990",
                   "mainzisegmap_group_sizze_220473",
                   "mainzisegmap_group_sizze_220737",
                   "mainzisegmap_group_sizze_220968",
                   "mainzisegmap_group_sizze_222226",
                   "mainzisegmap_group_sizze_222413",
                   "mainzisegmap_group_sizze_222454",
                   "mainzisegmap_group_sizze_222643",
                   "mainzisegmap_group_sizze_222781",
                   "mainzisegmap_group_sizze_222980",
                   "mainzisegmap_group_sizze_223036",
                   "mainzisegmap_group_sizze_223296",
                   "mainzisegmap_group_sizze_223544",
                   "mainzisegmap_group_sizze_223733",
                   "mainzisegmap_group_sizze_223986",
                   "mainzisegmap_group_sizze_224042",
                   "mainzisegmap_group_sizze_224370",
                   "mainzisegmap_group_sizze_224682",
                   "mainzisegmap_group_sizze_224920",
                   "mainzisegmap_group_sizze_225240",
                   "mainzisegmap_group_sizze_225296",
                   "mainzisegmap_group_sizze_225786",
                   "mainzisegmap_group_sizze_225842",
                   "mainzisegmap_group_sizze_226098",
                   "mainzisegmap_group_sizze_226154",
                   "mainzisegmap_group_sizze_226502",
                   "mainzisegmap_group_sizze_226558",
                   "mainzisegmap_group_sizze_226771",
                   "mainzisegmap_group_sizze_227027",
                   "mainzisegmap_group_sizze_227070",
                   "mainzisegmap_group_sizze_227158",
                   "mainzisegmap_group_sizze_227577",
                   "mainzisegmap_group_sizze_228020",
                   "mainzisegmap_group_sizze_228055",
                   "mainzisegmap_group_sizze_228124",
                   "mainzisegmap_group_sizze_228214",
                   "mainzisegmap_num_groups_206873",
                   "mainzisegmap_num_groups_210443",
                   "mainzisegmap_num_groups_210638",
                   "mainzisegmap_num_groups_212135",
                   "mainzisegmap_num_groups_212391",
                   "mainzisegmap_num_groups_214308",
                   "mainzisegmap_num_groups_214628",
                   "mainzisegmap_num_groups_218977",
                   "mainzisegmap_num_groups_219610",
                   "mainzisegmap_num_groups_220475",
                   "mainzisegmap_num_groups_222456",
                   "mainzisegmap_num_groups_223298",
                   "mainzisegmap_num_groups_224372",
                   "mainzisegmap_num_groups_227160",
                   "mainzisegmap_num_groups_228216",
                   "mainzisegred_group_sizze_211074",
                   "mainzisegred_group_sizze_211176",
                   "mainzisegred_group_sizze_212960",
                   "mainzisegred_group_sizze_213093",
                   "mainzisegred_group_sizze_215343",
                   "mainzisegred_group_sizze_215512",
                   "mainzisegred_group_sizze_218608",
                   "mainzisegred_group_sizze_218739",
                   "mainzisegred_group_sizze_218870",
                   "mainzisegred_group_sizze_219193",
                   "mainzisegred_group_sizze_219260",
                   "mainzisegred_group_sizze_219918",
                   "mainzisegred_group_sizze_220012",
                   "mainzisegred_group_sizze_220883",
                   "mainzisegred_group_sizze_221009",
                   "mainzisegred_group_sizze_222724",
                   "mainzisegred_group_sizze_222794",
                   "mainzisegred_group_sizze_223658",
                   "mainzisegred_group_sizze_223755",
                   "mainzisegred_group_sizze_224832",
                   "mainzisegred_group_sizze_224961",
                   "mainzisegred_group_sizze_228067",
                   "mainzisegred_num_groups_211076",
                   "mainzisegred_num_groups_211178",
                   "mainzisegred_num_groups_212962",
                   "mainzisegred_num_groups_213095",
                   "mainzisegred_num_groups_215345",
                   "mainzisegred_num_groups_215514",
                   "mainzisegred_num_groups_218610",
                   "mainzisegred_num_groups_218741",
                   "mainzisegred_num_groups_218872",
                   "mainzisegred_num_groups_219195",
                   "mainzisegred_num_groups_219262",
                   "mainzisegred_num_groups_219920",
                   "mainzisegred_num_groups_220014",
                   "mainzisegred_num_groups_220885",
                   "mainzisegred_num_groups_221011",
                   "mainzisegred_num_groups_222726",
                   "mainzisegred_num_groups_222796",
                   "mainzisegred_num_groups_223660",
                   "mainzisegred_num_groups_223757",
                   "mainzisegred_num_groups_224834",
                   "mainzisegred_num_groups_224963",
                   "mainzisegred_num_groups_228069",
                   "mainzisegscan_group_sizze_206861",
                   "mainzisegscan_group_sizze_206981",
                   "mainzisegscan_group_sizze_207419",
                   "mainzisegscan_group_sizze_218641",
                   "mainzisegscan_group_sizze_218772",
                   "mainzisegscan_group_sizze_218903",
                   "mainzisegscan_group_sizze_227625",
                   "mainzisegscan_num_groups_206863",
                   "mainzisegscan_num_groups_206983",
                   "mainzisegscan_num_groups_207421",
                   "mainzisegscan_num_groups_218643",
                   "mainzisegscan_num_groups_218774",
                   "mainzisegscan_num_groups_218905",
                   "mainzisegscan_num_groups_227627", "mainzisuff_intra_par_0",
                   "mainzisuff_intra_par_1", "mainzisuff_intra_par_13",
                   "mainzisuff_intra_par_17", "mainzisuff_intra_par_2",
                   "mainzisuff_intra_par_3", "mainzisuff_intra_par_34",
                   "mainzisuff_intra_par_36", "mainzisuff_intra_par_37",
                   "mainzisuff_intra_par_4", "mainzisuff_intra_par_5",
                   "mainzisuff_intra_par_6", "mainzisuff_intra_par_9",
                   "mainzisuff_outer_par_10", "mainzisuff_outer_par_11",
                   "mainzisuff_outer_par_12", "mainzisuff_outer_par_14",
                   "mainzisuff_outer_par_15", "mainzisuff_outer_par_16",
                   "mainzisuff_outer_par_18", "mainzisuff_outer_par_19",
                   "mainzisuff_outer_par_20", "mainzisuff_outer_par_21",
                   "mainzisuff_outer_par_22", "mainzisuff_outer_par_23",
                   "mainzisuff_outer_par_24", "mainzisuff_outer_par_25",
                   "mainzisuff_outer_par_26", "mainzisuff_outer_par_27",
                   "mainzisuff_outer_par_28", "mainzisuff_outer_par_29",
                   "mainzisuff_outer_par_30", "mainzisuff_outer_par_31",
                   "mainzisuff_outer_par_32", "mainzisuff_outer_par_33",
                   "mainzisuff_outer_par_35", "mainzisuff_outer_par_38",
                   "mainzisuff_outer_par_7", "mainzisuff_outer_par_8"};
static const char *tuning_param_classes[] = {"group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "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_232969;
    int64_t *builtinzhreplicate_i64zigroup_sizze_232510;
    int64_t *builtinzhreplicate_i8zigroup_sizze_232268;
    int64_t *mainzigroup_sizze_232528;
    int64_t *mainzigroup_sizze_232729;
    int64_t *mainzigroup_sizze_234766;
    int64_t *mainzigroup_sizze_234965;
    int64_t *mainzigroup_sizze_235215;
    int64_t *mainzigroup_sizze_235593;
    int64_t *mainzigroup_sizze_235815;
    int64_t *mainzigroup_sizze_236088;
    int64_t *mainzisegmap_group_sizze_206871;
    int64_t *mainzisegmap_group_sizze_206925;
    int64_t *mainzisegmap_group_sizze_207082;
    int64_t *mainzisegmap_group_sizze_207350;
    int64_t *mainzisegmap_group_sizze_208205;
    int64_t *mainzisegmap_group_sizze_208444;
    int64_t *mainzisegmap_group_sizze_208475;
    int64_t *mainzisegmap_group_sizze_209207;
    int64_t *mainzisegmap_group_sizze_209411;
    int64_t *mainzisegmap_group_sizze_209437;
    int64_t *mainzisegmap_group_sizze_209833;
    int64_t *mainzisegmap_group_sizze_210037;
    int64_t *mainzisegmap_group_sizze_210063;
    int64_t *mainzisegmap_group_sizze_210236;
    int64_t *mainzisegmap_group_sizze_210299;
    int64_t *mainzisegmap_group_sizze_210441;
    int64_t *mainzisegmap_group_sizze_210636;
    int64_t *mainzisegmap_group_sizze_210971;
    int64_t *mainzisegmap_group_sizze_211146;
    int64_t *mainzisegmap_group_sizze_211232;
    int64_t *mainzisegmap_group_sizze_212133;
    int64_t *mainzisegmap_group_sizze_212389;
    int64_t *mainzisegmap_group_sizze_212822;
    int64_t *mainzisegmap_group_sizze_213054;
    int64_t *mainzisegmap_group_sizze_213157;
    int64_t *mainzisegmap_group_sizze_214306;
    int64_t *mainzisegmap_group_sizze_214626;
    int64_t *mainzisegmap_group_sizze_215167;
    int64_t *mainzisegmap_group_sizze_215454;
    int64_t *mainzisegmap_group_sizze_215584;
    int64_t *mainzisegmap_group_sizze_218115;
    int64_t *mainzisegmap_group_sizze_218511;
    int64_t *mainzisegmap_group_sizze_218582;
    int64_t *mainzisegmap_group_sizze_218713;
    int64_t *mainzisegmap_group_sizze_218844;
    int64_t *mainzisegmap_group_sizze_218975;
    int64_t *mainzisegmap_group_sizze_219116;
    int64_t *mainzisegmap_group_sizze_219247;
    int64_t *mainzisegmap_group_sizze_219608;
    int64_t *mainzisegmap_group_sizze_219808;
    int64_t *mainzisegmap_group_sizze_219990;
    int64_t *mainzisegmap_group_sizze_220473;
    int64_t *mainzisegmap_group_sizze_220737;
    int64_t *mainzisegmap_group_sizze_220968;
    int64_t *mainzisegmap_group_sizze_222226;
    int64_t *mainzisegmap_group_sizze_222413;
    int64_t *mainzisegmap_group_sizze_222454;
    int64_t *mainzisegmap_group_sizze_222643;
    int64_t *mainzisegmap_group_sizze_222781;
    int64_t *mainzisegmap_group_sizze_222980;
    int64_t *mainzisegmap_group_sizze_223036;
    int64_t *mainzisegmap_group_sizze_223296;
    int64_t *mainzisegmap_group_sizze_223544;
    int64_t *mainzisegmap_group_sizze_223733;
    int64_t *mainzisegmap_group_sizze_223986;
    int64_t *mainzisegmap_group_sizze_224042;
    int64_t *mainzisegmap_group_sizze_224370;
    int64_t *mainzisegmap_group_sizze_224682;
    int64_t *mainzisegmap_group_sizze_224920;
    int64_t *mainzisegmap_group_sizze_225240;
    int64_t *mainzisegmap_group_sizze_225296;
    int64_t *mainzisegmap_group_sizze_225786;
    int64_t *mainzisegmap_group_sizze_225842;
    int64_t *mainzisegmap_group_sizze_226098;
    int64_t *mainzisegmap_group_sizze_226154;
    int64_t *mainzisegmap_group_sizze_226502;
    int64_t *mainzisegmap_group_sizze_226558;
    int64_t *mainzisegmap_group_sizze_226771;
    int64_t *mainzisegmap_group_sizze_227027;
    int64_t *mainzisegmap_group_sizze_227070;
    int64_t *mainzisegmap_group_sizze_227158;
    int64_t *mainzisegmap_group_sizze_227577;
    int64_t *mainzisegmap_group_sizze_228020;
    int64_t *mainzisegmap_group_sizze_228055;
    int64_t *mainzisegmap_group_sizze_228124;
    int64_t *mainzisegmap_group_sizze_228214;
    int64_t *mainzisegmap_num_groups_206873;
    int64_t *mainzisegmap_num_groups_210443;
    int64_t *mainzisegmap_num_groups_210638;
    int64_t *mainzisegmap_num_groups_212135;
    int64_t *mainzisegmap_num_groups_212391;
    int64_t *mainzisegmap_num_groups_214308;
    int64_t *mainzisegmap_num_groups_214628;
    int64_t *mainzisegmap_num_groups_218977;
    int64_t *mainzisegmap_num_groups_219610;
    int64_t *mainzisegmap_num_groups_220475;
    int64_t *mainzisegmap_num_groups_222456;
    int64_t *mainzisegmap_num_groups_223298;
    int64_t *mainzisegmap_num_groups_224372;
    int64_t *mainzisegmap_num_groups_227160;
    int64_t *mainzisegmap_num_groups_228216;
    int64_t *mainzisegred_group_sizze_211074;
    int64_t *mainzisegred_group_sizze_211176;
    int64_t *mainzisegred_group_sizze_212960;
    int64_t *mainzisegred_group_sizze_213093;
    int64_t *mainzisegred_group_sizze_215343;
    int64_t *mainzisegred_group_sizze_215512;
    int64_t *mainzisegred_group_sizze_218608;
    int64_t *mainzisegred_group_sizze_218739;
    int64_t *mainzisegred_group_sizze_218870;
    int64_t *mainzisegred_group_sizze_219193;
    int64_t *mainzisegred_group_sizze_219260;
    int64_t *mainzisegred_group_sizze_219918;
    int64_t *mainzisegred_group_sizze_220012;
    int64_t *mainzisegred_group_sizze_220883;
    int64_t *mainzisegred_group_sizze_221009;
    int64_t *mainzisegred_group_sizze_222724;
    int64_t *mainzisegred_group_sizze_222794;
    int64_t *mainzisegred_group_sizze_223658;
    int64_t *mainzisegred_group_sizze_223755;
    int64_t *mainzisegred_group_sizze_224832;
    int64_t *mainzisegred_group_sizze_224961;
    int64_t *mainzisegred_group_sizze_228067;
    int64_t *mainzisegred_num_groups_211076;
    int64_t *mainzisegred_num_groups_211178;
    int64_t *mainzisegred_num_groups_212962;
    int64_t *mainzisegred_num_groups_213095;
    int64_t *mainzisegred_num_groups_215345;
    int64_t *mainzisegred_num_groups_215514;
    int64_t *mainzisegred_num_groups_218610;
    int64_t *mainzisegred_num_groups_218741;
    int64_t *mainzisegred_num_groups_218872;
    int64_t *mainzisegred_num_groups_219195;
    int64_t *mainzisegred_num_groups_219262;
    int64_t *mainzisegred_num_groups_219920;
    int64_t *mainzisegred_num_groups_220014;
    int64_t *mainzisegred_num_groups_220885;
    int64_t *mainzisegred_num_groups_221011;
    int64_t *mainzisegred_num_groups_222726;
    int64_t *mainzisegred_num_groups_222796;
    int64_t *mainzisegred_num_groups_223660;
    int64_t *mainzisegred_num_groups_223757;
    int64_t *mainzisegred_num_groups_224834;
    int64_t *mainzisegred_num_groups_224963;
    int64_t *mainzisegred_num_groups_228069;
    int64_t *mainzisegscan_group_sizze_206861;
    int64_t *mainzisegscan_group_sizze_206981;
    int64_t *mainzisegscan_group_sizze_207419;
    int64_t *mainzisegscan_group_sizze_218641;
    int64_t *mainzisegscan_group_sizze_218772;
    int64_t *mainzisegscan_group_sizze_218903;
    int64_t *mainzisegscan_group_sizze_227625;
    int64_t *mainzisegscan_num_groups_206863;
    int64_t *mainzisegscan_num_groups_206983;
    int64_t *mainzisegscan_num_groups_207421;
    int64_t *mainzisegscan_num_groups_218643;
    int64_t *mainzisegscan_num_groups_218774;
    int64_t *mainzisegscan_num_groups_218905;
    int64_t *mainzisegscan_num_groups_227627;
    int64_t *mainzisuff_intra_par_0;
    int64_t *mainzisuff_intra_par_1;
    int64_t *mainzisuff_intra_par_13;
    int64_t *mainzisuff_intra_par_17;
    int64_t *mainzisuff_intra_par_2;
    int64_t *mainzisuff_intra_par_3;
    int64_t *mainzisuff_intra_par_34;
    int64_t *mainzisuff_intra_par_36;
    int64_t *mainzisuff_intra_par_37;
    int64_t *mainzisuff_intra_par_4;
    int64_t *mainzisuff_intra_par_5;
    int64_t *mainzisuff_intra_par_6;
    int64_t *mainzisuff_intra_par_9;
    int64_t *mainzisuff_outer_par_10;
    int64_t *mainzisuff_outer_par_11;
    int64_t *mainzisuff_outer_par_12;
    int64_t *mainzisuff_outer_par_14;
    int64_t *mainzisuff_outer_par_15;
    int64_t *mainzisuff_outer_par_16;
    int64_t *mainzisuff_outer_par_18;
    int64_t *mainzisuff_outer_par_19;
    int64_t *mainzisuff_outer_par_20;
    int64_t *mainzisuff_outer_par_21;
    int64_t *mainzisuff_outer_par_22;
    int64_t *mainzisuff_outer_par_23;
    int64_t *mainzisuff_outer_par_24;
    int64_t *mainzisuff_outer_par_25;
    int64_t *mainzisuff_outer_par_26;
    int64_t *mainzisuff_outer_par_27;
    int64_t *mainzisuff_outer_par_28;
    int64_t *mainzisuff_outer_par_29;
    int64_t *mainzisuff_outer_par_30;
    int64_t *mainzisuff_outer_par_31;
    int64_t *mainzisuff_outer_par_32;
    int64_t *mainzisuff_outer_par_33;
    int64_t *mainzisuff_outer_par_35;
    int64_t *mainzisuff_outer_par_38;
    int64_t *mainzisuff_outer_par_7;
    int64_t *mainzisuff_outer_par_8;
};
struct futhark_context_config {
    int in_use;
    struct 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_232253;
    struct memblock_device mainziid_counter_mem_232402;
    struct memblock_device mainziid_counter_mem_232609;
    struct memblock_device mainzicounter_mem_233183;
    struct memblock_device mainzicounter_mem_233271;
    struct memblock_device mainzicounter_mem_233532;
    struct memblock_device mainzicounter_mem_233640;
    struct memblock_device mainzicounter_mem_233945;
    struct memblock_device mainzicounter_mem_234065;
    struct memblock_device mainzicounter_mem_234260;
    struct memblock_device mainziid_counter_mem_234297;
    struct memblock_device mainzicounter_mem_234441;
    struct memblock_device mainziid_counter_mem_234478;
    struct memblock_device mainzicounter_mem_234622;
    struct memblock_device mainziid_counter_mem_234659;
    struct memblock_device mainzicounter_mem_234839;
    struct memblock_device mainzicounter_mem_234921;
    struct memblock_device mainzicounter_mem_235063;
    struct memblock_device mainzicounter_mem_235165;
    struct memblock_device mainzicounter_mem_235333;
    struct memblock_device mainzicounter_mem_235447;
    struct memblock_device mainzicounter_mem_235689;
    struct memblock_device mainzicounter_mem_235771;
    struct memblock_device mainzicounter_mem_235936;
    struct memblock_device mainzicounter_mem_236038;
    struct memblock_device mainzicounter_mem_236229;
    struct memblock_device mainzicounter_mem_236343;
    struct memblock_device mainziid_counter_mem_236686;
    struct memblock_device mainzicounter_mem_237000;
    CUfunction builtinzhreplicate_f64zireplicate_232966;
    int64_t builtinzhreplicate_f64zireplicate_232966_total_runtime;
    int builtinzhreplicate_f64zireplicate_232966_runs;
    CUfunction builtinzhreplicate_i64zireplicate_232507;
    int64_t builtinzhreplicate_i64zireplicate_232507_total_runtime;
    int builtinzhreplicate_i64zireplicate_232507_runs;
    CUfunction builtinzhreplicate_i8zireplicate_232265;
    int64_t builtinzhreplicate_i8zireplicate_232265_total_runtime;
    int builtinzhreplicate_i8zireplicate_232265_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_232525;
    int64_t mainzicopy_232525_total_runtime;
    int mainzicopy_232525_runs;
    CUfunction mainzicopy_232726;
    int64_t mainzicopy_232726_total_runtime;
    int mainzicopy_232726_runs;
    CUfunction mainzicopy_234763;
    int64_t mainzicopy_234763_total_runtime;
    int mainzicopy_234763_runs;
    CUfunction mainzicopy_234962;
    int64_t mainzicopy_234962_total_runtime;
    int mainzicopy_234962_runs;
    CUfunction mainzicopy_235212;
    int64_t mainzicopy_235212_total_runtime;
    int mainzicopy_235212_runs;
    CUfunction mainzicopy_235590;
    int64_t mainzicopy_235590_total_runtime;
    int mainzicopy_235590_runs;
    CUfunction mainzicopy_235812;
    int64_t mainzicopy_235812_total_runtime;
    int mainzicopy_235812_runs;
    CUfunction mainzicopy_236085;
    int64_t mainzicopy_236085_total_runtime;
    int mainzicopy_236085_runs;
    CUfunction mainzisegmap_206869;
    int64_t mainzisegmap_206869_total_runtime;
    int mainzisegmap_206869_runs;
    CUfunction mainzisegmap_207045;
    int64_t mainzisegmap_207045_total_runtime;
    int mainzisegmap_207045_runs;
    CUfunction mainzisegmap_207170;
    int64_t mainzisegmap_207170_total_runtime;
    int mainzisegmap_207170_runs;
    CUfunction mainzisegmap_207605;
    int64_t mainzisegmap_207605_total_runtime;
    int mainzisegmap_207605_runs;
    CUfunction mainzisegmap_208818;
    int64_t mainzisegmap_208818_total_runtime;
    int mainzisegmap_208818_runs;
    CUfunction mainzisegmap_208832;
    int64_t mainzisegmap_208832_total_runtime;
    int mainzisegmap_208832_runs;
    CUfunction mainzisegmap_208856;
    int64_t mainzisegmap_208856_total_runtime;
    int mainzisegmap_208856_runs;
    CUfunction mainzisegmap_209466;
    int64_t mainzisegmap_209466_total_runtime;
    int mainzisegmap_209466_runs;
    CUfunction mainzisegmap_209478;
    int64_t mainzisegmap_209478_total_runtime;
    int mainzisegmap_209478_runs;
    CUfunction mainzisegmap_209499;
    int64_t mainzisegmap_209499_total_runtime;
    int mainzisegmap_209499_runs;
    CUfunction mainzisegmap_210092;
    int64_t mainzisegmap_210092_total_runtime;
    int mainzisegmap_210092_runs;
    CUfunction mainzisegmap_210104;
    int64_t mainzisegmap_210104_total_runtime;
    int mainzisegmap_210104_runs;
    CUfunction mainzisegmap_210125;
    int64_t mainzisegmap_210125_total_runtime;
    int mainzisegmap_210125_runs;
    CUfunction mainzisegmap_210267;
    int64_t mainzisegmap_210267_total_runtime;
    int mainzisegmap_210267_runs;
    CUfunction mainzisegmap_210412;
    int64_t mainzisegmap_210412_total_runtime;
    int mainzisegmap_210412_runs;
    CUfunction mainzisegmap_210542;
    int64_t mainzisegmap_210542_total_runtime;
    int mainzisegmap_210542_runs;
    CUfunction mainzisegmap_211682;
    int64_t mainzisegmap_211682_total_runtime;
    int mainzisegmap_211682_runs;
    CUfunction mainzisegmap_211890;
    int64_t mainzisegmap_211890_total_runtime;
    int mainzisegmap_211890_runs;
    CUfunction mainzisegmap_211979;
    int64_t mainzisegmap_211979_total_runtime;
    int mainzisegmap_211979_runs;
    CUfunction mainzisegmap_212051;
    int64_t mainzisegmap_212051_total_runtime;
    int mainzisegmap_212051_runs;
    CUfunction mainzisegmap_212265;
    int64_t mainzisegmap_212265_total_runtime;
    int mainzisegmap_212265_runs;
    CUfunction mainzisegmap_213719;
    int64_t mainzisegmap_213719_total_runtime;
    int mainzisegmap_213719_runs;
    CUfunction mainzisegmap_213994;
    int64_t mainzisegmap_213994_total_runtime;
    int mainzisegmap_213994_runs;
    CUfunction mainzisegmap_214111;
    int64_t mainzisegmap_214111_total_runtime;
    int mainzisegmap_214111_runs;
    CUfunction mainzisegmap_214195;
    int64_t mainzisegmap_214195_total_runtime;
    int mainzisegmap_214195_runs;
    CUfunction mainzisegmap_214470;
    int64_t mainzisegmap_214470_total_runtime;
    int mainzisegmap_214470_runs;
    CUfunction mainzisegmap_216262;
    int64_t mainzisegmap_216262_total_runtime;
    int mainzisegmap_216262_runs;
    CUfunction mainzisegmap_216607;
    int64_t mainzisegmap_216607_total_runtime;
    int mainzisegmap_216607_runs;
    CUfunction mainzisegmap_216756;
    int64_t mainzisegmap_216756_total_runtime;
    int mainzisegmap_216756_runs;
    CUfunction mainzisegmap_216852;
    int64_t mainzisegmap_216852_total_runtime;
    int mainzisegmap_216852_runs;
    CUfunction mainzisegmap_218413;
    int64_t mainzisegmap_218413_total_runtime;
    int mainzisegmap_218413_runs;
    CUfunction mainzisegmap_218562;
    int64_t mainzisegmap_218562_total_runtime;
    int mainzisegmap_218562_runs;
    CUfunction mainzisegmap_218598;
    int64_t mainzisegmap_218598_total_runtime;
    int mainzisegmap_218598_runs;
    CUfunction mainzisegmap_218729;
    int64_t mainzisegmap_218729_total_runtime;
    int mainzisegmap_218729_runs;
    CUfunction mainzisegmap_218860;
    int64_t mainzisegmap_218860_total_runtime;
    int mainzisegmap_218860_runs;
    CUfunction mainzisegmap_219049;
    int64_t mainzisegmap_219049_total_runtime;
    int mainzisegmap_219049_runs;
    CUfunction mainzisegmap_219434;
    int64_t mainzisegmap_219434_total_runtime;
    int mainzisegmap_219434_runs;
    CUfunction mainzisegmap_219551;
    int64_t mainzisegmap_219551_total_runtime;
    int mainzisegmap_219551_runs;
    CUfunction mainzisegmap_219712;
    int64_t mainzisegmap_219712_total_runtime;
    int mainzisegmap_219712_runs;
    CUfunction mainzisegmap_220233;
    int64_t mainzisegmap_220233_total_runtime;
    int mainzisegmap_220233_runs;
    CUfunction mainzisegmap_220390;
    int64_t mainzisegmap_220390_total_runtime;
    int mainzisegmap_220390_runs;
    CUfunction mainzisegmap_220609;
    int64_t mainzisegmap_220609_total_runtime;
    int mainzisegmap_220609_runs;
    CUfunction mainzisegmap_221278;
    int64_t mainzisegmap_221278_total_runtime;
    int mainzisegmap_221278_runs;
    CUfunction mainzisegmap_221479;
    int64_t mainzisegmap_221479_total_runtime;
    int mainzisegmap_221479_runs;
    CUfunction mainzisegmap_222349;
    int64_t mainzisegmap_222349_total_runtime;
    int mainzisegmap_222349_runs;
    CUfunction mainzisegmap_222444;
    int64_t mainzisegmap_222444_total_runtime;
    int mainzisegmap_222444_runs;
    CUfunction mainzisegmap_222551;
    int64_t mainzisegmap_222551_total_runtime;
    int mainzisegmap_222551_runs;
    CUfunction mainzisegmap_223067;
    int64_t mainzisegmap_223067_total_runtime;
    int mainzisegmap_223067_runs;
    CUfunction mainzisegmap_223084;
    int64_t mainzisegmap_223084_total_runtime;
    int mainzisegmap_223084_runs;
    CUfunction mainzisegmap_223112;
    int64_t mainzisegmap_223112_total_runtime;
    int mainzisegmap_223112_runs;
    CUfunction mainzisegmap_223236;
    int64_t mainzisegmap_223236_total_runtime;
    int mainzisegmap_223236_runs;
    CUfunction mainzisegmap_223423;
    int64_t mainzisegmap_223423_total_runtime;
    int mainzisegmap_223423_runs;
    CUfunction mainzisegmap_224073;
    int64_t mainzisegmap_224073_total_runtime;
    int mainzisegmap_224073_runs;
    CUfunction mainzisegmap_224090;
    int64_t mainzisegmap_224090_total_runtime;
    int mainzisegmap_224090_runs;
    CUfunction mainzisegmap_224120;
    int64_t mainzisegmap_224120_total_runtime;
    int mainzisegmap_224120_runs;
    CUfunction mainzisegmap_224284;
    int64_t mainzisegmap_224284_total_runtime;
    int mainzisegmap_224284_runs;
    CUfunction mainzisegmap_224529;
    int64_t mainzisegmap_224529_total_runtime;
    int mainzisegmap_224529_runs;
    CUfunction mainzisegmap_225327;
    int64_t mainzisegmap_225327_total_runtime;
    int mainzisegmap_225327_runs;
    CUfunction mainzisegmap_225344;
    int64_t mainzisegmap_225344_total_runtime;
    int mainzisegmap_225344_runs;
    CUfunction mainzisegmap_225374;
    int64_t mainzisegmap_225374_total_runtime;
    int mainzisegmap_225374_runs;
    CUfunction mainzisegmap_225582;
    int64_t mainzisegmap_225582_total_runtime;
    int mainzisegmap_225582_runs;
    CUfunction mainzisegmap_225873;
    int64_t mainzisegmap_225873_total_runtime;
    int mainzisegmap_225873_runs;
    CUfunction mainzisegmap_225890;
    int64_t mainzisegmap_225890_total_runtime;
    int mainzisegmap_225890_runs;
    CUfunction mainzisegmap_226185;
    int64_t mainzisegmap_226185_total_runtime;
    int mainzisegmap_226185_runs;
    CUfunction mainzisegmap_226202;
    int64_t mainzisegmap_226202_total_runtime;
    int mainzisegmap_226202_runs;
    CUfunction mainzisegmap_226589;
    int64_t mainzisegmap_226589_total_runtime;
    int mainzisegmap_226589_runs;
    CUfunction mainzisegmap_226606;
    int64_t mainzisegmap_226606_total_runtime;
    int mainzisegmap_226606_runs;
    CUfunction mainzisegmap_226894;
    int64_t mainzisegmap_226894_total_runtime;
    int mainzisegmap_226894_runs;
    CUfunction mainzisegmap_227111;
    int64_t mainzisegmap_227111_total_runtime;
    int mainzisegmap_227111_runs;
    CUfunction mainzisegmap_227132;
    int64_t mainzisegmap_227132_total_runtime;
    int mainzisegmap_227132_runs;
    CUfunction mainzisegmap_227261;
    int64_t mainzisegmap_227261_total_runtime;
    int mainzisegmap_227261_runs;
    CUfunction mainzisegmap_227986;
    int64_t mainzisegmap_227986_total_runtime;
    int mainzisegmap_227986_runs;
    CUfunction mainzisegmap_228041;
    int64_t mainzisegmap_228041_total_runtime;
    int mainzisegmap_228041_runs;
    CUfunction mainzisegmap_228103;
    int64_t mainzisegmap_228103_total_runtime;
    int mainzisegmap_228103_runs;
    CUfunction mainzisegmap_228189;
    int64_t mainzisegmap_228189_total_runtime;
    int mainzisegmap_228189_runs;
    CUfunction mainzisegmap_228212;
    int64_t mainzisegmap_228212_total_runtime;
    int mainzisegmap_228212_runs;
    CUfunction mainzisegmap_intragroup_206893;
    int64_t mainzisegmap_intragroup_206893_total_runtime;
    int mainzisegmap_intragroup_206893_runs;
    CUfunction mainzisegmap_intragroup_207248;
    int64_t mainzisegmap_intragroup_207248_total_runtime;
    int mainzisegmap_intragroup_207248_runs;
    CUfunction mainzisegmap_intragroup_207524;
    int64_t mainzisegmap_intragroup_207524_total_runtime;
    int mainzisegmap_intragroup_207524_runs;
    CUfunction mainzisegmap_intragroup_207777;
    int64_t mainzisegmap_intragroup_207777_total_runtime;
    int mainzisegmap_intragroup_207777_runs;
    CUfunction mainzisegmap_intragroup_208681;
    int64_t mainzisegmap_intragroup_208681_total_runtime;
    int mainzisegmap_intragroup_208681_runs;
    CUfunction mainzisegmap_intragroup_209082;
    int64_t mainzisegmap_intragroup_209082_total_runtime;
    int mainzisegmap_intragroup_209082_runs;
    CUfunction mainzisegmap_intragroup_209708;
    int64_t mainzisegmap_intragroup_209708_total_runtime;
    int mainzisegmap_intragroup_209708_runs;
    CUfunction mainzisegmap_intragroup_211768;
    int64_t mainzisegmap_intragroup_211768_total_runtime;
    int mainzisegmap_intragroup_211768_runs;
    CUfunction mainzisegmap_intragroup_213836;
    int64_t mainzisegmap_intragroup_213836_total_runtime;
    int mainzisegmap_intragroup_213836_runs;
    CUfunction mainzisegmap_intragroup_216411;
    int64_t mainzisegmap_intragroup_216411_total_runtime;
    int mainzisegmap_intragroup_216411_runs;
    CUfunction mainzisegmap_intragroup_217183;
    int64_t mainzisegmap_intragroup_217183_total_runtime;
    int mainzisegmap_intragroup_217183_runs;
    CUfunction mainzisegmap_intragroup_217504;
    int64_t mainzisegmap_intragroup_217504_total_runtime;
    int mainzisegmap_intragroup_217504_runs;
    CUfunction mainzisegmap_intragroup_217955;
    int64_t mainzisegmap_intragroup_217955_total_runtime;
    int mainzisegmap_intragroup_217955_runs;
    CUfunction mainzisegmap_intragroup_221669;
    int64_t mainzisegmap_intragroup_221669_total_runtime;
    int mainzisegmap_intragroup_221669_runs;
    CUfunction mainzisegmap_intragroup_221836;
    int64_t mainzisegmap_intragroup_221836_total_runtime;
    int mainzisegmap_intragroup_221836_runs;
    CUfunction mainzisegmap_intragroup_222093;
    int64_t mainzisegmap_intragroup_222093_total_runtime;
    int mainzisegmap_intragroup_222093_runs;
    CUfunction mainzisegmap_intragroup_225917;
    int64_t mainzisegmap_intragroup_225917_total_runtime;
    int mainzisegmap_intragroup_225917_runs;
    CUfunction mainzisegmap_intragroup_226230;
    int64_t mainzisegmap_intragroup_226230_total_runtime;
    int mainzisegmap_intragroup_226230_runs;
    CUfunction mainzisegmap_intragroup_226634;
    int64_t mainzisegmap_intragroup_226634_total_runtime;
    int mainzisegmap_intragroup_226634_runs;
    CUfunction mainzisegmap_intragroup_226984;
    int64_t mainzisegmap_intragroup_226984_total_runtime;
    int mainzisegmap_intragroup_226984_runs;
    CUfunction mainzisegmap_intragroup_227359;
    int64_t mainzisegmap_intragroup_227359_total_runtime;
    int mainzisegmap_intragroup_227359_runs;
    CUfunction mainzisegmap_intragroup_227815;
    int64_t mainzisegmap_intragroup_227815_total_runtime;
    int mainzisegmap_intragroup_227815_runs;
    CUfunction mainzisegred_large_212003;
    int64_t mainzisegred_large_212003_total_runtime;
    int mainzisegred_large_212003_runs;
    CUfunction mainzisegred_large_212077;
    int64_t mainzisegred_large_212077_total_runtime;
    int mainzisegred_large_212077_runs;
    CUfunction mainzisegred_large_214137;
    int64_t mainzisegred_large_214137_total_runtime;
    int mainzisegred_large_214137_runs;
    CUfunction mainzisegred_large_214231;
    int64_t mainzisegred_large_214231_total_runtime;
    int mainzisegred_large_214231_runs;
    CUfunction mainzisegred_large_216784;
    int64_t mainzisegred_large_216784_total_runtime;
    int mainzisegred_large_216784_runs;
    CUfunction mainzisegred_large_216907;
    int64_t mainzisegred_large_216907_total_runtime;
    int mainzisegred_large_216907_runs;
    CUfunction mainzisegred_large_218631;
    int64_t mainzisegred_large_218631_total_runtime;
    int mainzisegred_large_218631_runs;
    CUfunction mainzisegred_large_218762;
    int64_t mainzisegred_large_218762_total_runtime;
    int mainzisegred_large_218762_runs;
    CUfunction mainzisegred_large_218893;
    int64_t mainzisegred_large_218893_total_runtime;
    int mainzisegred_large_218893_runs;
    CUfunction mainzisegred_large_219515;
    int64_t mainzisegred_large_219515_total_runtime;
    int mainzisegred_large_219515_runs;
    CUfunction mainzisegred_large_219564;
    int64_t mainzisegred_large_219564_total_runtime;
    int mainzisegred_large_219564_runs;
    CUfunction mainzisegred_large_220344;
    int64_t mainzisegred_large_220344_total_runtime;
    int mainzisegred_large_220344_runs;
    CUfunction mainzisegred_large_220413;
    int64_t mainzisegred_large_220413_total_runtime;
    int mainzisegred_large_220413_runs;
    CUfunction mainzisegred_large_221423;
    int64_t mainzisegred_large_221423_total_runtime;
    int mainzisegred_large_221423_runs;
    CUfunction mainzisegred_large_221521;
    int64_t mainzisegred_large_221521_total_runtime;
    int mainzisegred_large_221521_runs;
    CUfunction mainzisegred_large_223197;
    int64_t mainzisegred_large_223197_total_runtime;
    int mainzisegred_large_223197_runs;
    CUfunction mainzisegred_large_223249;
    int64_t mainzisegred_large_223249_total_runtime;
    int mainzisegred_large_223249_runs;
    CUfunction mainzisegred_large_224235;
    int64_t mainzisegred_large_224235_total_runtime;
    int mainzisegred_large_224235_runs;
    CUfunction mainzisegred_large_224307;
    int64_t mainzisegred_large_224307_total_runtime;
    int mainzisegred_large_224307_runs;
    CUfunction mainzisegred_large_225523;
    int64_t mainzisegred_large_225523_total_runtime;
    int mainzisegred_large_225523_runs;
    CUfunction mainzisegred_large_225624;
    int64_t mainzisegred_large_225624_total_runtime;
    int mainzisegred_large_225624_runs;
    CUfunction mainzisegred_large_228090;
    int64_t mainzisegred_large_228090_total_runtime;
    int mainzisegred_large_228090_runs;
    CUfunction mainzisegred_small_212003;
    int64_t mainzisegred_small_212003_total_runtime;
    int mainzisegred_small_212003_runs;
    CUfunction mainzisegred_small_212077;
    int64_t mainzisegred_small_212077_total_runtime;
    int mainzisegred_small_212077_runs;
    CUfunction mainzisegred_small_214137;
    int64_t mainzisegred_small_214137_total_runtime;
    int mainzisegred_small_214137_runs;
    CUfunction mainzisegred_small_214231;
    int64_t mainzisegred_small_214231_total_runtime;
    int mainzisegred_small_214231_runs;
    CUfunction mainzisegred_small_216784;
    int64_t mainzisegred_small_216784_total_runtime;
    int mainzisegred_small_216784_runs;
    CUfunction mainzisegred_small_216907;
    int64_t mainzisegred_small_216907_total_runtime;
    int mainzisegred_small_216907_runs;
    CUfunction mainzisegred_small_218631;
    int64_t mainzisegred_small_218631_total_runtime;
    int mainzisegred_small_218631_runs;
    CUfunction mainzisegred_small_218762;
    int64_t mainzisegred_small_218762_total_runtime;
    int mainzisegred_small_218762_runs;
    CUfunction mainzisegred_small_218893;
    int64_t mainzisegred_small_218893_total_runtime;
    int mainzisegred_small_218893_runs;
    CUfunction mainzisegred_small_219515;
    int64_t mainzisegred_small_219515_total_runtime;
    int mainzisegred_small_219515_runs;
    CUfunction mainzisegred_small_219564;
    int64_t mainzisegred_small_219564_total_runtime;
    int mainzisegred_small_219564_runs;
    CUfunction mainzisegred_small_220344;
    int64_t mainzisegred_small_220344_total_runtime;
    int mainzisegred_small_220344_runs;
    CUfunction mainzisegred_small_220413;
    int64_t mainzisegred_small_220413_total_runtime;
    int mainzisegred_small_220413_runs;
    CUfunction mainzisegred_small_221423;
    int64_t mainzisegred_small_221423_total_runtime;
    int mainzisegred_small_221423_runs;
    CUfunction mainzisegred_small_221521;
    int64_t mainzisegred_small_221521_total_runtime;
    int mainzisegred_small_221521_runs;
    CUfunction mainzisegred_small_223197;
    int64_t mainzisegred_small_223197_total_runtime;
    int mainzisegred_small_223197_runs;
    CUfunction mainzisegred_small_223249;
    int64_t mainzisegred_small_223249_total_runtime;
    int mainzisegred_small_223249_runs;
    CUfunction mainzisegred_small_224235;
    int64_t mainzisegred_small_224235_total_runtime;
    int mainzisegred_small_224235_runs;
    CUfunction mainzisegred_small_224307;
    int64_t mainzisegred_small_224307_total_runtime;
    int mainzisegred_small_224307_runs;
    CUfunction mainzisegred_small_225523;
    int64_t mainzisegred_small_225523_total_runtime;
    int mainzisegred_small_225523_runs;
    CUfunction mainzisegred_small_225624;
    int64_t mainzisegred_small_225624_total_runtime;
    int mainzisegred_small_225624_runs;
    CUfunction mainzisegred_small_228090;
    int64_t mainzisegred_small_228090_total_runtime;
    int mainzisegred_small_228090_runs;
    CUfunction mainzisegscan_206867;
    int64_t mainzisegscan_206867_total_runtime;
    int mainzisegscan_206867_runs;
    CUfunction mainzisegscan_207007;
    int64_t mainzisegscan_207007_total_runtime;
    int mainzisegscan_207007_runs;
    CUfunction mainzisegscan_207559;
    int64_t mainzisegscan_207559_total_runtime;
    int mainzisegscan_207559_runs;
    CUfunction mainzisegscan_218683;
    int64_t mainzisegscan_218683_total_runtime;
    int mainzisegscan_218683_runs;
    CUfunction mainzisegscan_218814;
    int64_t mainzisegscan_218814_total_runtime;
    int mainzisegscan_218814_runs;
    CUfunction mainzisegscan_218945;
    int64_t mainzisegscan_218945_total_runtime;
    int mainzisegscan_218945_runs;
    CUfunction mainzisegscan_227915;
    int64_t mainzisegscan_227915_total_runtime;
    int mainzisegscan_227915_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_232966,
                                           ctx->cuda.module,
                                           "builtinzhreplicate_f64zireplicate_232966"));
    ctx->builtinzhreplicate_f64zireplicate_232966_total_runtime = 0;
    ctx->builtinzhreplicate_f64zireplicate_232966_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->builtinzhreplicate_i64zireplicate_232507,
                                           ctx->cuda.module,
                                           "builtinzhreplicate_i64zireplicate_232507"));
    ctx->builtinzhreplicate_i64zireplicate_232507_total_runtime = 0;
    ctx->builtinzhreplicate_i64zireplicate_232507_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->builtinzhreplicate_i8zireplicate_232265,
                                           ctx->cuda.module,
                                           "builtinzhreplicate_i8zireplicate_232265"));
    ctx->builtinzhreplicate_i8zireplicate_232265_total_runtime = 0;
    ctx->builtinzhreplicate_i8zireplicate_232265_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_232525,
                                           ctx->cuda.module,
                                           "mainzicopy_232525"));
    ctx->mainzicopy_232525_total_runtime = 0;
    ctx->mainzicopy_232525_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzicopy_232726,
                                           ctx->cuda.module,
                                           "mainzicopy_232726"));
    ctx->mainzicopy_232726_total_runtime = 0;
    ctx->mainzicopy_232726_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzicopy_234763,
                                           ctx->cuda.module,
                                           "mainzicopy_234763"));
    ctx->mainzicopy_234763_total_runtime = 0;
    ctx->mainzicopy_234763_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzicopy_234962,
                                           ctx->cuda.module,
                                           "mainzicopy_234962"));
    ctx->mainzicopy_234962_total_runtime = 0;
    ctx->mainzicopy_234962_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzicopy_235212,
                                           ctx->cuda.module,
                                           "mainzicopy_235212"));
    ctx->mainzicopy_235212_total_runtime = 0;
    ctx->mainzicopy_235212_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzicopy_235590,
                                           ctx->cuda.module,
                                           "mainzicopy_235590"));
    ctx->mainzicopy_235590_total_runtime = 0;
    ctx->mainzicopy_235590_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzicopy_235812,
                                           ctx->cuda.module,
                                           "mainzicopy_235812"));
    ctx->mainzicopy_235812_total_runtime = 0;
    ctx->mainzicopy_235812_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzicopy_236085,
                                           ctx->cuda.module,
                                           "mainzicopy_236085"));
    ctx->mainzicopy_236085_total_runtime = 0;
    ctx->mainzicopy_236085_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_206869,
                                           ctx->cuda.module,
                                           "mainzisegmap_206869"));
    ctx->mainzisegmap_206869_total_runtime = 0;
    ctx->mainzisegmap_206869_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_207045,
                                           ctx->cuda.module,
                                           "mainzisegmap_207045"));
    ctx->mainzisegmap_207045_total_runtime = 0;
    ctx->mainzisegmap_207045_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_207170,
                                           ctx->cuda.module,
                                           "mainzisegmap_207170"));
    ctx->mainzisegmap_207170_total_runtime = 0;
    ctx->mainzisegmap_207170_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_207605,
                                           ctx->cuda.module,
                                           "mainzisegmap_207605"));
    ctx->mainzisegmap_207605_total_runtime = 0;
    ctx->mainzisegmap_207605_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_208818,
                                           ctx->cuda.module,
                                           "mainzisegmap_208818"));
    ctx->mainzisegmap_208818_total_runtime = 0;
    ctx->mainzisegmap_208818_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_208832,
                                           ctx->cuda.module,
                                           "mainzisegmap_208832"));
    ctx->mainzisegmap_208832_total_runtime = 0;
    ctx->mainzisegmap_208832_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_208856,
                                           ctx->cuda.module,
                                           "mainzisegmap_208856"));
    ctx->mainzisegmap_208856_total_runtime = 0;
    ctx->mainzisegmap_208856_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_209466,
                                           ctx->cuda.module,
                                           "mainzisegmap_209466"));
    ctx->mainzisegmap_209466_total_runtime = 0;
    ctx->mainzisegmap_209466_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_209478,
                                           ctx->cuda.module,
                                           "mainzisegmap_209478"));
    ctx->mainzisegmap_209478_total_runtime = 0;
    ctx->mainzisegmap_209478_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_209499,
                                           ctx->cuda.module,
                                           "mainzisegmap_209499"));
    ctx->mainzisegmap_209499_total_runtime = 0;
    ctx->mainzisegmap_209499_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_210092,
                                           ctx->cuda.module,
                                           "mainzisegmap_210092"));
    ctx->mainzisegmap_210092_total_runtime = 0;
    ctx->mainzisegmap_210092_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_210104,
                                           ctx->cuda.module,
                                           "mainzisegmap_210104"));
    ctx->mainzisegmap_210104_total_runtime = 0;
    ctx->mainzisegmap_210104_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_210125,
                                           ctx->cuda.module,
                                           "mainzisegmap_210125"));
    ctx->mainzisegmap_210125_total_runtime = 0;
    ctx->mainzisegmap_210125_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_210267,
                                           ctx->cuda.module,
                                           "mainzisegmap_210267"));
    ctx->mainzisegmap_210267_total_runtime = 0;
    ctx->mainzisegmap_210267_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_210412,
                                           ctx->cuda.module,
                                           "mainzisegmap_210412"));
    ctx->mainzisegmap_210412_total_runtime = 0;
    ctx->mainzisegmap_210412_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_210542,
                                           ctx->cuda.module,
                                           "mainzisegmap_210542"));
    ctx->mainzisegmap_210542_total_runtime = 0;
    ctx->mainzisegmap_210542_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_211682,
                                           ctx->cuda.module,
                                           "mainzisegmap_211682"));
    ctx->mainzisegmap_211682_total_runtime = 0;
    ctx->mainzisegmap_211682_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_211890,
                                           ctx->cuda.module,
                                           "mainzisegmap_211890"));
    ctx->mainzisegmap_211890_total_runtime = 0;
    ctx->mainzisegmap_211890_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_211979,
                                           ctx->cuda.module,
                                           "mainzisegmap_211979"));
    ctx->mainzisegmap_211979_total_runtime = 0;
    ctx->mainzisegmap_211979_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_212051,
                                           ctx->cuda.module,
                                           "mainzisegmap_212051"));
    ctx->mainzisegmap_212051_total_runtime = 0;
    ctx->mainzisegmap_212051_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_212265,
                                           ctx->cuda.module,
                                           "mainzisegmap_212265"));
    ctx->mainzisegmap_212265_total_runtime = 0;
    ctx->mainzisegmap_212265_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_213719,
                                           ctx->cuda.module,
                                           "mainzisegmap_213719"));
    ctx->mainzisegmap_213719_total_runtime = 0;
    ctx->mainzisegmap_213719_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_213994,
                                           ctx->cuda.module,
                                           "mainzisegmap_213994"));
    ctx->mainzisegmap_213994_total_runtime = 0;
    ctx->mainzisegmap_213994_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_214111,
                                           ctx->cuda.module,
                                           "mainzisegmap_214111"));
    ctx->mainzisegmap_214111_total_runtime = 0;
    ctx->mainzisegmap_214111_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_214195,
                                           ctx->cuda.module,
                                           "mainzisegmap_214195"));
    ctx->mainzisegmap_214195_total_runtime = 0;
    ctx->mainzisegmap_214195_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_214470,
                                           ctx->cuda.module,
                                           "mainzisegmap_214470"));
    ctx->mainzisegmap_214470_total_runtime = 0;
    ctx->mainzisegmap_214470_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_216262,
                                           ctx->cuda.module,
                                           "mainzisegmap_216262"));
    ctx->mainzisegmap_216262_total_runtime = 0;
    ctx->mainzisegmap_216262_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_216607,
                                           ctx->cuda.module,
                                           "mainzisegmap_216607"));
    ctx->mainzisegmap_216607_total_runtime = 0;
    ctx->mainzisegmap_216607_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_216756,
                                           ctx->cuda.module,
                                           "mainzisegmap_216756"));
    ctx->mainzisegmap_216756_total_runtime = 0;
    ctx->mainzisegmap_216756_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_216852,
                                           ctx->cuda.module,
                                           "mainzisegmap_216852"));
    ctx->mainzisegmap_216852_total_runtime = 0;
    ctx->mainzisegmap_216852_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_218413,
                                           ctx->cuda.module,
                                           "mainzisegmap_218413"));
    ctx->mainzisegmap_218413_total_runtime = 0;
    ctx->mainzisegmap_218413_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_218562,
                                           ctx->cuda.module,
                                           "mainzisegmap_218562"));
    ctx->mainzisegmap_218562_total_runtime = 0;
    ctx->mainzisegmap_218562_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_218598,
                                           ctx->cuda.module,
                                           "mainzisegmap_218598"));
    ctx->mainzisegmap_218598_total_runtime = 0;
    ctx->mainzisegmap_218598_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_218729,
                                           ctx->cuda.module,
                                           "mainzisegmap_218729"));
    ctx->mainzisegmap_218729_total_runtime = 0;
    ctx->mainzisegmap_218729_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_218860,
                                           ctx->cuda.module,
                                           "mainzisegmap_218860"));
    ctx->mainzisegmap_218860_total_runtime = 0;
    ctx->mainzisegmap_218860_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_219049,
                                           ctx->cuda.module,
                                           "mainzisegmap_219049"));
    ctx->mainzisegmap_219049_total_runtime = 0;
    ctx->mainzisegmap_219049_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_219434,
                                           ctx->cuda.module,
                                           "mainzisegmap_219434"));
    ctx->mainzisegmap_219434_total_runtime = 0;
    ctx->mainzisegmap_219434_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_219551,
                                           ctx->cuda.module,
                                           "mainzisegmap_219551"));
    ctx->mainzisegmap_219551_total_runtime = 0;
    ctx->mainzisegmap_219551_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_219712,
                                           ctx->cuda.module,
                                           "mainzisegmap_219712"));
    ctx->mainzisegmap_219712_total_runtime = 0;
    ctx->mainzisegmap_219712_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_220233,
                                           ctx->cuda.module,
                                           "mainzisegmap_220233"));
    ctx->mainzisegmap_220233_total_runtime = 0;
    ctx->mainzisegmap_220233_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_220390,
                                           ctx->cuda.module,
                                           "mainzisegmap_220390"));
    ctx->mainzisegmap_220390_total_runtime = 0;
    ctx->mainzisegmap_220390_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_220609,
                                           ctx->cuda.module,
                                           "mainzisegmap_220609"));
    ctx->mainzisegmap_220609_total_runtime = 0;
    ctx->mainzisegmap_220609_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_221278,
                                           ctx->cuda.module,
                                           "mainzisegmap_221278"));
    ctx->mainzisegmap_221278_total_runtime = 0;
    ctx->mainzisegmap_221278_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_221479,
                                           ctx->cuda.module,
                                           "mainzisegmap_221479"));
    ctx->mainzisegmap_221479_total_runtime = 0;
    ctx->mainzisegmap_221479_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_222349,
                                           ctx->cuda.module,
                                           "mainzisegmap_222349"));
    ctx->mainzisegmap_222349_total_runtime = 0;
    ctx->mainzisegmap_222349_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_222444,
                                           ctx->cuda.module,
                                           "mainzisegmap_222444"));
    ctx->mainzisegmap_222444_total_runtime = 0;
    ctx->mainzisegmap_222444_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_222551,
                                           ctx->cuda.module,
                                           "mainzisegmap_222551"));
    ctx->mainzisegmap_222551_total_runtime = 0;
    ctx->mainzisegmap_222551_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_223067,
                                           ctx->cuda.module,
                                           "mainzisegmap_223067"));
    ctx->mainzisegmap_223067_total_runtime = 0;
    ctx->mainzisegmap_223067_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_223084,
                                           ctx->cuda.module,
                                           "mainzisegmap_223084"));
    ctx->mainzisegmap_223084_total_runtime = 0;
    ctx->mainzisegmap_223084_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_223112,
                                           ctx->cuda.module,
                                           "mainzisegmap_223112"));
    ctx->mainzisegmap_223112_total_runtime = 0;
    ctx->mainzisegmap_223112_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_223236,
                                           ctx->cuda.module,
                                           "mainzisegmap_223236"));
    ctx->mainzisegmap_223236_total_runtime = 0;
    ctx->mainzisegmap_223236_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_223423,
                                           ctx->cuda.module,
                                           "mainzisegmap_223423"));
    ctx->mainzisegmap_223423_total_runtime = 0;
    ctx->mainzisegmap_223423_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_224073,
                                           ctx->cuda.module,
                                           "mainzisegmap_224073"));
    ctx->mainzisegmap_224073_total_runtime = 0;
    ctx->mainzisegmap_224073_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_224090,
                                           ctx->cuda.module,
                                           "mainzisegmap_224090"));
    ctx->mainzisegmap_224090_total_runtime = 0;
    ctx->mainzisegmap_224090_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_224120,
                                           ctx->cuda.module,
                                           "mainzisegmap_224120"));
    ctx->mainzisegmap_224120_total_runtime = 0;
    ctx->mainzisegmap_224120_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_224284,
                                           ctx->cuda.module,
                                           "mainzisegmap_224284"));
    ctx->mainzisegmap_224284_total_runtime = 0;
    ctx->mainzisegmap_224284_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_224529,
                                           ctx->cuda.module,
                                           "mainzisegmap_224529"));
    ctx->mainzisegmap_224529_total_runtime = 0;
    ctx->mainzisegmap_224529_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_225327,
                                           ctx->cuda.module,
                                           "mainzisegmap_225327"));
    ctx->mainzisegmap_225327_total_runtime = 0;
    ctx->mainzisegmap_225327_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_225344,
                                           ctx->cuda.module,
                                           "mainzisegmap_225344"));
    ctx->mainzisegmap_225344_total_runtime = 0;
    ctx->mainzisegmap_225344_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_225374,
                                           ctx->cuda.module,
                                           "mainzisegmap_225374"));
    ctx->mainzisegmap_225374_total_runtime = 0;
    ctx->mainzisegmap_225374_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_225582,
                                           ctx->cuda.module,
                                           "mainzisegmap_225582"));
    ctx->mainzisegmap_225582_total_runtime = 0;
    ctx->mainzisegmap_225582_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_225873,
                                           ctx->cuda.module,
                                           "mainzisegmap_225873"));
    ctx->mainzisegmap_225873_total_runtime = 0;
    ctx->mainzisegmap_225873_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_225890,
                                           ctx->cuda.module,
                                           "mainzisegmap_225890"));
    ctx->mainzisegmap_225890_total_runtime = 0;
    ctx->mainzisegmap_225890_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_226185,
                                           ctx->cuda.module,
                                           "mainzisegmap_226185"));
    ctx->mainzisegmap_226185_total_runtime = 0;
    ctx->mainzisegmap_226185_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_226202,
                                           ctx->cuda.module,
                                           "mainzisegmap_226202"));
    ctx->mainzisegmap_226202_total_runtime = 0;
    ctx->mainzisegmap_226202_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_226589,
                                           ctx->cuda.module,
                                           "mainzisegmap_226589"));
    ctx->mainzisegmap_226589_total_runtime = 0;
    ctx->mainzisegmap_226589_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_226606,
                                           ctx->cuda.module,
                                           "mainzisegmap_226606"));
    ctx->mainzisegmap_226606_total_runtime = 0;
    ctx->mainzisegmap_226606_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_226894,
                                           ctx->cuda.module,
                                           "mainzisegmap_226894"));
    ctx->mainzisegmap_226894_total_runtime = 0;
    ctx->mainzisegmap_226894_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_227111,
                                           ctx->cuda.module,
                                           "mainzisegmap_227111"));
    ctx->mainzisegmap_227111_total_runtime = 0;
    ctx->mainzisegmap_227111_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_227132,
                                           ctx->cuda.module,
                                           "mainzisegmap_227132"));
    ctx->mainzisegmap_227132_total_runtime = 0;
    ctx->mainzisegmap_227132_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_227261,
                                           ctx->cuda.module,
                                           "mainzisegmap_227261"));
    ctx->mainzisegmap_227261_total_runtime = 0;
    ctx->mainzisegmap_227261_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_227986,
                                           ctx->cuda.module,
                                           "mainzisegmap_227986"));
    ctx->mainzisegmap_227986_total_runtime = 0;
    ctx->mainzisegmap_227986_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_228041,
                                           ctx->cuda.module,
                                           "mainzisegmap_228041"));
    ctx->mainzisegmap_228041_total_runtime = 0;
    ctx->mainzisegmap_228041_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_228103,
                                           ctx->cuda.module,
                                           "mainzisegmap_228103"));
    ctx->mainzisegmap_228103_total_runtime = 0;
    ctx->mainzisegmap_228103_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_228189,
                                           ctx->cuda.module,
                                           "mainzisegmap_228189"));
    ctx->mainzisegmap_228189_total_runtime = 0;
    ctx->mainzisegmap_228189_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_228212,
                                           ctx->cuda.module,
                                           "mainzisegmap_228212"));
    ctx->mainzisegmap_228212_total_runtime = 0;
    ctx->mainzisegmap_228212_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_intragroup_206893,
                                           ctx->cuda.module,
                                           "mainzisegmap_intragroup_206893"));
    ctx->mainzisegmap_intragroup_206893_total_runtime = 0;
    ctx->mainzisegmap_intragroup_206893_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_intragroup_207248,
                                           ctx->cuda.module,
                                           "mainzisegmap_intragroup_207248"));
    ctx->mainzisegmap_intragroup_207248_total_runtime = 0;
    ctx->mainzisegmap_intragroup_207248_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_intragroup_207524,
                                           ctx->cuda.module,
                                           "mainzisegmap_intragroup_207524"));
    ctx->mainzisegmap_intragroup_207524_total_runtime = 0;
    ctx->mainzisegmap_intragroup_207524_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_intragroup_207777,
                                           ctx->cuda.module,
                                           "mainzisegmap_intragroup_207777"));
    ctx->mainzisegmap_intragroup_207777_total_runtime = 0;
    ctx->mainzisegmap_intragroup_207777_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_intragroup_208681,
                                           ctx->cuda.module,
                                           "mainzisegmap_intragroup_208681"));
    ctx->mainzisegmap_intragroup_208681_total_runtime = 0;
    ctx->mainzisegmap_intragroup_208681_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_intragroup_209082,
                                           ctx->cuda.module,
                                           "mainzisegmap_intragroup_209082"));
    ctx->mainzisegmap_intragroup_209082_total_runtime = 0;
    ctx->mainzisegmap_intragroup_209082_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_intragroup_209708,
                                           ctx->cuda.module,
                                           "mainzisegmap_intragroup_209708"));
    ctx->mainzisegmap_intragroup_209708_total_runtime = 0;
    ctx->mainzisegmap_intragroup_209708_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_intragroup_211768,
                                           ctx->cuda.module,
                                           "mainzisegmap_intragroup_211768"));
    ctx->mainzisegmap_intragroup_211768_total_runtime = 0;
    ctx->mainzisegmap_intragroup_211768_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_intragroup_213836,
                                           ctx->cuda.module,
                                           "mainzisegmap_intragroup_213836"));
    ctx->mainzisegmap_intragroup_213836_total_runtime = 0;
    ctx->mainzisegmap_intragroup_213836_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_intragroup_216411,
                                           ctx->cuda.module,
                                           "mainzisegmap_intragroup_216411"));
    ctx->mainzisegmap_intragroup_216411_total_runtime = 0;
    ctx->mainzisegmap_intragroup_216411_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_intragroup_217183,
                                           ctx->cuda.module,
                                           "mainzisegmap_intragroup_217183"));
    ctx->mainzisegmap_intragroup_217183_total_runtime = 0;
    ctx->mainzisegmap_intragroup_217183_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_intragroup_217504,
                                           ctx->cuda.module,
                                           "mainzisegmap_intragroup_217504"));
    ctx->mainzisegmap_intragroup_217504_total_runtime = 0;
    ctx->mainzisegmap_intragroup_217504_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_intragroup_217955,
                                           ctx->cuda.module,
                                           "mainzisegmap_intragroup_217955"));
    ctx->mainzisegmap_intragroup_217955_total_runtime = 0;
    ctx->mainzisegmap_intragroup_217955_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_intragroup_221669,
                                           ctx->cuda.module,
                                           "mainzisegmap_intragroup_221669"));
    ctx->mainzisegmap_intragroup_221669_total_runtime = 0;
    ctx->mainzisegmap_intragroup_221669_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_intragroup_221836,
                                           ctx->cuda.module,
                                           "mainzisegmap_intragroup_221836"));
    ctx->mainzisegmap_intragroup_221836_total_runtime = 0;
    ctx->mainzisegmap_intragroup_221836_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_intragroup_222093,
                                           ctx->cuda.module,
                                           "mainzisegmap_intragroup_222093"));
    ctx->mainzisegmap_intragroup_222093_total_runtime = 0;
    ctx->mainzisegmap_intragroup_222093_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_intragroup_225917,
                                           ctx->cuda.module,
                                           "mainzisegmap_intragroup_225917"));
    ctx->mainzisegmap_intragroup_225917_total_runtime = 0;
    ctx->mainzisegmap_intragroup_225917_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_intragroup_226230,
                                           ctx->cuda.module,
                                           "mainzisegmap_intragroup_226230"));
    ctx->mainzisegmap_intragroup_226230_total_runtime = 0;
    ctx->mainzisegmap_intragroup_226230_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_intragroup_226634,
                                           ctx->cuda.module,
                                           "mainzisegmap_intragroup_226634"));
    ctx->mainzisegmap_intragroup_226634_total_runtime = 0;
    ctx->mainzisegmap_intragroup_226634_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_intragroup_226984,
                                           ctx->cuda.module,
                                           "mainzisegmap_intragroup_226984"));
    ctx->mainzisegmap_intragroup_226984_total_runtime = 0;
    ctx->mainzisegmap_intragroup_226984_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_intragroup_227359,
                                           ctx->cuda.module,
                                           "mainzisegmap_intragroup_227359"));
    ctx->mainzisegmap_intragroup_227359_total_runtime = 0;
    ctx->mainzisegmap_intragroup_227359_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_intragroup_227815,
                                           ctx->cuda.module,
                                           "mainzisegmap_intragroup_227815"));
    ctx->mainzisegmap_intragroup_227815_total_runtime = 0;
    ctx->mainzisegmap_intragroup_227815_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_large_212003,
                                           ctx->cuda.module,
                                           "mainzisegred_large_212003"));
    ctx->mainzisegred_large_212003_total_runtime = 0;
    ctx->mainzisegred_large_212003_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_large_212077,
                                           ctx->cuda.module,
                                           "mainzisegred_large_212077"));
    ctx->mainzisegred_large_212077_total_runtime = 0;
    ctx->mainzisegred_large_212077_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_large_214137,
                                           ctx->cuda.module,
                                           "mainzisegred_large_214137"));
    ctx->mainzisegred_large_214137_total_runtime = 0;
    ctx->mainzisegred_large_214137_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_large_214231,
                                           ctx->cuda.module,
                                           "mainzisegred_large_214231"));
    ctx->mainzisegred_large_214231_total_runtime = 0;
    ctx->mainzisegred_large_214231_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_large_216784,
                                           ctx->cuda.module,
                                           "mainzisegred_large_216784"));
    ctx->mainzisegred_large_216784_total_runtime = 0;
    ctx->mainzisegred_large_216784_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_large_216907,
                                           ctx->cuda.module,
                                           "mainzisegred_large_216907"));
    ctx->mainzisegred_large_216907_total_runtime = 0;
    ctx->mainzisegred_large_216907_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_large_218631,
                                           ctx->cuda.module,
                                           "mainzisegred_large_218631"));
    ctx->mainzisegred_large_218631_total_runtime = 0;
    ctx->mainzisegred_large_218631_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_large_218762,
                                           ctx->cuda.module,
                                           "mainzisegred_large_218762"));
    ctx->mainzisegred_large_218762_total_runtime = 0;
    ctx->mainzisegred_large_218762_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_large_218893,
                                           ctx->cuda.module,
                                           "mainzisegred_large_218893"));
    ctx->mainzisegred_large_218893_total_runtime = 0;
    ctx->mainzisegred_large_218893_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_large_219515,
                                           ctx->cuda.module,
                                           "mainzisegred_large_219515"));
    ctx->mainzisegred_large_219515_total_runtime = 0;
    ctx->mainzisegred_large_219515_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_large_219564,
                                           ctx->cuda.module,
                                           "mainzisegred_large_219564"));
    ctx->mainzisegred_large_219564_total_runtime = 0;
    ctx->mainzisegred_large_219564_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_large_220344,
                                           ctx->cuda.module,
                                           "mainzisegred_large_220344"));
    ctx->mainzisegred_large_220344_total_runtime = 0;
    ctx->mainzisegred_large_220344_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_large_220413,
                                           ctx->cuda.module,
                                           "mainzisegred_large_220413"));
    ctx->mainzisegred_large_220413_total_runtime = 0;
    ctx->mainzisegred_large_220413_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_large_221423,
                                           ctx->cuda.module,
                                           "mainzisegred_large_221423"));
    ctx->mainzisegred_large_221423_total_runtime = 0;
    ctx->mainzisegred_large_221423_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_large_221521,
                                           ctx->cuda.module,
                                           "mainzisegred_large_221521"));
    ctx->mainzisegred_large_221521_total_runtime = 0;
    ctx->mainzisegred_large_221521_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_large_223197,
                                           ctx->cuda.module,
                                           "mainzisegred_large_223197"));
    ctx->mainzisegred_large_223197_total_runtime = 0;
    ctx->mainzisegred_large_223197_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_large_223249,
                                           ctx->cuda.module,
                                           "mainzisegred_large_223249"));
    ctx->mainzisegred_large_223249_total_runtime = 0;
    ctx->mainzisegred_large_223249_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_large_224235,
                                           ctx->cuda.module,
                                           "mainzisegred_large_224235"));
    ctx->mainzisegred_large_224235_total_runtime = 0;
    ctx->mainzisegred_large_224235_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_large_224307,
                                           ctx->cuda.module,
                                           "mainzisegred_large_224307"));
    ctx->mainzisegred_large_224307_total_runtime = 0;
    ctx->mainzisegred_large_224307_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_large_225523,
                                           ctx->cuda.module,
                                           "mainzisegred_large_225523"));
    ctx->mainzisegred_large_225523_total_runtime = 0;
    ctx->mainzisegred_large_225523_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_large_225624,
                                           ctx->cuda.module,
                                           "mainzisegred_large_225624"));
    ctx->mainzisegred_large_225624_total_runtime = 0;
    ctx->mainzisegred_large_225624_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_large_228090,
                                           ctx->cuda.module,
                                           "mainzisegred_large_228090"));
    ctx->mainzisegred_large_228090_total_runtime = 0;
    ctx->mainzisegred_large_228090_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_small_212003,
                                           ctx->cuda.module,
                                           "mainzisegred_small_212003"));
    ctx->mainzisegred_small_212003_total_runtime = 0;
    ctx->mainzisegred_small_212003_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_small_212077,
                                           ctx->cuda.module,
                                           "mainzisegred_small_212077"));
    ctx->mainzisegred_small_212077_total_runtime = 0;
    ctx->mainzisegred_small_212077_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_small_214137,
                                           ctx->cuda.module,
                                           "mainzisegred_small_214137"));
    ctx->mainzisegred_small_214137_total_runtime = 0;
    ctx->mainzisegred_small_214137_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_small_214231,
                                           ctx->cuda.module,
                                           "mainzisegred_small_214231"));
    ctx->mainzisegred_small_214231_total_runtime = 0;
    ctx->mainzisegred_small_214231_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_small_216784,
                                           ctx->cuda.module,
                                           "mainzisegred_small_216784"));
    ctx->mainzisegred_small_216784_total_runtime = 0;
    ctx->mainzisegred_small_216784_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_small_216907,
                                           ctx->cuda.module,
                                           "mainzisegred_small_216907"));
    ctx->mainzisegred_small_216907_total_runtime = 0;
    ctx->mainzisegred_small_216907_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_small_218631,
                                           ctx->cuda.module,
                                           "mainzisegred_small_218631"));
    ctx->mainzisegred_small_218631_total_runtime = 0;
    ctx->mainzisegred_small_218631_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_small_218762,
                                           ctx->cuda.module,
                                           "mainzisegred_small_218762"));
    ctx->mainzisegred_small_218762_total_runtime = 0;
    ctx->mainzisegred_small_218762_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_small_218893,
                                           ctx->cuda.module,
                                           "mainzisegred_small_218893"));
    ctx->mainzisegred_small_218893_total_runtime = 0;
    ctx->mainzisegred_small_218893_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_small_219515,
                                           ctx->cuda.module,
                                           "mainzisegred_small_219515"));
    ctx->mainzisegred_small_219515_total_runtime = 0;
    ctx->mainzisegred_small_219515_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_small_219564,
                                           ctx->cuda.module,
                                           "mainzisegred_small_219564"));
    ctx->mainzisegred_small_219564_total_runtime = 0;
    ctx->mainzisegred_small_219564_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_small_220344,
                                           ctx->cuda.module,
                                           "mainzisegred_small_220344"));
    ctx->mainzisegred_small_220344_total_runtime = 0;
    ctx->mainzisegred_small_220344_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_small_220413,
                                           ctx->cuda.module,
                                           "mainzisegred_small_220413"));
    ctx->mainzisegred_small_220413_total_runtime = 0;
    ctx->mainzisegred_small_220413_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_small_221423,
                                           ctx->cuda.module,
                                           "mainzisegred_small_221423"));
    ctx->mainzisegred_small_221423_total_runtime = 0;
    ctx->mainzisegred_small_221423_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_small_221521,
                                           ctx->cuda.module,
                                           "mainzisegred_small_221521"));
    ctx->mainzisegred_small_221521_total_runtime = 0;
    ctx->mainzisegred_small_221521_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_small_223197,
                                           ctx->cuda.module,
                                           "mainzisegred_small_223197"));
    ctx->mainzisegred_small_223197_total_runtime = 0;
    ctx->mainzisegred_small_223197_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_small_223249,
                                           ctx->cuda.module,
                                           "mainzisegred_small_223249"));
    ctx->mainzisegred_small_223249_total_runtime = 0;
    ctx->mainzisegred_small_223249_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_small_224235,
                                           ctx->cuda.module,
                                           "mainzisegred_small_224235"));
    ctx->mainzisegred_small_224235_total_runtime = 0;
    ctx->mainzisegred_small_224235_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_small_224307,
                                           ctx->cuda.module,
                                           "mainzisegred_small_224307"));
    ctx->mainzisegred_small_224307_total_runtime = 0;
    ctx->mainzisegred_small_224307_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_small_225523,
                                           ctx->cuda.module,
                                           "mainzisegred_small_225523"));
    ctx->mainzisegred_small_225523_total_runtime = 0;
    ctx->mainzisegred_small_225523_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_small_225624,
                                           ctx->cuda.module,
                                           "mainzisegred_small_225624"));
    ctx->mainzisegred_small_225624_total_runtime = 0;
    ctx->mainzisegred_small_225624_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_small_228090,
                                           ctx->cuda.module,
                                           "mainzisegred_small_228090"));
    ctx->mainzisegred_small_228090_total_runtime = 0;
    ctx->mainzisegred_small_228090_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegscan_206867,
                                           ctx->cuda.module,
                                           "mainzisegscan_206867"));
    ctx->mainzisegscan_206867_total_runtime = 0;
    ctx->mainzisegscan_206867_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegscan_207007,
                                           ctx->cuda.module,
                                           "mainzisegscan_207007"));
    ctx->mainzisegscan_207007_total_runtime = 0;
    ctx->mainzisegscan_207007_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegscan_207559,
                                           ctx->cuda.module,
                                           "mainzisegscan_207559"));
    ctx->mainzisegscan_207559_total_runtime = 0;
    ctx->mainzisegscan_207559_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegscan_218683,
                                           ctx->cuda.module,
                                           "mainzisegscan_218683"));
    ctx->mainzisegscan_218683_total_runtime = 0;
    ctx->mainzisegscan_218683_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegscan_218814,
                                           ctx->cuda.module,
                                           "mainzisegscan_218814"));
    ctx->mainzisegscan_218814_total_runtime = 0;
    ctx->mainzisegscan_218814_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegscan_218945,
                                           ctx->cuda.module,
                                           "mainzisegscan_218945"));
    ctx->mainzisegscan_218945_total_runtime = 0;
    ctx->mainzisegscan_218945_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegscan_227915,
                                           ctx->cuda.module,
                                           "mainzisegscan_227915"));
    ctx->mainzisegscan_227915_total_runtime = 0;
    ctx->mainzisegscan_227915_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_232253.references = NULL;
        ctx->mainziid_counter_mem_232253.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainziid_counter_mem_232253.mem,
                                      (1 > 0 ? 1 : 1) * sizeof(int32_t)));
        if (1 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainziid_counter_mem_232253.mem,
                                            mainziid_counter_mem_realtype_237143,
                                            1 * sizeof(int32_t)));
    }
    {
        ctx->mainziid_counter_mem_232402.references = NULL;
        ctx->mainziid_counter_mem_232402.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainziid_counter_mem_232402.mem,
                                      (1 > 0 ? 1 : 1) * sizeof(int32_t)));
        if (1 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainziid_counter_mem_232402.mem,
                                            mainziid_counter_mem_realtype_237176,
                                            1 * sizeof(int32_t)));
    }
    {
        ctx->mainziid_counter_mem_232609.references = NULL;
        ctx->mainziid_counter_mem_232609.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainziid_counter_mem_232609.mem,
                                      (1 > 0 ? 1 : 1) * sizeof(int32_t)));
        if (1 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainziid_counter_mem_232609.mem,
                                            mainziid_counter_mem_realtype_237224,
                                            1 * sizeof(int32_t)));
    }
    {
        ctx->mainzicounter_mem_233183.references = NULL;
        ctx->mainzicounter_mem_233183.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainzicounter_mem_233183.mem,
                                      (10240 > 0 ? 10240 : 1) *
                                      sizeof(int32_t)));
        if (10240 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainzicounter_mem_233183.mem,
                                            mainzicounter_mem_realtype_237463,
                                            10240 * sizeof(int32_t)));
    }
    {
        ctx->mainzicounter_mem_233271.references = NULL;
        ctx->mainzicounter_mem_233271.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainzicounter_mem_233271.mem,
                                      (10240 > 0 ? 10240 : 1) *
                                      sizeof(int32_t)));
        if (10240 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainzicounter_mem_233271.mem,
                                            mainzicounter_mem_realtype_237500,
                                            10240 * sizeof(int32_t)));
    }
    {
        ctx->mainzicounter_mem_233532.references = NULL;
        ctx->mainzicounter_mem_233532.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainzicounter_mem_233532.mem,
                                      (10240 > 0 ? 10240 : 1) *
                                      sizeof(int32_t)));
        if (10240 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainzicounter_mem_233532.mem,
                                            mainzicounter_mem_realtype_237616,
                                            10240 * sizeof(int32_t)));
    }
    {
        ctx->mainzicounter_mem_233640.references = NULL;
        ctx->mainzicounter_mem_233640.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainzicounter_mem_233640.mem,
                                      (10240 > 0 ? 10240 : 1) *
                                      sizeof(int32_t)));
        if (10240 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainzicounter_mem_233640.mem,
                                            mainzicounter_mem_realtype_237670,
                                            10240 * sizeof(int32_t)));
    }
    {
        ctx->mainzicounter_mem_233945.references = NULL;
        ctx->mainzicounter_mem_233945.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainzicounter_mem_233945.mem,
                                      (10240 > 0 ? 10240 : 1) *
                                      sizeof(int32_t)));
        if (10240 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainzicounter_mem_233945.mem,
                                            mainzicounter_mem_realtype_237810,
                                            10240 * sizeof(int32_t)));
    }
    {
        ctx->mainzicounter_mem_234065.references = NULL;
        ctx->mainzicounter_mem_234065.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainzicounter_mem_234065.mem,
                                      (10240 > 0 ? 10240 : 1) *
                                      sizeof(int32_t)));
        if (10240 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainzicounter_mem_234065.mem,
                                            mainzicounter_mem_realtype_237878,
                                            10240 * sizeof(int32_t)));
    }
    {
        ctx->mainzicounter_mem_234260.references = NULL;
        ctx->mainzicounter_mem_234260.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainzicounter_mem_234260.mem,
                                      (10240 > 0 ? 10240 : 1) *
                                      sizeof(int32_t)));
        if (10240 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainzicounter_mem_234260.mem,
                                            mainzicounter_mem_realtype_238002,
                                            10240 * sizeof(int32_t)));
    }
    {
        ctx->mainziid_counter_mem_234297.references = NULL;
        ctx->mainziid_counter_mem_234297.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainziid_counter_mem_234297.mem,
                                      (1 > 0 ? 1 : 1) * sizeof(int32_t)));
        if (1 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainziid_counter_mem_234297.mem,
                                            mainziid_counter_mem_realtype_238014,
                                            1 * sizeof(int32_t)));
    }
    {
        ctx->mainzicounter_mem_234441.references = NULL;
        ctx->mainzicounter_mem_234441.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainzicounter_mem_234441.mem,
                                      (10240 > 0 ? 10240 : 1) *
                                      sizeof(int32_t)));
        if (10240 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainzicounter_mem_234441.mem,
                                            mainzicounter_mem_realtype_238039,
                                            10240 * sizeof(int32_t)));
    }
    {
        ctx->mainziid_counter_mem_234478.references = NULL;
        ctx->mainziid_counter_mem_234478.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainziid_counter_mem_234478.mem,
                                      (1 > 0 ? 1 : 1) * sizeof(int32_t)));
        if (1 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainziid_counter_mem_234478.mem,
                                            mainziid_counter_mem_realtype_238051,
                                            1 * sizeof(int32_t)));
    }
    {
        ctx->mainzicounter_mem_234622.references = NULL;
        ctx->mainzicounter_mem_234622.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainzicounter_mem_234622.mem,
                                      (10240 > 0 ? 10240 : 1) *
                                      sizeof(int32_t)));
        if (10240 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainzicounter_mem_234622.mem,
                                            mainzicounter_mem_realtype_238076,
                                            10240 * sizeof(int32_t)));
    }
    {
        ctx->mainziid_counter_mem_234659.references = NULL;
        ctx->mainziid_counter_mem_234659.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainziid_counter_mem_234659.mem,
                                      (1 > 0 ? 1 : 1) * sizeof(int32_t)));
        if (1 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainziid_counter_mem_234659.mem,
                                            mainziid_counter_mem_realtype_238088,
                                            1 * sizeof(int32_t)));
    }
    {
        ctx->mainzicounter_mem_234839.references = NULL;
        ctx->mainzicounter_mem_234839.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainzicounter_mem_234839.mem,
                                      (10240 > 0 ? 10240 : 1) *
                                      sizeof(int32_t)));
        if (10240 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainzicounter_mem_234839.mem,
                                            mainzicounter_mem_realtype_238132,
                                            10240 * sizeof(int32_t)));
    }
    {
        ctx->mainzicounter_mem_234921.references = NULL;
        ctx->mainzicounter_mem_234921.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainzicounter_mem_234921.mem,
                                      (10240 > 0 ? 10240 : 1) *
                                      sizeof(int32_t)));
        if (10240 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainzicounter_mem_234921.mem,
                                            mainzicounter_mem_realtype_238162,
                                            10240 * sizeof(int32_t)));
    }
    {
        ctx->mainzicounter_mem_235063.references = NULL;
        ctx->mainzicounter_mem_235063.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainzicounter_mem_235063.mem,
                                      (10240 > 0 ? 10240 : 1) *
                                      sizeof(int32_t)));
        if (10240 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainzicounter_mem_235063.mem,
                                            mainzicounter_mem_realtype_238218,
                                            10240 * sizeof(int32_t)));
    }
    {
        ctx->mainzicounter_mem_235165.references = NULL;
        ctx->mainzicounter_mem_235165.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainzicounter_mem_235165.mem,
                                      (10240 > 0 ? 10240 : 1) *
                                      sizeof(int32_t)));
        if (10240 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainzicounter_mem_235165.mem,
                                            mainzicounter_mem_realtype_238265,
                                            10240 * sizeof(int32_t)));
    }
    {
        ctx->mainzicounter_mem_235333.references = NULL;
        ctx->mainzicounter_mem_235333.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainzicounter_mem_235333.mem,
                                      (10240 > 0 ? 10240 : 1) *
                                      sizeof(int32_t)));
        if (10240 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainzicounter_mem_235333.mem,
                                            mainzicounter_mem_realtype_238333,
                                            10240 * sizeof(int32_t)));
    }
    {
        ctx->mainzicounter_mem_235447.references = NULL;
        ctx->mainzicounter_mem_235447.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainzicounter_mem_235447.mem,
                                      (10240 > 0 ? 10240 : 1) *
                                      sizeof(int32_t)));
        if (10240 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainzicounter_mem_235447.mem,
                                            mainzicounter_mem_realtype_238394,
                                            10240 * sizeof(int32_t)));
    }
    {
        ctx->mainzicounter_mem_235689.references = NULL;
        ctx->mainzicounter_mem_235689.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainzicounter_mem_235689.mem,
                                      (10240 > 0 ? 10240 : 1) *
                                      sizeof(int32_t)));
        if (10240 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainzicounter_mem_235689.mem,
                                            mainzicounter_mem_realtype_238552,
                                            10240 * sizeof(int32_t)));
    }
    {
        ctx->mainzicounter_mem_235771.references = NULL;
        ctx->mainzicounter_mem_235771.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainzicounter_mem_235771.mem,
                                      (10240 > 0 ? 10240 : 1) *
                                      sizeof(int32_t)));
        if (10240 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainzicounter_mem_235771.mem,
                                            mainzicounter_mem_realtype_238586,
                                            10240 * sizeof(int32_t)));
    }
    {
        ctx->mainzicounter_mem_235936.references = NULL;
        ctx->mainzicounter_mem_235936.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainzicounter_mem_235936.mem,
                                      (10240 > 0 ? 10240 : 1) *
                                      sizeof(int32_t)));
        if (10240 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainzicounter_mem_235936.mem,
                                            mainzicounter_mem_realtype_238667,
                                            10240 * sizeof(int32_t)));
    }
    {
        ctx->mainzicounter_mem_236038.references = NULL;
        ctx->mainzicounter_mem_236038.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainzicounter_mem_236038.mem,
                                      (10240 > 0 ? 10240 : 1) *
                                      sizeof(int32_t)));
        if (10240 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainzicounter_mem_236038.mem,
                                            mainzicounter_mem_realtype_238718,
                                            10240 * sizeof(int32_t)));
    }
    {
        ctx->mainzicounter_mem_236229.references = NULL;
        ctx->mainzicounter_mem_236229.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainzicounter_mem_236229.mem,
                                      (10240 > 0 ? 10240 : 1) *
                                      sizeof(int32_t)));
        if (10240 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainzicounter_mem_236229.mem,
                                            mainzicounter_mem_realtype_238811,
                                            10240 * sizeof(int32_t)));
    }
    {
        ctx->mainzicounter_mem_236343.references = NULL;
        ctx->mainzicounter_mem_236343.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainzicounter_mem_236343.mem,
                                      (10240 > 0 ? 10240 : 1) *
                                      sizeof(int32_t)));
        if (10240 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainzicounter_mem_236343.mem,
                                            mainzicounter_mem_realtype_238876,
                                            10240 * sizeof(int32_t)));
    }
    {
        ctx->mainziid_counter_mem_236686.references = NULL;
        ctx->mainziid_counter_mem_236686.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainziid_counter_mem_236686.mem,
                                      (1 > 0 ? 1 : 1) * sizeof(int32_t)));
        if (1 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainziid_counter_mem_236686.mem,
                                            mainziid_counter_mem_realtype_239098,
                                            1 * sizeof(int32_t)));
    }
    {
        ctx->mainzicounter_mem_237000.references = NULL;
        ctx->mainzicounter_mem_237000.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainzicounter_mem_237000.mem,
                                      (10240 > 0 ? 10240 : 1) *
                                      sizeof(int32_t)));
        if (10240 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainzicounter_mem_237000.mem,
                                            mainzicounter_mem_realtype_239144,
                                            10240 * sizeof(int32_t)));
    }
    ctx->tuning_params.builtinzhreplicate_f64zigroup_sizze_232969 =
        &cfg->tuning_params[0];
    ctx->tuning_params.builtinzhreplicate_i64zigroup_sizze_232510 =
        &cfg->tuning_params[1];
    ctx->tuning_params.builtinzhreplicate_i8zigroup_sizze_232268 =
        &cfg->tuning_params[2];
    ctx->tuning_params.mainzigroup_sizze_232528 = &cfg->tuning_params[3];
    ctx->tuning_params.mainzigroup_sizze_232729 = &cfg->tuning_params[4];
    ctx->tuning_params.mainzigroup_sizze_234766 = &cfg->tuning_params[5];
    ctx->tuning_params.mainzigroup_sizze_234965 = &cfg->tuning_params[6];
    ctx->tuning_params.mainzigroup_sizze_235215 = &cfg->tuning_params[7];
    ctx->tuning_params.mainzigroup_sizze_235593 = &cfg->tuning_params[8];
    ctx->tuning_params.mainzigroup_sizze_235815 = &cfg->tuning_params[9];
    ctx->tuning_params.mainzigroup_sizze_236088 = &cfg->tuning_params[10];
    ctx->tuning_params.mainzisegmap_group_sizze_206871 =
        &cfg->tuning_params[11];
    ctx->tuning_params.mainzisegmap_group_sizze_206925 =
        &cfg->tuning_params[12];
    ctx->tuning_params.mainzisegmap_group_sizze_207082 =
        &cfg->tuning_params[13];
    ctx->tuning_params.mainzisegmap_group_sizze_207350 =
        &cfg->tuning_params[14];
    ctx->tuning_params.mainzisegmap_group_sizze_208205 =
        &cfg->tuning_params[15];
    ctx->tuning_params.mainzisegmap_group_sizze_208444 =
        &cfg->tuning_params[16];
    ctx->tuning_params.mainzisegmap_group_sizze_208475 =
        &cfg->tuning_params[17];
    ctx->tuning_params.mainzisegmap_group_sizze_209207 =
        &cfg->tuning_params[18];
    ctx->tuning_params.mainzisegmap_group_sizze_209411 =
        &cfg->tuning_params[19];
    ctx->tuning_params.mainzisegmap_group_sizze_209437 =
        &cfg->tuning_params[20];
    ctx->tuning_params.mainzisegmap_group_sizze_209833 =
        &cfg->tuning_params[21];
    ctx->tuning_params.mainzisegmap_group_sizze_210037 =
        &cfg->tuning_params[22];
    ctx->tuning_params.mainzisegmap_group_sizze_210063 =
        &cfg->tuning_params[23];
    ctx->tuning_params.mainzisegmap_group_sizze_210236 =
        &cfg->tuning_params[24];
    ctx->tuning_params.mainzisegmap_group_sizze_210299 =
        &cfg->tuning_params[25];
    ctx->tuning_params.mainzisegmap_group_sizze_210441 =
        &cfg->tuning_params[26];
    ctx->tuning_params.mainzisegmap_group_sizze_210636 =
        &cfg->tuning_params[27];
    ctx->tuning_params.mainzisegmap_group_sizze_210971 =
        &cfg->tuning_params[28];
    ctx->tuning_params.mainzisegmap_group_sizze_211146 =
        &cfg->tuning_params[29];
    ctx->tuning_params.mainzisegmap_group_sizze_211232 =
        &cfg->tuning_params[30];
    ctx->tuning_params.mainzisegmap_group_sizze_212133 =
        &cfg->tuning_params[31];
    ctx->tuning_params.mainzisegmap_group_sizze_212389 =
        &cfg->tuning_params[32];
    ctx->tuning_params.mainzisegmap_group_sizze_212822 =
        &cfg->tuning_params[33];
    ctx->tuning_params.mainzisegmap_group_sizze_213054 =
        &cfg->tuning_params[34];
    ctx->tuning_params.mainzisegmap_group_sizze_213157 =
        &cfg->tuning_params[35];
    ctx->tuning_params.mainzisegmap_group_sizze_214306 =
        &cfg->tuning_params[36];
    ctx->tuning_params.mainzisegmap_group_sizze_214626 =
        &cfg->tuning_params[37];
    ctx->tuning_params.mainzisegmap_group_sizze_215167 =
        &cfg->tuning_params[38];
    ctx->tuning_params.mainzisegmap_group_sizze_215454 =
        &cfg->tuning_params[39];
    ctx->tuning_params.mainzisegmap_group_sizze_215584 =
        &cfg->tuning_params[40];
    ctx->tuning_params.mainzisegmap_group_sizze_218115 =
        &cfg->tuning_params[41];
    ctx->tuning_params.mainzisegmap_group_sizze_218511 =
        &cfg->tuning_params[42];
    ctx->tuning_params.mainzisegmap_group_sizze_218582 =
        &cfg->tuning_params[43];
    ctx->tuning_params.mainzisegmap_group_sizze_218713 =
        &cfg->tuning_params[44];
    ctx->tuning_params.mainzisegmap_group_sizze_218844 =
        &cfg->tuning_params[45];
    ctx->tuning_params.mainzisegmap_group_sizze_218975 =
        &cfg->tuning_params[46];
    ctx->tuning_params.mainzisegmap_group_sizze_219116 =
        &cfg->tuning_params[47];
    ctx->tuning_params.mainzisegmap_group_sizze_219247 =
        &cfg->tuning_params[48];
    ctx->tuning_params.mainzisegmap_group_sizze_219608 =
        &cfg->tuning_params[49];
    ctx->tuning_params.mainzisegmap_group_sizze_219808 =
        &cfg->tuning_params[50];
    ctx->tuning_params.mainzisegmap_group_sizze_219990 =
        &cfg->tuning_params[51];
    ctx->tuning_params.mainzisegmap_group_sizze_220473 =
        &cfg->tuning_params[52];
    ctx->tuning_params.mainzisegmap_group_sizze_220737 =
        &cfg->tuning_params[53];
    ctx->tuning_params.mainzisegmap_group_sizze_220968 =
        &cfg->tuning_params[54];
    ctx->tuning_params.mainzisegmap_group_sizze_222226 =
        &cfg->tuning_params[55];
    ctx->tuning_params.mainzisegmap_group_sizze_222413 =
        &cfg->tuning_params[56];
    ctx->tuning_params.mainzisegmap_group_sizze_222454 =
        &cfg->tuning_params[57];
    ctx->tuning_params.mainzisegmap_group_sizze_222643 =
        &cfg->tuning_params[58];
    ctx->tuning_params.mainzisegmap_group_sizze_222781 =
        &cfg->tuning_params[59];
    ctx->tuning_params.mainzisegmap_group_sizze_222980 =
        &cfg->tuning_params[60];
    ctx->tuning_params.mainzisegmap_group_sizze_223036 =
        &cfg->tuning_params[61];
    ctx->tuning_params.mainzisegmap_group_sizze_223296 =
        &cfg->tuning_params[62];
    ctx->tuning_params.mainzisegmap_group_sizze_223544 =
        &cfg->tuning_params[63];
    ctx->tuning_params.mainzisegmap_group_sizze_223733 =
        &cfg->tuning_params[64];
    ctx->tuning_params.mainzisegmap_group_sizze_223986 =
        &cfg->tuning_params[65];
    ctx->tuning_params.mainzisegmap_group_sizze_224042 =
        &cfg->tuning_params[66];
    ctx->tuning_params.mainzisegmap_group_sizze_224370 =
        &cfg->tuning_params[67];
    ctx->tuning_params.mainzisegmap_group_sizze_224682 =
        &cfg->tuning_params[68];
    ctx->tuning_params.mainzisegmap_group_sizze_224920 =
        &cfg->tuning_params[69];
    ctx->tuning_params.mainzisegmap_group_sizze_225240 =
        &cfg->tuning_params[70];
    ctx->tuning_params.mainzisegmap_group_sizze_225296 =
        &cfg->tuning_params[71];
    ctx->tuning_params.mainzisegmap_group_sizze_225786 =
        &cfg->tuning_params[72];
    ctx->tuning_params.mainzisegmap_group_sizze_225842 =
        &cfg->tuning_params[73];
    ctx->tuning_params.mainzisegmap_group_sizze_226098 =
        &cfg->tuning_params[74];
    ctx->tuning_params.mainzisegmap_group_sizze_226154 =
        &cfg->tuning_params[75];
    ctx->tuning_params.mainzisegmap_group_sizze_226502 =
        &cfg->tuning_params[76];
    ctx->tuning_params.mainzisegmap_group_sizze_226558 =
        &cfg->tuning_params[77];
    ctx->tuning_params.mainzisegmap_group_sizze_226771 =
        &cfg->tuning_params[78];
    ctx->tuning_params.mainzisegmap_group_sizze_227027 =
        &cfg->tuning_params[79];
    ctx->tuning_params.mainzisegmap_group_sizze_227070 =
        &cfg->tuning_params[80];
    ctx->tuning_params.mainzisegmap_group_sizze_227158 =
        &cfg->tuning_params[81];
    ctx->tuning_params.mainzisegmap_group_sizze_227577 =
        &cfg->tuning_params[82];
    ctx->tuning_params.mainzisegmap_group_sizze_228020 =
        &cfg->tuning_params[83];
    ctx->tuning_params.mainzisegmap_group_sizze_228055 =
        &cfg->tuning_params[84];
    ctx->tuning_params.mainzisegmap_group_sizze_228124 =
        &cfg->tuning_params[85];
    ctx->tuning_params.mainzisegmap_group_sizze_228214 =
        &cfg->tuning_params[86];
    ctx->tuning_params.mainzisegmap_num_groups_206873 = &cfg->tuning_params[87];
    ctx->tuning_params.mainzisegmap_num_groups_210443 = &cfg->tuning_params[88];
    ctx->tuning_params.mainzisegmap_num_groups_210638 = &cfg->tuning_params[89];
    ctx->tuning_params.mainzisegmap_num_groups_212135 = &cfg->tuning_params[90];
    ctx->tuning_params.mainzisegmap_num_groups_212391 = &cfg->tuning_params[91];
    ctx->tuning_params.mainzisegmap_num_groups_214308 = &cfg->tuning_params[92];
    ctx->tuning_params.mainzisegmap_num_groups_214628 = &cfg->tuning_params[93];
    ctx->tuning_params.mainzisegmap_num_groups_218977 = &cfg->tuning_params[94];
    ctx->tuning_params.mainzisegmap_num_groups_219610 = &cfg->tuning_params[95];
    ctx->tuning_params.mainzisegmap_num_groups_220475 = &cfg->tuning_params[96];
    ctx->tuning_params.mainzisegmap_num_groups_222456 = &cfg->tuning_params[97];
    ctx->tuning_params.mainzisegmap_num_groups_223298 = &cfg->tuning_params[98];
    ctx->tuning_params.mainzisegmap_num_groups_224372 = &cfg->tuning_params[99];
    ctx->tuning_params.mainzisegmap_num_groups_227160 =
        &cfg->tuning_params[100];
    ctx->tuning_params.mainzisegmap_num_groups_228216 =
        &cfg->tuning_params[101];
    ctx->tuning_params.mainzisegred_group_sizze_211074 =
        &cfg->tuning_params[102];
    ctx->tuning_params.mainzisegred_group_sizze_211176 =
        &cfg->tuning_params[103];
    ctx->tuning_params.mainzisegred_group_sizze_212960 =
        &cfg->tuning_params[104];
    ctx->tuning_params.mainzisegred_group_sizze_213093 =
        &cfg->tuning_params[105];
    ctx->tuning_params.mainzisegred_group_sizze_215343 =
        &cfg->tuning_params[106];
    ctx->tuning_params.mainzisegred_group_sizze_215512 =
        &cfg->tuning_params[107];
    ctx->tuning_params.mainzisegred_group_sizze_218608 =
        &cfg->tuning_params[108];
    ctx->tuning_params.mainzisegred_group_sizze_218739 =
        &cfg->tuning_params[109];
    ctx->tuning_params.mainzisegred_group_sizze_218870 =
        &cfg->tuning_params[110];
    ctx->tuning_params.mainzisegred_group_sizze_219193 =
        &cfg->tuning_params[111];
    ctx->tuning_params.mainzisegred_group_sizze_219260 =
        &cfg->tuning_params[112];
    ctx->tuning_params.mainzisegred_group_sizze_219918 =
        &cfg->tuning_params[113];
    ctx->tuning_params.mainzisegred_group_sizze_220012 =
        &cfg->tuning_params[114];
    ctx->tuning_params.mainzisegred_group_sizze_220883 =
        &cfg->tuning_params[115];
    ctx->tuning_params.mainzisegred_group_sizze_221009 =
        &cfg->tuning_params[116];
    ctx->tuning_params.mainzisegred_group_sizze_222724 =
        &cfg->tuning_params[117];
    ctx->tuning_params.mainzisegred_group_sizze_222794 =
        &cfg->tuning_params[118];
    ctx->tuning_params.mainzisegred_group_sizze_223658 =
        &cfg->tuning_params[119];
    ctx->tuning_params.mainzisegred_group_sizze_223755 =
        &cfg->tuning_params[120];
    ctx->tuning_params.mainzisegred_group_sizze_224832 =
        &cfg->tuning_params[121];
    ctx->tuning_params.mainzisegred_group_sizze_224961 =
        &cfg->tuning_params[122];
    ctx->tuning_params.mainzisegred_group_sizze_228067 =
        &cfg->tuning_params[123];
    ctx->tuning_params.mainzisegred_num_groups_211076 =
        &cfg->tuning_params[124];
    ctx->tuning_params.mainzisegred_num_groups_211178 =
        &cfg->tuning_params[125];
    ctx->tuning_params.mainzisegred_num_groups_212962 =
        &cfg->tuning_params[126];
    ctx->tuning_params.mainzisegred_num_groups_213095 =
        &cfg->tuning_params[127];
    ctx->tuning_params.mainzisegred_num_groups_215345 =
        &cfg->tuning_params[128];
    ctx->tuning_params.mainzisegred_num_groups_215514 =
        &cfg->tuning_params[129];
    ctx->tuning_params.mainzisegred_num_groups_218610 =
        &cfg->tuning_params[130];
    ctx->tuning_params.mainzisegred_num_groups_218741 =
        &cfg->tuning_params[131];
    ctx->tuning_params.mainzisegred_num_groups_218872 =
        &cfg->tuning_params[132];
    ctx->tuning_params.mainzisegred_num_groups_219195 =
        &cfg->tuning_params[133];
    ctx->tuning_params.mainzisegred_num_groups_219262 =
        &cfg->tuning_params[134];
    ctx->tuning_params.mainzisegred_num_groups_219920 =
        &cfg->tuning_params[135];
    ctx->tuning_params.mainzisegred_num_groups_220014 =
        &cfg->tuning_params[136];
    ctx->tuning_params.mainzisegred_num_groups_220885 =
        &cfg->tuning_params[137];
    ctx->tuning_params.mainzisegred_num_groups_221011 =
        &cfg->tuning_params[138];
    ctx->tuning_params.mainzisegred_num_groups_222726 =
        &cfg->tuning_params[139];
    ctx->tuning_params.mainzisegred_num_groups_222796 =
        &cfg->tuning_params[140];
    ctx->tuning_params.mainzisegred_num_groups_223660 =
        &cfg->tuning_params[141];
    ctx->tuning_params.mainzisegred_num_groups_223757 =
        &cfg->tuning_params[142];
    ctx->tuning_params.mainzisegred_num_groups_224834 =
        &cfg->tuning_params[143];
    ctx->tuning_params.mainzisegred_num_groups_224963 =
        &cfg->tuning_params[144];
    ctx->tuning_params.mainzisegred_num_groups_228069 =
        &cfg->tuning_params[145];
    ctx->tuning_params.mainzisegscan_group_sizze_206861 =
        &cfg->tuning_params[146];
    ctx->tuning_params.mainzisegscan_group_sizze_206981 =
        &cfg->tuning_params[147];
    ctx->tuning_params.mainzisegscan_group_sizze_207419 =
        &cfg->tuning_params[148];
    ctx->tuning_params.mainzisegscan_group_sizze_218641 =
        &cfg->tuning_params[149];
    ctx->tuning_params.mainzisegscan_group_sizze_218772 =
        &cfg->tuning_params[150];
    ctx->tuning_params.mainzisegscan_group_sizze_218903 =
        &cfg->tuning_params[151];
    ctx->tuning_params.mainzisegscan_group_sizze_227625 =
        &cfg->tuning_params[152];
    ctx->tuning_params.mainzisegscan_num_groups_206863 =
        &cfg->tuning_params[153];
    ctx->tuning_params.mainzisegscan_num_groups_206983 =
        &cfg->tuning_params[154];
    ctx->tuning_params.mainzisegscan_num_groups_207421 =
        &cfg->tuning_params[155];
    ctx->tuning_params.mainzisegscan_num_groups_218643 =
        &cfg->tuning_params[156];
    ctx->tuning_params.mainzisegscan_num_groups_218774 =
        &cfg->tuning_params[157];
    ctx->tuning_params.mainzisegscan_num_groups_218905 =
        &cfg->tuning_params[158];
    ctx->tuning_params.mainzisegscan_num_groups_227627 =
        &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:65-70\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:404:36-407:52\n   #5  /prelude/soacs.fut:59:3-10\n   #6  /prelude/array.fut:195:3-17\n   #7  utils.fut:6:3-16\n   #8  stl.fut:403:29-408:37\n   #9  stl.fut:402:22-409:28\n   #10 stl.fut:455:3-469:34\n   #11 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 1:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  stl.fut:124:33-40\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:119:20-125:36\n   #5  /prelude/soacs.fut:59:3-10\n   #6  /prelude/array.fut:195:3-17\n   #7  utils.fut:6:3-16\n   #8  stl.fut:117:12-126:20\n   #9  stl.fut:116:5-127:11\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 2:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:450:26-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:517:15-50\n   #6  stl.fut:142:20-80\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:141:12-143:40\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:140:5-144:36\n   #13 stl.fut:415:61-429:75\n   #14 stl.fut:455:3-469:34\n   #15 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 3:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:460:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:517:15-50\n   #6  stl.fut:142:20-80\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:141:12-143:40\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:140:5-144:36\n   #13 stl.fut:415:61-429:75\n   #14 stl.fut:455:3-469:34\n   #15 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 4:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:461:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:517:15-50\n   #6  stl.fut:142:20-80\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:141:12-143:40\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:140:5-144:36\n   #13 stl.fut:415:61-429:75\n   #14 stl.fut:455:3-469:34\n   #15 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 5:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:485:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:480:3-488:25\n   #4  loess.fut:518:16-54\n   #5  stl.fut:142:20-80\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:141:12-143:40\n   #9  /prelude/soacs.fut:67:19-23\n   #10 /prelude/soacs.fut:67:3-37\n   #11 stl.fut:140:5-144:36\n   #12 stl.fut:415:61-429:75\n   #13 stl.fut:455:3-469:34\n   #14 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 6:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:484:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:480:3-488:25\n   #4  loess.fut:518:16-54\n   #5  stl.fut:142:20-80\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:141:12-143:40\n   #9  /prelude/soacs.fut:67:19-23\n   #10 /prelude/soacs.fut:67:3-37\n   #11 stl.fut:140:5-144:36\n   #12 stl.fut:415:61-429:75\n   #13 stl.fut:455:3-469:34\n   #14 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 7:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:450:26-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:517:15-50\n   #6  stl.fut:142:20-80\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:141:12-143:40\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:140:5-144:36\n   #13 stl.fut:415:61-429:75\n   #14 stl.fut:455:3-469:34\n   #15 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 8:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:460:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:517:15-50\n   #6  stl.fut:142:20-80\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:141:12-143:40\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:140:5-144:36\n   #13 stl.fut:415:61-429:75\n   #14 stl.fut:455:3-469:34\n   #15 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 9:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:461:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:517:15-50\n   #6  stl.fut:142:20-80\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:141:12-143:40\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:140:5-144:36\n   #13 stl.fut:415:61-429:75\n   #14 stl.fut:455:3-469:34\n   #15 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 10:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:485:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:480:3-488:25\n   #4  loess.fut:518:16-54\n   #5  stl.fut:142:20-80\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:141:12-143:40\n   #9  /prelude/soacs.fut:67:19-23\n   #10 /prelude/soacs.fut:67:3-37\n   #11 stl.fut:140:5-144:36\n   #12 stl.fut:415:61-429:75\n   #13 stl.fut:455:3-469:34\n   #14 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 11:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:484:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:480:3-488:25\n   #4  loess.fut:518:16-54\n   #5  stl.fut:142:20-80\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:141:12-143:40\n   #9  /prelude/soacs.fut:67:19-23\n   #10 /prelude/soacs.fut:67:3-37\n   #11 stl.fut:140:5-144:36\n   #12 stl.fut:415:61-429:75\n   #13 stl.fut:455:3-469:34\n   #14 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 12:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:450:26-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:517:15-50\n   #6  stl.fut:142:20-80\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:141:12-143:40\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:140:5-144:36\n   #13 stl.fut:415:61-429:75\n   #14 stl.fut:455:3-469:34\n   #15 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 13:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:460:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:517:15-50\n   #6  stl.fut:142:20-80\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:141:12-143:40\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:140:5-144:36\n   #13 stl.fut:415:61-429:75\n   #14 stl.fut:455:3-469:34\n   #15 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 14:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:461:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:517:15-50\n   #6  stl.fut:142:20-80\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:141:12-143:40\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:140:5-144:36\n   #13 stl.fut:415:61-429:75\n   #14 stl.fut:455:3-469:34\n   #15 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 15:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:485:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:480:3-488:25\n   #4  loess.fut:518:16-54\n   #5  stl.fut:142:20-80\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:141:12-143:40\n   #9  /prelude/soacs.fut:67:19-23\n   #10 /prelude/soacs.fut:67:3-37\n   #11 stl.fut:140:5-144:36\n   #12 stl.fut:415:61-429:75\n   #13 stl.fut:455:3-469:34\n   #14 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 16:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:484:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:480:3-488:25\n   #4  loess.fut:518:16-54\n   #5  stl.fut:142:20-80\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:141:12-143:40\n   #9  /prelude/soacs.fut:67:19-23\n   #10 /prelude/soacs.fut:67:3-37\n   #11 stl.fut:140:5-144:36\n   #12 stl.fut:415:61-429:75\n   #13 stl.fut:455:3-469:34\n   #14 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 17:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:450:26-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:503:15-61\n   #6  stl.fut:150:13-60\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:148:5-151:26\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 18:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:460:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:503:15-61\n   #6  stl.fut:150:13-60\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:148:5-151:26\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 19:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:461:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:503:15-61\n   #6  stl.fut:150:13-60\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:148:5-151:26\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 20:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:485:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:480:3-488:25\n   #4  loess.fut:504:16-51\n   #5  stl.fut:150:13-60\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:148:5-151:26\n   #9  stl.fut:415:61-429:75\n   #10 stl.fut:455:3-469:34\n   #11 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 21:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:484:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:480:3-488:25\n   #4  loess.fut:504:16-51\n   #5  stl.fut:150:13-60\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:148:5-151:26\n   #9  stl.fut:415:61-429:75\n   #10 stl.fut:455:3-469:34\n   #11 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 22:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:450:26-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:503:15-61\n   #6  stl.fut:150:13-60\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:148:5-151:26\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 23:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:460:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:503:15-61\n   #6  stl.fut:150:13-60\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:148:5-151:26\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 24:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:461:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:503:15-61\n   #6  stl.fut:150:13-60\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:148:5-151:26\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 25:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:485:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:480:3-488:25\n   #4  loess.fut:504:16-51\n   #5  stl.fut:150:13-60\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:148:5-151:26\n   #9  stl.fut:415:61-429:75\n   #10 stl.fut:455:3-469:34\n   #11 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 26:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:484:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:480:3-488:25\n   #4  loess.fut:504:16-51\n   #5  stl.fut:150:13-60\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:148:5-151:26\n   #9  stl.fut:415:61-429:75\n   #10 stl.fut:455:3-469:34\n   #11 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 27:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:450:26-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:503:15-61\n   #6  stl.fut:157:13-60\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:155:5-158:26\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 28:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:460:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:503:15-61\n   #6  stl.fut:157:13-60\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:155:5-158:26\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 29:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:461:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:503:15-61\n   #6  stl.fut:157:13-60\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:155:5-158:26\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 30:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:485:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:480:3-488:25\n   #4  loess.fut:504:16-51\n   #5  stl.fut:157:13-60\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:155:5-158:26\n   #9  stl.fut:415:61-429:75\n   #10 stl.fut:455:3-469:34\n   #11 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 31:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:484:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:480:3-488:25\n   #4  loess.fut:504:16-51\n   #5  stl.fut:157:13-60\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:155:5-158:26\n   #9  stl.fut:415:61-429:75\n   #10 stl.fut:455:3-469:34\n   #11 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 32:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:450:26-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:503:15-61\n   #6  stl.fut:157:13-60\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:155:5-158:26\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 33:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:460:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:503:15-61\n   #6  stl.fut:157:13-60\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:155:5-158:26\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 34:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:461:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:503:15-61\n   #6  stl.fut:157:13-60\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:155:5-158:26\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 35:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:485:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:480:3-488:25\n   #4  loess.fut:504:16-51\n   #5  stl.fut:157:13-60\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:155:5-158:26\n   #9  stl.fut:415:61-429:75\n   #10 stl.fut:455:3-469:34\n   #11 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 36:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:484:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:480:3-488:25\n   #4  loess.fut:504:16-51\n   #5  stl.fut:157:13-60\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:155:5-158:26\n   #9  stl.fut:415:61-429:75\n   #10 stl.fut:455:3-469:34\n   #11 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 37:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  stl.fut:193:42-57\n   #1  stl.fut:188:28-194:44\n   #2  /prelude/soacs.fut:67:19-23\n   #3  /prelude/soacs.fut:67:3-37\n   #4  stl.fut:186:21-195:50\n   #5  /prelude/soacs.fut:75:22-28\n   #6  /prelude/soacs.fut:75:3-45\n   #7  stl.fut:184:13-196:57\n   #8  stl.fut:415:61-429:75\n   #9  stl.fut:455:3-469:34\n   #10 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 38:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  /prelude/array.fut:21:29-32\n   #1  loess.fut:559:12-20\n   #2  /prelude/soacs.fut:59:3-10\n   #3  /prelude/array.fut:195:3-17\n   #4  utils.fut:6:3-16\n   #5  loess.fut:557:3-566:9\n   #6  stl.fut:220:31-96\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:219:23-221:48\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:218:15-222:44\n   #13 stl.fut:415:61-429:75\n   #14 stl.fut:455:3-469:34\n   #15 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 39:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  /prelude/array.fut:26:29-34\n   #1  loess.fut:561:12-20\n   #2  /prelude/soacs.fut:59:3-10\n   #3  /prelude/array.fut:195:3-17\n   #4  utils.fut:6:3-16\n   #5  loess.fut:557:3-566:9\n   #6  stl.fut:220:31-96\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:219:23-221:48\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:218:15-222:44\n   #13 stl.fut:415:61-429:75\n   #14 stl.fut:455:3-469:34\n   #15 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 40:
                {
                    ctx->error =
                        msgprintf("division by zero\n-> #0  loess.fut:563:22-35\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:557:3-566:9\n   #5  stl.fut:220:31-96\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:219:23-221:48\n   #9  /prelude/soacs.fut:67:19-23\n   #10 /prelude/soacs.fut:67:3-37\n   #11 stl.fut:218:15-222:44\n   #12 stl.fut:415:61-429:75\n   #13 stl.fut:455:3-469:34\n   #14 stl.fut:439:1-469:34\n");
                    break;
                }
                
              case 41:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:536:27-33\n   #1  loess.fut:565:15-52\n   #2  /prelude/soacs.fut:59:3-10\n   #3  /prelude/array.fut:195:3-17\n   #4  utils.fut:6:3-16\n   #5  loess.fut:557:3-566:9\n   #6  stl.fut:220:31-96\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:219:23-221:48\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:218:15-222:44\n   #13 stl.fut:415:61-429:75\n   #14 stl.fut:455:3-469:34\n   #15 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 42:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:537:27-37\n   #1  loess.fut:565:15-52\n   #2  /prelude/soacs.fut:59:3-10\n   #3  /prelude/array.fut:195:3-17\n   #4  utils.fut:6:3-16\n   #5  loess.fut:557:3-566:9\n   #6  stl.fut:220:31-96\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:219:23-221:48\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:218:15-222:44\n   #13 stl.fut:415:61-429:75\n   #14 stl.fut:455:3-469:34\n   #15 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 43:
                {
                    ctx->error =
                        msgprintf("Index [%lld, %lld] out of bounds for array of shape [%lld][%lld].\n-> #0  stl.fut:226:39-67\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:226:28-74\n   #5  stl.fut:225:21-227:39\n   #6  stl.fut:415:61-429:75\n   #7  stl.fut:455:3-469:34\n   #8  stl.fut:439:1-469:34\n",
                                  args[0], args[1], args[2], args[3]);
                    break;
                }
                
              case 44:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  stl.fut:32:23-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:27:13-33:19\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:26:5-34:23\n   #8  stl.fut:38:3-36\n   #9  stl.fut:231:23-47\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 45:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  stl.fut:32:40-47\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:27:13-33:19\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:26:5-34:23\n   #8  stl.fut:38:3-36\n   #9  stl.fut:231:23-47\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 46:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  stl.fut:32:23-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:27:13-33:19\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:26:5-34:23\n   #8  /prelude/functional.fut:9:42-44\n   #9  stl.fut:38:3-64\n   #10 stl.fut:231:23-47\n   #11 stl.fut:415:61-429:75\n   #12 stl.fut:455:3-469:34\n   #13 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 47:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  stl.fut:32:40-47\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:27:13-33:19\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:26:5-34:23\n   #8  /prelude/functional.fut:9:42-44\n   #9  stl.fut:38:3-64\n   #10 stl.fut:231:23-47\n   #11 stl.fut:415:61-429:75\n   #12 stl.fut:455:3-469:34\n   #13 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 48:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  stl.fut:32:23-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:27:13-33:19\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:26:5-34:23\n   #8  /prelude/functional.fut:9:42-44\n   #9  stl.fut:38:3-84\n   #10 stl.fut:231:23-47\n   #11 stl.fut:415:61-429:75\n   #12 stl.fut:455:3-469:34\n   #13 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 49:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  stl.fut:32:40-47\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:27:13-33:19\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:26:5-34:23\n   #8  /prelude/functional.fut:9:42-44\n   #9  stl.fut:38:3-84\n   #10 stl.fut:231:23-47\n   #11 stl.fut:415:61-429:75\n   #12 stl.fut:455:3-469:34\n   #13 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 50:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:536:27-33\n   #1  loess.fut:549:13-50\n   #2  /prelude/soacs.fut:59:3-10\n   #3  /prelude/array.fut:195:3-17\n   #4  utils.fut:6:3-16\n   #5  loess.fut:546:3-550:9\n   #6  stl.fut:252:23-75\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:250:15-253:43\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 51:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:537:27-37\n   #1  loess.fut:549:13-50\n   #2  /prelude/soacs.fut:59:3-10\n   #3  /prelude/array.fut:195:3-17\n   #4  utils.fut:6:3-16\n   #5  loess.fut:546:3-550:9\n   #6  stl.fut:252:23-75\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:250:15-253:43\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 52:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:281:33-58\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:415:61-429:75\n   #8  stl.fut:455:3-469:34\n   #9  stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 53:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:282:33-64\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:415:61-429:75\n   #8  stl.fut:455:3-469:34\n   #9  stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 54:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:281:33-58\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:415:61-429:75\n   #8  stl.fut:455:3-469:34\n   #9  stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 55:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:282:33-64\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:415:61-429:75\n   #8  stl.fut:455:3-469:34\n   #9  stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 56:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:281:33-58\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:415:61-429:75\n   #8  stl.fut:455:3-469:34\n   #9  stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 57:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:282:33-64\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:415:61-429:75\n   #8  stl.fut:455:3-469:34\n   #9  stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 58:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:281:33-58\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:415:61-429:75\n   #8  stl.fut:455:3-469:34\n   #9  stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 59:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:282:33-64\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:415:61-429:75\n   #8  stl.fut:455:3-469:34\n   #9  stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 60:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:281:33-58\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:415:61-429:75\n   #8  stl.fut:455:3-469:34\n   #9  stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 61:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:282:33-64\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:415:61-429:75\n   #8  stl.fut:455:3-469:34\n   #9  stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 62:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:281:33-58\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:415:61-429:75\n   #8  stl.fut:455:3-469:34\n   #9  stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 63:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:282:33-64\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:415:61-429:75\n   #8  stl.fut:455:3-469:34\n   #9  stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 64:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:281:33-58\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:415:61-429:75\n   #8  stl.fut:455:3-469:34\n   #9  stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 65:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:282:33-64\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:415:61-429:75\n   #8  stl.fut:455:3-469:34\n   #9  stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 66:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:281:33-58\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:415:61-429:75\n   #8  stl.fut:455:3-469:34\n   #9  stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 67:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:282:33-64\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:415:61-429:75\n   #8  stl.fut:455:3-469:34\n   #9  stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 68:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:281:33-58\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:415:61-429:75\n   #8  stl.fut:455:3-469:34\n   #9  stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 69:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:282:33-64\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:415:61-429:75\n   #8  stl.fut:455:3-469:34\n   #9  stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 70:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:536:27-33\n   #1  loess.fut:549:13-50\n   #2  /prelude/soacs.fut:59:3-10\n   #3  /prelude/array.fut:195:3-17\n   #4  utils.fut:6:3-16\n   #5  loess.fut:546:3-550:9\n   #6  stl.fut:304:23-75\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:303:15-305:43\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 71:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:537:27-37\n   #1  loess.fut:549:13-50\n   #2  /prelude/soacs.fut:59:3-10\n   #3  /prelude/array.fut:195:3-17\n   #4  utils.fut:6:3-16\n   #5  loess.fut:546:3-550:9\n   #6  stl.fut:304:23-75\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:303:15-305:43\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 72:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:334:21-49\n   #3  /prelude/soacs.fut:67:19-23\n   #4  /prelude/soacs.fut:67:3-37\n   #5  stl.fut:332:13-335:35\n   #6  stl.fut:415:61-429:75\n   #7  stl.fut:455:3-469:34\n   #8  stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 73:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:334:21-49\n   #3  /prelude/soacs.fut:67:19-23\n   #4  /prelude/soacs.fut:67:3-37\n   #5  stl.fut:332:13-335:35\n   #6  stl.fut:415:61-429:75\n   #7  stl.fut:455:3-469:34\n   #8  stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
            }
            return 1;
        }
    }
    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_232966 ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->builtinzhreplicate_f64zireplicate_232966_runs,
                    (long) ctx->builtinzhreplicate_f64zireplicate_232966_total_runtime /
                    (ctx->builtinzhreplicate_f64zireplicate_232966_runs !=
                     0 ? ctx->builtinzhreplicate_f64zireplicate_232966_runs : 1),
                    (long) ctx->builtinzhreplicate_f64zireplicate_232966_total_runtime);
        ctx->total_runtime +=
            ctx->builtinzhreplicate_f64zireplicate_232966_total_runtime;
        ctx->total_runs += ctx->builtinzhreplicate_f64zireplicate_232966_runs;
        str_builder(&builder,
                    "builtin#replicate_i64.replicate_232507 ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->builtinzhreplicate_i64zireplicate_232507_runs,
                    (long) ctx->builtinzhreplicate_i64zireplicate_232507_total_runtime /
                    (ctx->builtinzhreplicate_i64zireplicate_232507_runs !=
                     0 ? ctx->builtinzhreplicate_i64zireplicate_232507_runs : 1),
                    (long) ctx->builtinzhreplicate_i64zireplicate_232507_total_runtime);
        ctx->total_runtime +=
            ctx->builtinzhreplicate_i64zireplicate_232507_total_runtime;
        ctx->total_runs += ctx->builtinzhreplicate_i64zireplicate_232507_runs;
        str_builder(&builder,
                    "builtin#replicate_i8.replicate_232265  ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->builtinzhreplicate_i8zireplicate_232265_runs,
                    (long) ctx->builtinzhreplicate_i8zireplicate_232265_total_runtime /
                    (ctx->builtinzhreplicate_i8zireplicate_232265_runs !=
                     0 ? ctx->builtinzhreplicate_i8zireplicate_232265_runs : 1),
                    (long) ctx->builtinzhreplicate_i8zireplicate_232265_total_runtime);
        ctx->total_runtime +=
            ctx->builtinzhreplicate_i8zireplicate_232265_total_runtime;
        ctx->total_runs += ctx->builtinzhreplicate_i8zireplicate_232265_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_232525                       ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzicopy_232525_runs,
                    (long) ctx->mainzicopy_232525_total_runtime /
                    (ctx->mainzicopy_232525_runs !=
                     0 ? ctx->mainzicopy_232525_runs : 1),
                    (long) ctx->mainzicopy_232525_total_runtime);
        ctx->total_runtime += ctx->mainzicopy_232525_total_runtime;
        ctx->total_runs += ctx->mainzicopy_232525_runs;
        str_builder(&builder,
                    "main.copy_232726                       ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzicopy_232726_runs,
                    (long) ctx->mainzicopy_232726_total_runtime /
                    (ctx->mainzicopy_232726_runs !=
                     0 ? ctx->mainzicopy_232726_runs : 1),
                    (long) ctx->mainzicopy_232726_total_runtime);
        ctx->total_runtime += ctx->mainzicopy_232726_total_runtime;
        ctx->total_runs += ctx->mainzicopy_232726_runs;
        str_builder(&builder,
                    "main.copy_234763                       ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzicopy_234763_runs,
                    (long) ctx->mainzicopy_234763_total_runtime /
                    (ctx->mainzicopy_234763_runs !=
                     0 ? ctx->mainzicopy_234763_runs : 1),
                    (long) ctx->mainzicopy_234763_total_runtime);
        ctx->total_runtime += ctx->mainzicopy_234763_total_runtime;
        ctx->total_runs += ctx->mainzicopy_234763_runs;
        str_builder(&builder,
                    "main.copy_234962                       ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzicopy_234962_runs,
                    (long) ctx->mainzicopy_234962_total_runtime /
                    (ctx->mainzicopy_234962_runs !=
                     0 ? ctx->mainzicopy_234962_runs : 1),
                    (long) ctx->mainzicopy_234962_total_runtime);
        ctx->total_runtime += ctx->mainzicopy_234962_total_runtime;
        ctx->total_runs += ctx->mainzicopy_234962_runs;
        str_builder(&builder,
                    "main.copy_235212                       ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzicopy_235212_runs,
                    (long) ctx->mainzicopy_235212_total_runtime /
                    (ctx->mainzicopy_235212_runs !=
                     0 ? ctx->mainzicopy_235212_runs : 1),
                    (long) ctx->mainzicopy_235212_total_runtime);
        ctx->total_runtime += ctx->mainzicopy_235212_total_runtime;
        ctx->total_runs += ctx->mainzicopy_235212_runs;
        str_builder(&builder,
                    "main.copy_235590                       ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzicopy_235590_runs,
                    (long) ctx->mainzicopy_235590_total_runtime /
                    (ctx->mainzicopy_235590_runs !=
                     0 ? ctx->mainzicopy_235590_runs : 1),
                    (long) ctx->mainzicopy_235590_total_runtime);
        ctx->total_runtime += ctx->mainzicopy_235590_total_runtime;
        ctx->total_runs += ctx->mainzicopy_235590_runs;
        str_builder(&builder,
                    "main.copy_235812                       ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzicopy_235812_runs,
                    (long) ctx->mainzicopy_235812_total_runtime /
                    (ctx->mainzicopy_235812_runs !=
                     0 ? ctx->mainzicopy_235812_runs : 1),
                    (long) ctx->mainzicopy_235812_total_runtime);
        ctx->total_runtime += ctx->mainzicopy_235812_total_runtime;
        ctx->total_runs += ctx->mainzicopy_235812_runs;
        str_builder(&builder,
                    "main.copy_236085                       ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzicopy_236085_runs,
                    (long) ctx->mainzicopy_236085_total_runtime /
                    (ctx->mainzicopy_236085_runs !=
                     0 ? ctx->mainzicopy_236085_runs : 1),
                    (long) ctx->mainzicopy_236085_total_runtime);
        ctx->total_runtime += ctx->mainzicopy_236085_total_runtime;
        ctx->total_runs += ctx->mainzicopy_236085_runs;
        str_builder(&builder,
                    "main.segmap_206869                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_206869_runs,
                    (long) ctx->mainzisegmap_206869_total_runtime /
                    (ctx->mainzisegmap_206869_runs !=
                     0 ? ctx->mainzisegmap_206869_runs : 1),
                    (long) ctx->mainzisegmap_206869_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_206869_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_206869_runs;
        str_builder(&builder,
                    "main.segmap_207045                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_207045_runs,
                    (long) ctx->mainzisegmap_207045_total_runtime /
                    (ctx->mainzisegmap_207045_runs !=
                     0 ? ctx->mainzisegmap_207045_runs : 1),
                    (long) ctx->mainzisegmap_207045_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_207045_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_207045_runs;
        str_builder(&builder,
                    "main.segmap_207170                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_207170_runs,
                    (long) ctx->mainzisegmap_207170_total_runtime /
                    (ctx->mainzisegmap_207170_runs !=
                     0 ? ctx->mainzisegmap_207170_runs : 1),
                    (long) ctx->mainzisegmap_207170_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_207170_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_207170_runs;
        str_builder(&builder,
                    "main.segmap_207605                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_207605_runs,
                    (long) ctx->mainzisegmap_207605_total_runtime /
                    (ctx->mainzisegmap_207605_runs !=
                     0 ? ctx->mainzisegmap_207605_runs : 1),
                    (long) ctx->mainzisegmap_207605_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_207605_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_207605_runs;
        str_builder(&builder,
                    "main.segmap_208818                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_208818_runs,
                    (long) ctx->mainzisegmap_208818_total_runtime /
                    (ctx->mainzisegmap_208818_runs !=
                     0 ? ctx->mainzisegmap_208818_runs : 1),
                    (long) ctx->mainzisegmap_208818_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_208818_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_208818_runs;
        str_builder(&builder,
                    "main.segmap_208832                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_208832_runs,
                    (long) ctx->mainzisegmap_208832_total_runtime /
                    (ctx->mainzisegmap_208832_runs !=
                     0 ? ctx->mainzisegmap_208832_runs : 1),
                    (long) ctx->mainzisegmap_208832_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_208832_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_208832_runs;
        str_builder(&builder,
                    "main.segmap_208856                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_208856_runs,
                    (long) ctx->mainzisegmap_208856_total_runtime /
                    (ctx->mainzisegmap_208856_runs !=
                     0 ? ctx->mainzisegmap_208856_runs : 1),
                    (long) ctx->mainzisegmap_208856_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_208856_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_208856_runs;
        str_builder(&builder,
                    "main.segmap_209466                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_209466_runs,
                    (long) ctx->mainzisegmap_209466_total_runtime /
                    (ctx->mainzisegmap_209466_runs !=
                     0 ? ctx->mainzisegmap_209466_runs : 1),
                    (long) ctx->mainzisegmap_209466_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_209466_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_209466_runs;
        str_builder(&builder,
                    "main.segmap_209478                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_209478_runs,
                    (long) ctx->mainzisegmap_209478_total_runtime /
                    (ctx->mainzisegmap_209478_runs !=
                     0 ? ctx->mainzisegmap_209478_runs : 1),
                    (long) ctx->mainzisegmap_209478_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_209478_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_209478_runs;
        str_builder(&builder,
                    "main.segmap_209499                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_209499_runs,
                    (long) ctx->mainzisegmap_209499_total_runtime /
                    (ctx->mainzisegmap_209499_runs !=
                     0 ? ctx->mainzisegmap_209499_runs : 1),
                    (long) ctx->mainzisegmap_209499_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_209499_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_209499_runs;
        str_builder(&builder,
                    "main.segmap_210092                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_210092_runs,
                    (long) ctx->mainzisegmap_210092_total_runtime /
                    (ctx->mainzisegmap_210092_runs !=
                     0 ? ctx->mainzisegmap_210092_runs : 1),
                    (long) ctx->mainzisegmap_210092_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_210092_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_210092_runs;
        str_builder(&builder,
                    "main.segmap_210104                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_210104_runs,
                    (long) ctx->mainzisegmap_210104_total_runtime /
                    (ctx->mainzisegmap_210104_runs !=
                     0 ? ctx->mainzisegmap_210104_runs : 1),
                    (long) ctx->mainzisegmap_210104_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_210104_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_210104_runs;
        str_builder(&builder,
                    "main.segmap_210125                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_210125_runs,
                    (long) ctx->mainzisegmap_210125_total_runtime /
                    (ctx->mainzisegmap_210125_runs !=
                     0 ? ctx->mainzisegmap_210125_runs : 1),
                    (long) ctx->mainzisegmap_210125_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_210125_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_210125_runs;
        str_builder(&builder,
                    "main.segmap_210267                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_210267_runs,
                    (long) ctx->mainzisegmap_210267_total_runtime /
                    (ctx->mainzisegmap_210267_runs !=
                     0 ? ctx->mainzisegmap_210267_runs : 1),
                    (long) ctx->mainzisegmap_210267_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_210267_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_210267_runs;
        str_builder(&builder,
                    "main.segmap_210412                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_210412_runs,
                    (long) ctx->mainzisegmap_210412_total_runtime /
                    (ctx->mainzisegmap_210412_runs !=
                     0 ? ctx->mainzisegmap_210412_runs : 1),
                    (long) ctx->mainzisegmap_210412_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_210412_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_210412_runs;
        str_builder(&builder,
                    "main.segmap_210542                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_210542_runs,
                    (long) ctx->mainzisegmap_210542_total_runtime /
                    (ctx->mainzisegmap_210542_runs !=
                     0 ? ctx->mainzisegmap_210542_runs : 1),
                    (long) ctx->mainzisegmap_210542_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_210542_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_210542_runs;
        str_builder(&builder,
                    "main.segmap_211682                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_211682_runs,
                    (long) ctx->mainzisegmap_211682_total_runtime /
                    (ctx->mainzisegmap_211682_runs !=
                     0 ? ctx->mainzisegmap_211682_runs : 1),
                    (long) ctx->mainzisegmap_211682_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_211682_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_211682_runs;
        str_builder(&builder,
                    "main.segmap_211890                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_211890_runs,
                    (long) ctx->mainzisegmap_211890_total_runtime /
                    (ctx->mainzisegmap_211890_runs !=
                     0 ? ctx->mainzisegmap_211890_runs : 1),
                    (long) ctx->mainzisegmap_211890_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_211890_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_211890_runs;
        str_builder(&builder,
                    "main.segmap_211979                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_211979_runs,
                    (long) ctx->mainzisegmap_211979_total_runtime /
                    (ctx->mainzisegmap_211979_runs !=
                     0 ? ctx->mainzisegmap_211979_runs : 1),
                    (long) ctx->mainzisegmap_211979_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_211979_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_211979_runs;
        str_builder(&builder,
                    "main.segmap_212051                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_212051_runs,
                    (long) ctx->mainzisegmap_212051_total_runtime /
                    (ctx->mainzisegmap_212051_runs !=
                     0 ? ctx->mainzisegmap_212051_runs : 1),
                    (long) ctx->mainzisegmap_212051_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_212051_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_212051_runs;
        str_builder(&builder,
                    "main.segmap_212265                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_212265_runs,
                    (long) ctx->mainzisegmap_212265_total_runtime /
                    (ctx->mainzisegmap_212265_runs !=
                     0 ? ctx->mainzisegmap_212265_runs : 1),
                    (long) ctx->mainzisegmap_212265_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_212265_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_212265_runs;
        str_builder(&builder,
                    "main.segmap_213719                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_213719_runs,
                    (long) ctx->mainzisegmap_213719_total_runtime /
                    (ctx->mainzisegmap_213719_runs !=
                     0 ? ctx->mainzisegmap_213719_runs : 1),
                    (long) ctx->mainzisegmap_213719_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_213719_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_213719_runs;
        str_builder(&builder,
                    "main.segmap_213994                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_213994_runs,
                    (long) ctx->mainzisegmap_213994_total_runtime /
                    (ctx->mainzisegmap_213994_runs !=
                     0 ? ctx->mainzisegmap_213994_runs : 1),
                    (long) ctx->mainzisegmap_213994_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_213994_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_213994_runs;
        str_builder(&builder,
                    "main.segmap_214111                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_214111_runs,
                    (long) ctx->mainzisegmap_214111_total_runtime /
                    (ctx->mainzisegmap_214111_runs !=
                     0 ? ctx->mainzisegmap_214111_runs : 1),
                    (long) ctx->mainzisegmap_214111_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_214111_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_214111_runs;
        str_builder(&builder,
                    "main.segmap_214195                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_214195_runs,
                    (long) ctx->mainzisegmap_214195_total_runtime /
                    (ctx->mainzisegmap_214195_runs !=
                     0 ? ctx->mainzisegmap_214195_runs : 1),
                    (long) ctx->mainzisegmap_214195_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_214195_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_214195_runs;
        str_builder(&builder,
                    "main.segmap_214470                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_214470_runs,
                    (long) ctx->mainzisegmap_214470_total_runtime /
                    (ctx->mainzisegmap_214470_runs !=
                     0 ? ctx->mainzisegmap_214470_runs : 1),
                    (long) ctx->mainzisegmap_214470_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_214470_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_214470_runs;
        str_builder(&builder,
                    "main.segmap_216262                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_216262_runs,
                    (long) ctx->mainzisegmap_216262_total_runtime /
                    (ctx->mainzisegmap_216262_runs !=
                     0 ? ctx->mainzisegmap_216262_runs : 1),
                    (long) ctx->mainzisegmap_216262_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_216262_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_216262_runs;
        str_builder(&builder,
                    "main.segmap_216607                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_216607_runs,
                    (long) ctx->mainzisegmap_216607_total_runtime /
                    (ctx->mainzisegmap_216607_runs !=
                     0 ? ctx->mainzisegmap_216607_runs : 1),
                    (long) ctx->mainzisegmap_216607_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_216607_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_216607_runs;
        str_builder(&builder,
                    "main.segmap_216756                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_216756_runs,
                    (long) ctx->mainzisegmap_216756_total_runtime /
                    (ctx->mainzisegmap_216756_runs !=
                     0 ? ctx->mainzisegmap_216756_runs : 1),
                    (long) ctx->mainzisegmap_216756_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_216756_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_216756_runs;
        str_builder(&builder,
                    "main.segmap_216852                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_216852_runs,
                    (long) ctx->mainzisegmap_216852_total_runtime /
                    (ctx->mainzisegmap_216852_runs !=
                     0 ? ctx->mainzisegmap_216852_runs : 1),
                    (long) ctx->mainzisegmap_216852_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_216852_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_216852_runs;
        str_builder(&builder,
                    "main.segmap_218413                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_218413_runs,
                    (long) ctx->mainzisegmap_218413_total_runtime /
                    (ctx->mainzisegmap_218413_runs !=
                     0 ? ctx->mainzisegmap_218413_runs : 1),
                    (long) ctx->mainzisegmap_218413_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_218413_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_218413_runs;
        str_builder(&builder,
                    "main.segmap_218562                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_218562_runs,
                    (long) ctx->mainzisegmap_218562_total_runtime /
                    (ctx->mainzisegmap_218562_runs !=
                     0 ? ctx->mainzisegmap_218562_runs : 1),
                    (long) ctx->mainzisegmap_218562_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_218562_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_218562_runs;
        str_builder(&builder,
                    "main.segmap_218598                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_218598_runs,
                    (long) ctx->mainzisegmap_218598_total_runtime /
                    (ctx->mainzisegmap_218598_runs !=
                     0 ? ctx->mainzisegmap_218598_runs : 1),
                    (long) ctx->mainzisegmap_218598_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_218598_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_218598_runs;
        str_builder(&builder,
                    "main.segmap_218729                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_218729_runs,
                    (long) ctx->mainzisegmap_218729_total_runtime /
                    (ctx->mainzisegmap_218729_runs !=
                     0 ? ctx->mainzisegmap_218729_runs : 1),
                    (long) ctx->mainzisegmap_218729_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_218729_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_218729_runs;
        str_builder(&builder,
                    "main.segmap_218860                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_218860_runs,
                    (long) ctx->mainzisegmap_218860_total_runtime /
                    (ctx->mainzisegmap_218860_runs !=
                     0 ? ctx->mainzisegmap_218860_runs : 1),
                    (long) ctx->mainzisegmap_218860_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_218860_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_218860_runs;
        str_builder(&builder,
                    "main.segmap_219049                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_219049_runs,
                    (long) ctx->mainzisegmap_219049_total_runtime /
                    (ctx->mainzisegmap_219049_runs !=
                     0 ? ctx->mainzisegmap_219049_runs : 1),
                    (long) ctx->mainzisegmap_219049_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_219049_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_219049_runs;
        str_builder(&builder,
                    "main.segmap_219434                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_219434_runs,
                    (long) ctx->mainzisegmap_219434_total_runtime /
                    (ctx->mainzisegmap_219434_runs !=
                     0 ? ctx->mainzisegmap_219434_runs : 1),
                    (long) ctx->mainzisegmap_219434_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_219434_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_219434_runs;
        str_builder(&builder,
                    "main.segmap_219551                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_219551_runs,
                    (long) ctx->mainzisegmap_219551_total_runtime /
                    (ctx->mainzisegmap_219551_runs !=
                     0 ? ctx->mainzisegmap_219551_runs : 1),
                    (long) ctx->mainzisegmap_219551_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_219551_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_219551_runs;
        str_builder(&builder,
                    "main.segmap_219712                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_219712_runs,
                    (long) ctx->mainzisegmap_219712_total_runtime /
                    (ctx->mainzisegmap_219712_runs !=
                     0 ? ctx->mainzisegmap_219712_runs : 1),
                    (long) ctx->mainzisegmap_219712_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_219712_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_219712_runs;
        str_builder(&builder,
                    "main.segmap_220233                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_220233_runs,
                    (long) ctx->mainzisegmap_220233_total_runtime /
                    (ctx->mainzisegmap_220233_runs !=
                     0 ? ctx->mainzisegmap_220233_runs : 1),
                    (long) ctx->mainzisegmap_220233_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_220233_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_220233_runs;
        str_builder(&builder,
                    "main.segmap_220390                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_220390_runs,
                    (long) ctx->mainzisegmap_220390_total_runtime /
                    (ctx->mainzisegmap_220390_runs !=
                     0 ? ctx->mainzisegmap_220390_runs : 1),
                    (long) ctx->mainzisegmap_220390_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_220390_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_220390_runs;
        str_builder(&builder,
                    "main.segmap_220609                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_220609_runs,
                    (long) ctx->mainzisegmap_220609_total_runtime /
                    (ctx->mainzisegmap_220609_runs !=
                     0 ? ctx->mainzisegmap_220609_runs : 1),
                    (long) ctx->mainzisegmap_220609_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_220609_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_220609_runs;
        str_builder(&builder,
                    "main.segmap_221278                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_221278_runs,
                    (long) ctx->mainzisegmap_221278_total_runtime /
                    (ctx->mainzisegmap_221278_runs !=
                     0 ? ctx->mainzisegmap_221278_runs : 1),
                    (long) ctx->mainzisegmap_221278_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_221278_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_221278_runs;
        str_builder(&builder,
                    "main.segmap_221479                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_221479_runs,
                    (long) ctx->mainzisegmap_221479_total_runtime /
                    (ctx->mainzisegmap_221479_runs !=
                     0 ? ctx->mainzisegmap_221479_runs : 1),
                    (long) ctx->mainzisegmap_221479_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_221479_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_221479_runs;
        str_builder(&builder,
                    "main.segmap_222349                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_222349_runs,
                    (long) ctx->mainzisegmap_222349_total_runtime /
                    (ctx->mainzisegmap_222349_runs !=
                     0 ? ctx->mainzisegmap_222349_runs : 1),
                    (long) ctx->mainzisegmap_222349_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_222349_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_222349_runs;
        str_builder(&builder,
                    "main.segmap_222444                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_222444_runs,
                    (long) ctx->mainzisegmap_222444_total_runtime /
                    (ctx->mainzisegmap_222444_runs !=
                     0 ? ctx->mainzisegmap_222444_runs : 1),
                    (long) ctx->mainzisegmap_222444_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_222444_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_222444_runs;
        str_builder(&builder,
                    "main.segmap_222551                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_222551_runs,
                    (long) ctx->mainzisegmap_222551_total_runtime /
                    (ctx->mainzisegmap_222551_runs !=
                     0 ? ctx->mainzisegmap_222551_runs : 1),
                    (long) ctx->mainzisegmap_222551_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_222551_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_222551_runs;
        str_builder(&builder,
                    "main.segmap_223067                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_223067_runs,
                    (long) ctx->mainzisegmap_223067_total_runtime /
                    (ctx->mainzisegmap_223067_runs !=
                     0 ? ctx->mainzisegmap_223067_runs : 1),
                    (long) ctx->mainzisegmap_223067_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_223067_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_223067_runs;
        str_builder(&builder,
                    "main.segmap_223084                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_223084_runs,
                    (long) ctx->mainzisegmap_223084_total_runtime /
                    (ctx->mainzisegmap_223084_runs !=
                     0 ? ctx->mainzisegmap_223084_runs : 1),
                    (long) ctx->mainzisegmap_223084_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_223084_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_223084_runs;
        str_builder(&builder,
                    "main.segmap_223112                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_223112_runs,
                    (long) ctx->mainzisegmap_223112_total_runtime /
                    (ctx->mainzisegmap_223112_runs !=
                     0 ? ctx->mainzisegmap_223112_runs : 1),
                    (long) ctx->mainzisegmap_223112_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_223112_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_223112_runs;
        str_builder(&builder,
                    "main.segmap_223236                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_223236_runs,
                    (long) ctx->mainzisegmap_223236_total_runtime /
                    (ctx->mainzisegmap_223236_runs !=
                     0 ? ctx->mainzisegmap_223236_runs : 1),
                    (long) ctx->mainzisegmap_223236_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_223236_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_223236_runs;
        str_builder(&builder,
                    "main.segmap_223423                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_223423_runs,
                    (long) ctx->mainzisegmap_223423_total_runtime /
                    (ctx->mainzisegmap_223423_runs !=
                     0 ? ctx->mainzisegmap_223423_runs : 1),
                    (long) ctx->mainzisegmap_223423_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_223423_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_223423_runs;
        str_builder(&builder,
                    "main.segmap_224073                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_224073_runs,
                    (long) ctx->mainzisegmap_224073_total_runtime /
                    (ctx->mainzisegmap_224073_runs !=
                     0 ? ctx->mainzisegmap_224073_runs : 1),
                    (long) ctx->mainzisegmap_224073_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_224073_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_224073_runs;
        str_builder(&builder,
                    "main.segmap_224090                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_224090_runs,
                    (long) ctx->mainzisegmap_224090_total_runtime /
                    (ctx->mainzisegmap_224090_runs !=
                     0 ? ctx->mainzisegmap_224090_runs : 1),
                    (long) ctx->mainzisegmap_224090_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_224090_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_224090_runs;
        str_builder(&builder,
                    "main.segmap_224120                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_224120_runs,
                    (long) ctx->mainzisegmap_224120_total_runtime /
                    (ctx->mainzisegmap_224120_runs !=
                     0 ? ctx->mainzisegmap_224120_runs : 1),
                    (long) ctx->mainzisegmap_224120_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_224120_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_224120_runs;
        str_builder(&builder,
                    "main.segmap_224284                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_224284_runs,
                    (long) ctx->mainzisegmap_224284_total_runtime /
                    (ctx->mainzisegmap_224284_runs !=
                     0 ? ctx->mainzisegmap_224284_runs : 1),
                    (long) ctx->mainzisegmap_224284_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_224284_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_224284_runs;
        str_builder(&builder,
                    "main.segmap_224529                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_224529_runs,
                    (long) ctx->mainzisegmap_224529_total_runtime /
                    (ctx->mainzisegmap_224529_runs !=
                     0 ? ctx->mainzisegmap_224529_runs : 1),
                    (long) ctx->mainzisegmap_224529_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_224529_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_224529_runs;
        str_builder(&builder,
                    "main.segmap_225327                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_225327_runs,
                    (long) ctx->mainzisegmap_225327_total_runtime /
                    (ctx->mainzisegmap_225327_runs !=
                     0 ? ctx->mainzisegmap_225327_runs : 1),
                    (long) ctx->mainzisegmap_225327_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_225327_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_225327_runs;
        str_builder(&builder,
                    "main.segmap_225344                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_225344_runs,
                    (long) ctx->mainzisegmap_225344_total_runtime /
                    (ctx->mainzisegmap_225344_runs !=
                     0 ? ctx->mainzisegmap_225344_runs : 1),
                    (long) ctx->mainzisegmap_225344_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_225344_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_225344_runs;
        str_builder(&builder,
                    "main.segmap_225374                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_225374_runs,
                    (long) ctx->mainzisegmap_225374_total_runtime /
                    (ctx->mainzisegmap_225374_runs !=
                     0 ? ctx->mainzisegmap_225374_runs : 1),
                    (long) ctx->mainzisegmap_225374_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_225374_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_225374_runs;
        str_builder(&builder,
                    "main.segmap_225582                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_225582_runs,
                    (long) ctx->mainzisegmap_225582_total_runtime /
                    (ctx->mainzisegmap_225582_runs !=
                     0 ? ctx->mainzisegmap_225582_runs : 1),
                    (long) ctx->mainzisegmap_225582_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_225582_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_225582_runs;
        str_builder(&builder,
                    "main.segmap_225873                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_225873_runs,
                    (long) ctx->mainzisegmap_225873_total_runtime /
                    (ctx->mainzisegmap_225873_runs !=
                     0 ? ctx->mainzisegmap_225873_runs : 1),
                    (long) ctx->mainzisegmap_225873_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_225873_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_225873_runs;
        str_builder(&builder,
                    "main.segmap_225890                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_225890_runs,
                    (long) ctx->mainzisegmap_225890_total_runtime /
                    (ctx->mainzisegmap_225890_runs !=
                     0 ? ctx->mainzisegmap_225890_runs : 1),
                    (long) ctx->mainzisegmap_225890_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_225890_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_225890_runs;
        str_builder(&builder,
                    "main.segmap_226185                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_226185_runs,
                    (long) ctx->mainzisegmap_226185_total_runtime /
                    (ctx->mainzisegmap_226185_runs !=
                     0 ? ctx->mainzisegmap_226185_runs : 1),
                    (long) ctx->mainzisegmap_226185_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_226185_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_226185_runs;
        str_builder(&builder,
                    "main.segmap_226202                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_226202_runs,
                    (long) ctx->mainzisegmap_226202_total_runtime /
                    (ctx->mainzisegmap_226202_runs !=
                     0 ? ctx->mainzisegmap_226202_runs : 1),
                    (long) ctx->mainzisegmap_226202_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_226202_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_226202_runs;
        str_builder(&builder,
                    "main.segmap_226589                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_226589_runs,
                    (long) ctx->mainzisegmap_226589_total_runtime /
                    (ctx->mainzisegmap_226589_runs !=
                     0 ? ctx->mainzisegmap_226589_runs : 1),
                    (long) ctx->mainzisegmap_226589_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_226589_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_226589_runs;
        str_builder(&builder,
                    "main.segmap_226606                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_226606_runs,
                    (long) ctx->mainzisegmap_226606_total_runtime /
                    (ctx->mainzisegmap_226606_runs !=
                     0 ? ctx->mainzisegmap_226606_runs : 1),
                    (long) ctx->mainzisegmap_226606_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_226606_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_226606_runs;
        str_builder(&builder,
                    "main.segmap_226894                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_226894_runs,
                    (long) ctx->mainzisegmap_226894_total_runtime /
                    (ctx->mainzisegmap_226894_runs !=
                     0 ? ctx->mainzisegmap_226894_runs : 1),
                    (long) ctx->mainzisegmap_226894_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_226894_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_226894_runs;
        str_builder(&builder,
                    "main.segmap_227111                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_227111_runs,
                    (long) ctx->mainzisegmap_227111_total_runtime /
                    (ctx->mainzisegmap_227111_runs !=
                     0 ? ctx->mainzisegmap_227111_runs : 1),
                    (long) ctx->mainzisegmap_227111_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_227111_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_227111_runs;
        str_builder(&builder,
                    "main.segmap_227132                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_227132_runs,
                    (long) ctx->mainzisegmap_227132_total_runtime /
                    (ctx->mainzisegmap_227132_runs !=
                     0 ? ctx->mainzisegmap_227132_runs : 1),
                    (long) ctx->mainzisegmap_227132_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_227132_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_227132_runs;
        str_builder(&builder,
                    "main.segmap_227261                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_227261_runs,
                    (long) ctx->mainzisegmap_227261_total_runtime /
                    (ctx->mainzisegmap_227261_runs !=
                     0 ? ctx->mainzisegmap_227261_runs : 1),
                    (long) ctx->mainzisegmap_227261_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_227261_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_227261_runs;
        str_builder(&builder,
                    "main.segmap_227986                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_227986_runs,
                    (long) ctx->mainzisegmap_227986_total_runtime /
                    (ctx->mainzisegmap_227986_runs !=
                     0 ? ctx->mainzisegmap_227986_runs : 1),
                    (long) ctx->mainzisegmap_227986_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_227986_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_227986_runs;
        str_builder(&builder,
                    "main.segmap_228041                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_228041_runs,
                    (long) ctx->mainzisegmap_228041_total_runtime /
                    (ctx->mainzisegmap_228041_runs !=
                     0 ? ctx->mainzisegmap_228041_runs : 1),
                    (long) ctx->mainzisegmap_228041_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_228041_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_228041_runs;
        str_builder(&builder,
                    "main.segmap_228103                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_228103_runs,
                    (long) ctx->mainzisegmap_228103_total_runtime /
                    (ctx->mainzisegmap_228103_runs !=
                     0 ? ctx->mainzisegmap_228103_runs : 1),
                    (long) ctx->mainzisegmap_228103_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_228103_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_228103_runs;
        str_builder(&builder,
                    "main.segmap_228189                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_228189_runs,
                    (long) ctx->mainzisegmap_228189_total_runtime /
                    (ctx->mainzisegmap_228189_runs !=
                     0 ? ctx->mainzisegmap_228189_runs : 1),
                    (long) ctx->mainzisegmap_228189_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_228189_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_228189_runs;
        str_builder(&builder,
                    "main.segmap_228212                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_228212_runs,
                    (long) ctx->mainzisegmap_228212_total_runtime /
                    (ctx->mainzisegmap_228212_runs !=
                     0 ? ctx->mainzisegmap_228212_runs : 1),
                    (long) ctx->mainzisegmap_228212_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_228212_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_228212_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_206893          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_206893_runs,
                    (long) ctx->mainzisegmap_intragroup_206893_total_runtime /
                    (ctx->mainzisegmap_intragroup_206893_runs !=
                     0 ? ctx->mainzisegmap_intragroup_206893_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_206893_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_206893_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_206893_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_207248          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_207248_runs,
                    (long) ctx->mainzisegmap_intragroup_207248_total_runtime /
                    (ctx->mainzisegmap_intragroup_207248_runs !=
                     0 ? ctx->mainzisegmap_intragroup_207248_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_207248_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_207248_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_207248_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_207524          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_207524_runs,
                    (long) ctx->mainzisegmap_intragroup_207524_total_runtime /
                    (ctx->mainzisegmap_intragroup_207524_runs !=
                     0 ? ctx->mainzisegmap_intragroup_207524_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_207524_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_207524_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_207524_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_207777          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_207777_runs,
                    (long) ctx->mainzisegmap_intragroup_207777_total_runtime /
                    (ctx->mainzisegmap_intragroup_207777_runs !=
                     0 ? ctx->mainzisegmap_intragroup_207777_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_207777_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_207777_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_207777_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_208681          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_208681_runs,
                    (long) ctx->mainzisegmap_intragroup_208681_total_runtime /
                    (ctx->mainzisegmap_intragroup_208681_runs !=
                     0 ? ctx->mainzisegmap_intragroup_208681_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_208681_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_208681_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_208681_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_209082          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_209082_runs,
                    (long) ctx->mainzisegmap_intragroup_209082_total_runtime /
                    (ctx->mainzisegmap_intragroup_209082_runs !=
                     0 ? ctx->mainzisegmap_intragroup_209082_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_209082_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_209082_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_209082_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_209708          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_209708_runs,
                    (long) ctx->mainzisegmap_intragroup_209708_total_runtime /
                    (ctx->mainzisegmap_intragroup_209708_runs !=
                     0 ? ctx->mainzisegmap_intragroup_209708_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_209708_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_209708_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_209708_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_211768          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_211768_runs,
                    (long) ctx->mainzisegmap_intragroup_211768_total_runtime /
                    (ctx->mainzisegmap_intragroup_211768_runs !=
                     0 ? ctx->mainzisegmap_intragroup_211768_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_211768_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_211768_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_211768_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_213836          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_213836_runs,
                    (long) ctx->mainzisegmap_intragroup_213836_total_runtime /
                    (ctx->mainzisegmap_intragroup_213836_runs !=
                     0 ? ctx->mainzisegmap_intragroup_213836_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_213836_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_213836_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_213836_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_216411          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_216411_runs,
                    (long) ctx->mainzisegmap_intragroup_216411_total_runtime /
                    (ctx->mainzisegmap_intragroup_216411_runs !=
                     0 ? ctx->mainzisegmap_intragroup_216411_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_216411_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_216411_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_216411_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_217183          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_217183_runs,
                    (long) ctx->mainzisegmap_intragroup_217183_total_runtime /
                    (ctx->mainzisegmap_intragroup_217183_runs !=
                     0 ? ctx->mainzisegmap_intragroup_217183_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_217183_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_217183_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_217183_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_217504          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_217504_runs,
                    (long) ctx->mainzisegmap_intragroup_217504_total_runtime /
                    (ctx->mainzisegmap_intragroup_217504_runs !=
                     0 ? ctx->mainzisegmap_intragroup_217504_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_217504_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_217504_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_217504_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_217955          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_217955_runs,
                    (long) ctx->mainzisegmap_intragroup_217955_total_runtime /
                    (ctx->mainzisegmap_intragroup_217955_runs !=
                     0 ? ctx->mainzisegmap_intragroup_217955_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_217955_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_217955_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_217955_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_221669          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_221669_runs,
                    (long) ctx->mainzisegmap_intragroup_221669_total_runtime /
                    (ctx->mainzisegmap_intragroup_221669_runs !=
                     0 ? ctx->mainzisegmap_intragroup_221669_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_221669_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_221669_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_221669_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_221836          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_221836_runs,
                    (long) ctx->mainzisegmap_intragroup_221836_total_runtime /
                    (ctx->mainzisegmap_intragroup_221836_runs !=
                     0 ? ctx->mainzisegmap_intragroup_221836_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_221836_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_221836_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_221836_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_222093          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_222093_runs,
                    (long) ctx->mainzisegmap_intragroup_222093_total_runtime /
                    (ctx->mainzisegmap_intragroup_222093_runs !=
                     0 ? ctx->mainzisegmap_intragroup_222093_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_222093_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_222093_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_222093_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_225917          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_225917_runs,
                    (long) ctx->mainzisegmap_intragroup_225917_total_runtime /
                    (ctx->mainzisegmap_intragroup_225917_runs !=
                     0 ? ctx->mainzisegmap_intragroup_225917_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_225917_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_225917_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_225917_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_226230          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_226230_runs,
                    (long) ctx->mainzisegmap_intragroup_226230_total_runtime /
                    (ctx->mainzisegmap_intragroup_226230_runs !=
                     0 ? ctx->mainzisegmap_intragroup_226230_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_226230_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_226230_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_226230_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_226634          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_226634_runs,
                    (long) ctx->mainzisegmap_intragroup_226634_total_runtime /
                    (ctx->mainzisegmap_intragroup_226634_runs !=
                     0 ? ctx->mainzisegmap_intragroup_226634_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_226634_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_226634_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_226634_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_226984          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_226984_runs,
                    (long) ctx->mainzisegmap_intragroup_226984_total_runtime /
                    (ctx->mainzisegmap_intragroup_226984_runs !=
                     0 ? ctx->mainzisegmap_intragroup_226984_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_226984_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_226984_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_226984_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_227359          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_227359_runs,
                    (long) ctx->mainzisegmap_intragroup_227359_total_runtime /
                    (ctx->mainzisegmap_intragroup_227359_runs !=
                     0 ? ctx->mainzisegmap_intragroup_227359_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_227359_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_227359_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_227359_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_227815          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_227815_runs,
                    (long) ctx->mainzisegmap_intragroup_227815_total_runtime /
                    (ctx->mainzisegmap_intragroup_227815_runs !=
                     0 ? ctx->mainzisegmap_intragroup_227815_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_227815_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_227815_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_227815_runs;
        str_builder(&builder,
                    "main.segred_large_212003               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_212003_runs,
                    (long) ctx->mainzisegred_large_212003_total_runtime /
                    (ctx->mainzisegred_large_212003_runs !=
                     0 ? ctx->mainzisegred_large_212003_runs : 1),
                    (long) ctx->mainzisegred_large_212003_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_212003_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_212003_runs;
        str_builder(&builder,
                    "main.segred_large_212077               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_212077_runs,
                    (long) ctx->mainzisegred_large_212077_total_runtime /
                    (ctx->mainzisegred_large_212077_runs !=
                     0 ? ctx->mainzisegred_large_212077_runs : 1),
                    (long) ctx->mainzisegred_large_212077_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_212077_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_212077_runs;
        str_builder(&builder,
                    "main.segred_large_214137               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_214137_runs,
                    (long) ctx->mainzisegred_large_214137_total_runtime /
                    (ctx->mainzisegred_large_214137_runs !=
                     0 ? ctx->mainzisegred_large_214137_runs : 1),
                    (long) ctx->mainzisegred_large_214137_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_214137_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_214137_runs;
        str_builder(&builder,
                    "main.segred_large_214231               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_214231_runs,
                    (long) ctx->mainzisegred_large_214231_total_runtime /
                    (ctx->mainzisegred_large_214231_runs !=
                     0 ? ctx->mainzisegred_large_214231_runs : 1),
                    (long) ctx->mainzisegred_large_214231_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_214231_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_214231_runs;
        str_builder(&builder,
                    "main.segred_large_216784               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_216784_runs,
                    (long) ctx->mainzisegred_large_216784_total_runtime /
                    (ctx->mainzisegred_large_216784_runs !=
                     0 ? ctx->mainzisegred_large_216784_runs : 1),
                    (long) ctx->mainzisegred_large_216784_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_216784_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_216784_runs;
        str_builder(&builder,
                    "main.segred_large_216907               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_216907_runs,
                    (long) ctx->mainzisegred_large_216907_total_runtime /
                    (ctx->mainzisegred_large_216907_runs !=
                     0 ? ctx->mainzisegred_large_216907_runs : 1),
                    (long) ctx->mainzisegred_large_216907_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_216907_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_216907_runs;
        str_builder(&builder,
                    "main.segred_large_218631               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_218631_runs,
                    (long) ctx->mainzisegred_large_218631_total_runtime /
                    (ctx->mainzisegred_large_218631_runs !=
                     0 ? ctx->mainzisegred_large_218631_runs : 1),
                    (long) ctx->mainzisegred_large_218631_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_218631_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_218631_runs;
        str_builder(&builder,
                    "main.segred_large_218762               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_218762_runs,
                    (long) ctx->mainzisegred_large_218762_total_runtime /
                    (ctx->mainzisegred_large_218762_runs !=
                     0 ? ctx->mainzisegred_large_218762_runs : 1),
                    (long) ctx->mainzisegred_large_218762_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_218762_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_218762_runs;
        str_builder(&builder,
                    "main.segred_large_218893               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_218893_runs,
                    (long) ctx->mainzisegred_large_218893_total_runtime /
                    (ctx->mainzisegred_large_218893_runs !=
                     0 ? ctx->mainzisegred_large_218893_runs : 1),
                    (long) ctx->mainzisegred_large_218893_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_218893_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_218893_runs;
        str_builder(&builder,
                    "main.segred_large_219515               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_219515_runs,
                    (long) ctx->mainzisegred_large_219515_total_runtime /
                    (ctx->mainzisegred_large_219515_runs !=
                     0 ? ctx->mainzisegred_large_219515_runs : 1),
                    (long) ctx->mainzisegred_large_219515_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_219515_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_219515_runs;
        str_builder(&builder,
                    "main.segred_large_219564               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_219564_runs,
                    (long) ctx->mainzisegred_large_219564_total_runtime /
                    (ctx->mainzisegred_large_219564_runs !=
                     0 ? ctx->mainzisegred_large_219564_runs : 1),
                    (long) ctx->mainzisegred_large_219564_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_219564_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_219564_runs;
        str_builder(&builder,
                    "main.segred_large_220344               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_220344_runs,
                    (long) ctx->mainzisegred_large_220344_total_runtime /
                    (ctx->mainzisegred_large_220344_runs !=
                     0 ? ctx->mainzisegred_large_220344_runs : 1),
                    (long) ctx->mainzisegred_large_220344_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_220344_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_220344_runs;
        str_builder(&builder,
                    "main.segred_large_220413               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_220413_runs,
                    (long) ctx->mainzisegred_large_220413_total_runtime /
                    (ctx->mainzisegred_large_220413_runs !=
                     0 ? ctx->mainzisegred_large_220413_runs : 1),
                    (long) ctx->mainzisegred_large_220413_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_220413_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_220413_runs;
        str_builder(&builder,
                    "main.segred_large_221423               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_221423_runs,
                    (long) ctx->mainzisegred_large_221423_total_runtime /
                    (ctx->mainzisegred_large_221423_runs !=
                     0 ? ctx->mainzisegred_large_221423_runs : 1),
                    (long) ctx->mainzisegred_large_221423_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_221423_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_221423_runs;
        str_builder(&builder,
                    "main.segred_large_221521               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_221521_runs,
                    (long) ctx->mainzisegred_large_221521_total_runtime /
                    (ctx->mainzisegred_large_221521_runs !=
                     0 ? ctx->mainzisegred_large_221521_runs : 1),
                    (long) ctx->mainzisegred_large_221521_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_221521_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_221521_runs;
        str_builder(&builder,
                    "main.segred_large_223197               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_223197_runs,
                    (long) ctx->mainzisegred_large_223197_total_runtime /
                    (ctx->mainzisegred_large_223197_runs !=
                     0 ? ctx->mainzisegred_large_223197_runs : 1),
                    (long) ctx->mainzisegred_large_223197_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_223197_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_223197_runs;
        str_builder(&builder,
                    "main.segred_large_223249               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_223249_runs,
                    (long) ctx->mainzisegred_large_223249_total_runtime /
                    (ctx->mainzisegred_large_223249_runs !=
                     0 ? ctx->mainzisegred_large_223249_runs : 1),
                    (long) ctx->mainzisegred_large_223249_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_223249_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_223249_runs;
        str_builder(&builder,
                    "main.segred_large_224235               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_224235_runs,
                    (long) ctx->mainzisegred_large_224235_total_runtime /
                    (ctx->mainzisegred_large_224235_runs !=
                     0 ? ctx->mainzisegred_large_224235_runs : 1),
                    (long) ctx->mainzisegred_large_224235_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_224235_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_224235_runs;
        str_builder(&builder,
                    "main.segred_large_224307               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_224307_runs,
                    (long) ctx->mainzisegred_large_224307_total_runtime /
                    (ctx->mainzisegred_large_224307_runs !=
                     0 ? ctx->mainzisegred_large_224307_runs : 1),
                    (long) ctx->mainzisegred_large_224307_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_224307_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_224307_runs;
        str_builder(&builder,
                    "main.segred_large_225523               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_225523_runs,
                    (long) ctx->mainzisegred_large_225523_total_runtime /
                    (ctx->mainzisegred_large_225523_runs !=
                     0 ? ctx->mainzisegred_large_225523_runs : 1),
                    (long) ctx->mainzisegred_large_225523_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_225523_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_225523_runs;
        str_builder(&builder,
                    "main.segred_large_225624               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_225624_runs,
                    (long) ctx->mainzisegred_large_225624_total_runtime /
                    (ctx->mainzisegred_large_225624_runs !=
                     0 ? ctx->mainzisegred_large_225624_runs : 1),
                    (long) ctx->mainzisegred_large_225624_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_225624_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_225624_runs;
        str_builder(&builder,
                    "main.segred_large_228090               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_228090_runs,
                    (long) ctx->mainzisegred_large_228090_total_runtime /
                    (ctx->mainzisegred_large_228090_runs !=
                     0 ? ctx->mainzisegred_large_228090_runs : 1),
                    (long) ctx->mainzisegred_large_228090_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_228090_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_228090_runs;
        str_builder(&builder,
                    "main.segred_small_212003               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_212003_runs,
                    (long) ctx->mainzisegred_small_212003_total_runtime /
                    (ctx->mainzisegred_small_212003_runs !=
                     0 ? ctx->mainzisegred_small_212003_runs : 1),
                    (long) ctx->mainzisegred_small_212003_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_212003_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_212003_runs;
        str_builder(&builder,
                    "main.segred_small_212077               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_212077_runs,
                    (long) ctx->mainzisegred_small_212077_total_runtime /
                    (ctx->mainzisegred_small_212077_runs !=
                     0 ? ctx->mainzisegred_small_212077_runs : 1),
                    (long) ctx->mainzisegred_small_212077_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_212077_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_212077_runs;
        str_builder(&builder,
                    "main.segred_small_214137               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_214137_runs,
                    (long) ctx->mainzisegred_small_214137_total_runtime /
                    (ctx->mainzisegred_small_214137_runs !=
                     0 ? ctx->mainzisegred_small_214137_runs : 1),
                    (long) ctx->mainzisegred_small_214137_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_214137_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_214137_runs;
        str_builder(&builder,
                    "main.segred_small_214231               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_214231_runs,
                    (long) ctx->mainzisegred_small_214231_total_runtime /
                    (ctx->mainzisegred_small_214231_runs !=
                     0 ? ctx->mainzisegred_small_214231_runs : 1),
                    (long) ctx->mainzisegred_small_214231_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_214231_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_214231_runs;
        str_builder(&builder,
                    "main.segred_small_216784               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_216784_runs,
                    (long) ctx->mainzisegred_small_216784_total_runtime /
                    (ctx->mainzisegred_small_216784_runs !=
                     0 ? ctx->mainzisegred_small_216784_runs : 1),
                    (long) ctx->mainzisegred_small_216784_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_216784_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_216784_runs;
        str_builder(&builder,
                    "main.segred_small_216907               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_216907_runs,
                    (long) ctx->mainzisegred_small_216907_total_runtime /
                    (ctx->mainzisegred_small_216907_runs !=
                     0 ? ctx->mainzisegred_small_216907_runs : 1),
                    (long) ctx->mainzisegred_small_216907_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_216907_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_216907_runs;
        str_builder(&builder,
                    "main.segred_small_218631               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_218631_runs,
                    (long) ctx->mainzisegred_small_218631_total_runtime /
                    (ctx->mainzisegred_small_218631_runs !=
                     0 ? ctx->mainzisegred_small_218631_runs : 1),
                    (long) ctx->mainzisegred_small_218631_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_218631_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_218631_runs;
        str_builder(&builder,
                    "main.segred_small_218762               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_218762_runs,
                    (long) ctx->mainzisegred_small_218762_total_runtime /
                    (ctx->mainzisegred_small_218762_runs !=
                     0 ? ctx->mainzisegred_small_218762_runs : 1),
                    (long) ctx->mainzisegred_small_218762_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_218762_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_218762_runs;
        str_builder(&builder,
                    "main.segred_small_218893               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_218893_runs,
                    (long) ctx->mainzisegred_small_218893_total_runtime /
                    (ctx->mainzisegred_small_218893_runs !=
                     0 ? ctx->mainzisegred_small_218893_runs : 1),
                    (long) ctx->mainzisegred_small_218893_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_218893_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_218893_runs;
        str_builder(&builder,
                    "main.segred_small_219515               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_219515_runs,
                    (long) ctx->mainzisegred_small_219515_total_runtime /
                    (ctx->mainzisegred_small_219515_runs !=
                     0 ? ctx->mainzisegred_small_219515_runs : 1),
                    (long) ctx->mainzisegred_small_219515_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_219515_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_219515_runs;
        str_builder(&builder,
                    "main.segred_small_219564               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_219564_runs,
                    (long) ctx->mainzisegred_small_219564_total_runtime /
                    (ctx->mainzisegred_small_219564_runs !=
                     0 ? ctx->mainzisegred_small_219564_runs : 1),
                    (long) ctx->mainzisegred_small_219564_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_219564_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_219564_runs;
        str_builder(&builder,
                    "main.segred_small_220344               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_220344_runs,
                    (long) ctx->mainzisegred_small_220344_total_runtime /
                    (ctx->mainzisegred_small_220344_runs !=
                     0 ? ctx->mainzisegred_small_220344_runs : 1),
                    (long) ctx->mainzisegred_small_220344_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_220344_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_220344_runs;
        str_builder(&builder,
                    "main.segred_small_220413               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_220413_runs,
                    (long) ctx->mainzisegred_small_220413_total_runtime /
                    (ctx->mainzisegred_small_220413_runs !=
                     0 ? ctx->mainzisegred_small_220413_runs : 1),
                    (long) ctx->mainzisegred_small_220413_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_220413_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_220413_runs;
        str_builder(&builder,
                    "main.segred_small_221423               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_221423_runs,
                    (long) ctx->mainzisegred_small_221423_total_runtime /
                    (ctx->mainzisegred_small_221423_runs !=
                     0 ? ctx->mainzisegred_small_221423_runs : 1),
                    (long) ctx->mainzisegred_small_221423_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_221423_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_221423_runs;
        str_builder(&builder,
                    "main.segred_small_221521               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_221521_runs,
                    (long) ctx->mainzisegred_small_221521_total_runtime /
                    (ctx->mainzisegred_small_221521_runs !=
                     0 ? ctx->mainzisegred_small_221521_runs : 1),
                    (long) ctx->mainzisegred_small_221521_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_221521_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_221521_runs;
        str_builder(&builder,
                    "main.segred_small_223197               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_223197_runs,
                    (long) ctx->mainzisegred_small_223197_total_runtime /
                    (ctx->mainzisegred_small_223197_runs !=
                     0 ? ctx->mainzisegred_small_223197_runs : 1),
                    (long) ctx->mainzisegred_small_223197_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_223197_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_223197_runs;
        str_builder(&builder,
                    "main.segred_small_223249               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_223249_runs,
                    (long) ctx->mainzisegred_small_223249_total_runtime /
                    (ctx->mainzisegred_small_223249_runs !=
                     0 ? ctx->mainzisegred_small_223249_runs : 1),
                    (long) ctx->mainzisegred_small_223249_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_223249_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_223249_runs;
        str_builder(&builder,
                    "main.segred_small_224235               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_224235_runs,
                    (long) ctx->mainzisegred_small_224235_total_runtime /
                    (ctx->mainzisegred_small_224235_runs !=
                     0 ? ctx->mainzisegred_small_224235_runs : 1),
                    (long) ctx->mainzisegred_small_224235_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_224235_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_224235_runs;
        str_builder(&builder,
                    "main.segred_small_224307               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_224307_runs,
                    (long) ctx->mainzisegred_small_224307_total_runtime /
                    (ctx->mainzisegred_small_224307_runs !=
                     0 ? ctx->mainzisegred_small_224307_runs : 1),
                    (long) ctx->mainzisegred_small_224307_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_224307_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_224307_runs;
        str_builder(&builder,
                    "main.segred_small_225523               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_225523_runs,
                    (long) ctx->mainzisegred_small_225523_total_runtime /
                    (ctx->mainzisegred_small_225523_runs !=
                     0 ? ctx->mainzisegred_small_225523_runs : 1),
                    (long) ctx->mainzisegred_small_225523_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_225523_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_225523_runs;
        str_builder(&builder,
                    "main.segred_small_225624               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_225624_runs,
                    (long) ctx->mainzisegred_small_225624_total_runtime /
                    (ctx->mainzisegred_small_225624_runs !=
                     0 ? ctx->mainzisegred_small_225624_runs : 1),
                    (long) ctx->mainzisegred_small_225624_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_225624_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_225624_runs;
        str_builder(&builder,
                    "main.segred_small_228090               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_228090_runs,
                    (long) ctx->mainzisegred_small_228090_total_runtime /
                    (ctx->mainzisegred_small_228090_runs !=
                     0 ? ctx->mainzisegred_small_228090_runs : 1),
                    (long) ctx->mainzisegred_small_228090_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_228090_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_228090_runs;
        str_builder(&builder,
                    "main.segscan_206867                    ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegscan_206867_runs,
                    (long) ctx->mainzisegscan_206867_total_runtime /
                    (ctx->mainzisegscan_206867_runs !=
                     0 ? ctx->mainzisegscan_206867_runs : 1),
                    (long) ctx->mainzisegscan_206867_total_runtime);
        ctx->total_runtime += ctx->mainzisegscan_206867_total_runtime;
        ctx->total_runs += ctx->mainzisegscan_206867_runs;
        str_builder(&builder,
                    "main.segscan_207007                    ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegscan_207007_runs,
                    (long) ctx->mainzisegscan_207007_total_runtime /
                    (ctx->mainzisegscan_207007_runs !=
                     0 ? ctx->mainzisegscan_207007_runs : 1),
                    (long) ctx->mainzisegscan_207007_total_runtime);
        ctx->total_runtime += ctx->mainzisegscan_207007_total_runtime;
        ctx->total_runs += ctx->mainzisegscan_207007_runs;
        str_builder(&builder,
                    "main.segscan_207559                    ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegscan_207559_runs,
                    (long) ctx->mainzisegscan_207559_total_runtime /
                    (ctx->mainzisegscan_207559_runs !=
                     0 ? ctx->mainzisegscan_207559_runs : 1),
                    (long) ctx->mainzisegscan_207559_total_runtime);
        ctx->total_runtime += ctx->mainzisegscan_207559_total_runtime;
        ctx->total_runs += ctx->mainzisegscan_207559_runs;
        str_builder(&builder,
                    "main.segscan_218683                    ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegscan_218683_runs,
                    (long) ctx->mainzisegscan_218683_total_runtime /
                    (ctx->mainzisegscan_218683_runs !=
                     0 ? ctx->mainzisegscan_218683_runs : 1),
                    (long) ctx->mainzisegscan_218683_total_runtime);
        ctx->total_runtime += ctx->mainzisegscan_218683_total_runtime;
        ctx->total_runs += ctx->mainzisegscan_218683_runs;
        str_builder(&builder,
                    "main.segscan_218814                    ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegscan_218814_runs,
                    (long) ctx->mainzisegscan_218814_total_runtime /
                    (ctx->mainzisegscan_218814_runs !=
                     0 ? ctx->mainzisegscan_218814_runs : 1),
                    (long) ctx->mainzisegscan_218814_total_runtime);
        ctx->total_runtime += ctx->mainzisegscan_218814_total_runtime;
        ctx->total_runs += ctx->mainzisegscan_218814_runs;
        str_builder(&builder,
                    "main.segscan_218945                    ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegscan_218945_runs,
                    (long) ctx->mainzisegscan_218945_total_runtime /
                    (ctx->mainzisegscan_218945_runs !=
                     0 ? ctx->mainzisegscan_218945_runs : 1),
                    (long) ctx->mainzisegscan_218945_total_runtime);
        ctx->total_runtime += ctx->mainzisegscan_218945_total_runtime;
        ctx->total_runs += ctx->mainzisegscan_218945_runs;
        str_builder(&builder,
                    "main.segscan_227915                    ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegscan_227915_runs,
                    (long) ctx->mainzisegscan_227915_total_runtime /
                    (ctx->mainzisegscan_227915_runs !=
                     0 ? ctx->mainzisegscan_227915_runs : 1),
                    (long) ctx->mainzisegscan_227915_total_runtime);
        ctx->total_runtime += ctx->mainzisegscan_227915_total_runtime;
        ctx->total_runs += ctx->mainzisegscan_227915_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_232962,
                                         int32_t num_elems_232963,
                                         double val_232964);
static int futrts_builtinzhreplicate_i64(struct futhark_context *ctx,
                                         struct memblock_device mem_232503,
                                         int32_t num_elems_232504,
                                         int64_t val_232505);
static int futrts_builtinzhreplicate_i8(struct futhark_context *ctx,
                                        struct memblock_device mem_232261,
                                        int32_t num_elems_232262,
                                        int8_t val_232263);
static int futrts_entry_main(struct futhark_context *ctx,
                             struct memblock_device *mem_out_p_237140,
                             struct memblock_device *mem_out_p_237141,
                             struct memblock_device *mem_out_p_237142,
                             struct memblock_device Y_mem_229145,
                             int64_t m_203489, int64_t n_203490,
                             int64_t n_p_203492, int64_t q_s_203493,
                             int64_t q_t_203494, int64_t q_l_203495,
                             int64_t d_s_203496, int64_t d_t_203497,
                             int64_t d_l_203498, int64_t jump_s_203499,
                             int64_t jump_t_203500, int64_t jump_l_203501,
                             int64_t n_inner_203502, int64_t n_outer_203503,
                             int64_t jump_threshold_203504,
                             int64_t q_threshold_203505);

static int init_constants(struct futhark_context *ctx)
{
    (void) ctx;
    
    int err = 0;
    
    
  cleanup:
    return err;
}
static int free_constants(struct futhark_context *ctx)
{
    (void) ctx;
    return 0;
}
struct futhark_f64_2d {
    struct memblock_device mem;
    int64_t shape[2];
};
struct futhark_f64_2d *futhark_new_f64_2d(struct futhark_context *ctx, const
                                          double *data, int64_t dim0,
                                          int64_t dim1)
{
    struct futhark_f64_2d *bad = NULL;
    struct futhark_f64_2d *arr =
                          (struct futhark_f64_2d *) malloc(sizeof(struct futhark_f64_2d));
    
    if (arr == NULL)
        return bad;
    lock_lock(&ctx->lock);
    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_237075 = (int64_t) 2176;
                CUdeviceptr kernel_arg_237077 = destmem_0.mem;
                CUdeviceptr kernel_arg_237078 = srcmem_2.mem;
                unsigned int shared_offset_237076 = 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_237072[] = {&perm[0], &perm[1], &perm[2],
                                                  &shared_offset_237076,
                                                  &destoffset_1, &srcoffset_3,
                                                  &num_arrays_4, &x_elems_5,
                                                  &y_elems_6, &mulx_7, &muly_8,
                                                  &kernel_arg_237077,
                                                  &kernel_arg_237078};
                    int64_t time_start_237073 = 0, time_end_237074 = 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_237075 +
                                                                        (8 -
                                                                         shared_sizze_237075 %
                                                                         8) %
                                                                        8)));
                        time_start_237073 = 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_237075 +
                                                           (8 -
                                                            shared_sizze_237075 %
                                                            8) % 8), NULL,
                                                          kernel_args_237072,
                                                          NULL));
                    if (pevents != NULL)
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                    if (ctx->debugging) {
                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                        time_end_237074 = get_wall_time();
                        fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                "gpu_map_transpose_f64_low_width",
                                time_end_237074 - time_start_237073);
                    }
                }
            } else {
                if (sle32(y_elems_6, 8) && slt32(16, x_elems_5)) {
                    unsigned int shared_sizze_237082 = (int64_t) 2176;
                    CUdeviceptr kernel_arg_237084 = destmem_0.mem;
                    CUdeviceptr kernel_arg_237085 = srcmem_2.mem;
                    unsigned int shared_offset_237083 = 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_237079[] = {&perm[0], &perm[1],
                                                      &perm[2],
                                                      &shared_offset_237083,
                                                      &destoffset_1,
                                                      &srcoffset_3,
                                                      &num_arrays_4, &x_elems_5,
                                                      &y_elems_6, &mulx_7,
                                                      &muly_8,
                                                      &kernel_arg_237084,
                                                      &kernel_arg_237085};
                        int64_t time_start_237080 = 0, time_end_237081 = 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_237082 +
                                                          (8 -
                                                           shared_sizze_237082 %
                                                           8) % 8)));
                            time_start_237080 = 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_237082 +
                                                               (8 -
                                                                shared_sizze_237082 %
                                                                8) % 8), NULL,
                                                              kernel_args_237079,
                                                              NULL));
                        if (pevents != NULL)
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                        if (ctx->debugging) {
                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                            time_end_237081 = get_wall_time();
                            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                    "gpu_map_transpose_f64_low_height",
                                    time_end_237081 - time_start_237080);
                        }
                    }
                } else {
                    if (sle32(x_elems_5, 8) && sle32(y_elems_6, 8)) {
                        unsigned int shared_sizze_237089 = (int64_t) 1;
                        CUdeviceptr kernel_arg_237091 = destmem_0.mem;
                        CUdeviceptr kernel_arg_237092 = srcmem_2.mem;
                        unsigned int shared_offset_237090 = 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_237086[] = {&shared_offset_237090,
                                                          &destoffset_1,
                                                          &srcoffset_3,
                                                          &num_arrays_4,
                                                          &x_elems_5,
                                                          &y_elems_6, &mulx_7,
                                                          &muly_8,
                                                          &kernel_arg_237091,
                                                          &kernel_arg_237092};
                            int64_t time_start_237087 = 0, time_end_237088 = 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_237089 +
                                                          (8 -
                                                           shared_sizze_237089 %
                                                           8) % 8)));
                                time_start_237087 = 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_237089 +
                                                                   (8 -
                                                                    shared_sizze_237089 %
                                                                    8) % 8),
                                                                  NULL,
                                                                  kernel_args_237086,
                                                                  NULL));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                            if (ctx->debugging) {
                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                time_end_237088 = get_wall_time();
                                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                        "gpu_map_transpose_f64_small",
                                        time_end_237088 - time_start_237087);
                            }
                        }
                    } else {
                        unsigned int shared_sizze_237096 = (int64_t) 8448;
                        CUdeviceptr kernel_arg_237098 = destmem_0.mem;
                        CUdeviceptr kernel_arg_237099 = srcmem_2.mem;
                        unsigned int shared_offset_237097 = 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_237093[] = {&perm[0], &perm[1],
                                                          &perm[2],
                                                          &shared_offset_237097,
                                                          &destoffset_1,
                                                          &srcoffset_3,
                                                          &num_arrays_4,
                                                          &x_elems_5,
                                                          &y_elems_6, &mulx_7,
                                                          &muly_8,
                                                          &kernel_arg_237098,
                                                          &kernel_arg_237099};
                            int64_t time_start_237094 = 0, time_end_237095 = 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_237096 +
                                                                    (8 -
                                                                     shared_sizze_237096 %
                                                                     8) % 8)));
                                time_start_237094 = 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_237096 +
                                                                   (8 -
                                                                    shared_sizze_237096 %
                                                                    8) % 8),
                                                                  NULL,
                                                                  kernel_args_237093,
                                                                  NULL));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                            if (ctx->debugging) {
                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                time_end_237095 = get_wall_time();
                                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                        "gpu_map_transpose_f64",
                                        time_end_237095 - time_start_237094);
                            }
                        }
                    }
                }
            }
        }
    }
    
  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_237103 = (int64_t) 2176;
                CUdeviceptr kernel_arg_237105 = destmem_0.mem;
                CUdeviceptr kernel_arg_237106 = srcmem_2.mem;
                unsigned int shared_offset_237104 = 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_237100[] = {&perm[0], &perm[1], &perm[2],
                                                  &shared_offset_237104,
                                                  &destoffset_1, &srcoffset_3,
                                                  &num_arrays_4, &x_elems_5,
                                                  &y_elems_6, &mulx_7, &muly_8,
                                                  &kernel_arg_237105,
                                                  &kernel_arg_237106};
                    int64_t time_start_237101 = 0, time_end_237102 = 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_237103 +
                                                                        (8 -
                                                                         shared_sizze_237103 %
                                                                         8) %
                                                                        8)));
                        time_start_237101 = 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_237103 +
                                                           (8 -
                                                            shared_sizze_237103 %
                                                            8) % 8), NULL,
                                                          kernel_args_237100,
                                                          NULL));
                    if (pevents != NULL)
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                    if (ctx->debugging) {
                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                        time_end_237102 = get_wall_time();
                        fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                "gpu_map_transpose_i64_low_width",
                                time_end_237102 - time_start_237101);
                    }
                }
            } else {
                if (sle32(y_elems_6, 8) && slt32(16, x_elems_5)) {
                    unsigned int shared_sizze_237110 = (int64_t) 2176;
                    CUdeviceptr kernel_arg_237112 = destmem_0.mem;
                    CUdeviceptr kernel_arg_237113 = srcmem_2.mem;
                    unsigned int shared_offset_237111 = 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_237107[] = {&perm[0], &perm[1],
                                                      &perm[2],
                                                      &shared_offset_237111,
                                                      &destoffset_1,
                                                      &srcoffset_3,
                                                      &num_arrays_4, &x_elems_5,
                                                      &y_elems_6, &mulx_7,
                                                      &muly_8,
                                                      &kernel_arg_237112,
                                                      &kernel_arg_237113};
                        int64_t time_start_237108 = 0, time_end_237109 = 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_237110 +
                                                          (8 -
                                                           shared_sizze_237110 %
                                                           8) % 8)));
                            time_start_237108 = 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_237110 +
                                                               (8 -
                                                                shared_sizze_237110 %
                                                                8) % 8), NULL,
                                                              kernel_args_237107,
                                                              NULL));
                        if (pevents != NULL)
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                        if (ctx->debugging) {
                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                            time_end_237109 = get_wall_time();
                            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                    "gpu_map_transpose_i64_low_height",
                                    time_end_237109 - time_start_237108);
                        }
                    }
                } else {
                    if (sle32(x_elems_5, 8) && sle32(y_elems_6, 8)) {
                        unsigned int shared_sizze_237117 = (int64_t) 1;
                        CUdeviceptr kernel_arg_237119 = destmem_0.mem;
                        CUdeviceptr kernel_arg_237120 = srcmem_2.mem;
                        unsigned int shared_offset_237118 = 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_237114[] = {&shared_offset_237118,
                                                          &destoffset_1,
                                                          &srcoffset_3,
                                                          &num_arrays_4,
                                                          &x_elems_5,
                                                          &y_elems_6, &mulx_7,
                                                          &muly_8,
                                                          &kernel_arg_237119,
                                                          &kernel_arg_237120};
                            int64_t time_start_237115 = 0, time_end_237116 = 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_237117 +
                                                          (8 -
                                                           shared_sizze_237117 %
                                                           8) % 8)));
                                time_start_237115 = 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_237117 +
                                                                   (8 -
                                                                    shared_sizze_237117 %
                                                                    8) % 8),
                                                                  NULL,
                                                                  kernel_args_237114,
                                                                  NULL));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                            if (ctx->debugging) {
                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                time_end_237116 = get_wall_time();
                                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                        "gpu_map_transpose_i64_small",
                                        time_end_237116 - time_start_237115);
                            }
                        }
                    } else {
                        unsigned int shared_sizze_237124 = (int64_t) 8448;
                        CUdeviceptr kernel_arg_237126 = destmem_0.mem;
                        CUdeviceptr kernel_arg_237127 = srcmem_2.mem;
                        unsigned int shared_offset_237125 = 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_237121[] = {&perm[0], &perm[1],
                                                          &perm[2],
                                                          &shared_offset_237125,
                                                          &destoffset_1,
                                                          &srcoffset_3,
                                                          &num_arrays_4,
                                                          &x_elems_5,
                                                          &y_elems_6, &mulx_7,
                                                          &muly_8,
                                                          &kernel_arg_237126,
                                                          &kernel_arg_237127};
                            int64_t time_start_237122 = 0, time_end_237123 = 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_237124 +
                                                                    (8 -
                                                                     shared_sizze_237124 %
                                                                     8) % 8)));
                                time_start_237122 = 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_237124 +
                                                                   (8 -
                                                                    shared_sizze_237124 %
                                                                    8) % 8),
                                                                  NULL,
                                                                  kernel_args_237121,
                                                                  NULL));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                            if (ctx->debugging) {
                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                time_end_237123 = get_wall_time();
                                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                        "gpu_map_transpose_i64",
                                        time_end_237123 - time_start_237122);
                            }
                        }
                    }
                }
            }
        }
    }
    
  cleanup:
    { }
    return err;
}
static int futrts_builtinzhreplicate_f64(struct futhark_context *ctx,
                                         struct memblock_device mem_232962,
                                         int32_t num_elems_232963,
                                         double val_232964)
{
    (void) ctx;
    
    int err = 0;
    int64_t group_sizze_232969;
    
    group_sizze_232969 =
        *ctx->tuning_params.builtinzhreplicate_f64zigroup_sizze_232969;
    
    int64_t num_groups_232970 = sdiv_up64(num_elems_232963, group_sizze_232969);
    CUdeviceptr kernel_arg_237131 = mem_232962.mem;
    
    if ((((((1 && num_groups_232970 != 0) && 1 != 0) && 1 != 0) &&
          group_sizze_232969 != 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_232970;
        grid[perm[1]] = 1;
        grid[perm[2]] = 1;
        
        void *kernel_args_237128[] = {&num_elems_232963, &val_232964,
                                      &kernel_arg_237131};
        int64_t time_start_237129 = 0, time_end_237130 = 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_232966",
                    (long) num_groups_232970, (long) 1, (long) 1,
                    (long) group_sizze_232969, (long) 1, (long) 1, (int) 0);
            time_start_237129 = get_wall_time();
        }
        
        cudaEvent_t *pevents = NULL;
        
        if (ctx->profiling && !ctx->profiling_paused) {
            pevents = cuda_get_events(&ctx->cuda,
                                      &ctx->builtinzhreplicate_f64zireplicate_232966_runs,
                                      &ctx->builtinzhreplicate_f64zireplicate_232966_total_runtime);
            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
        }
        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->builtinzhreplicate_f64zireplicate_232966,
                                              grid[0], grid[1], grid[2],
                                              group_sizze_232969, 1, 1, 0, NULL,
                                              kernel_args_237128, NULL));
        if (pevents != NULL)
            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
        if (ctx->debugging) {
            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
            time_end_237130 = get_wall_time();
            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                    "builtin#replicate_f64.replicate_232966", time_end_237130 -
                    time_start_237129);
        }
    }
    
  cleanup:
    { }
    return err;
}
static int futrts_builtinzhreplicate_i64(struct futhark_context *ctx,
                                         struct memblock_device mem_232503,
                                         int32_t num_elems_232504,
                                         int64_t val_232505)
{
    (void) ctx;
    
    int err = 0;
    int64_t group_sizze_232510;
    
    group_sizze_232510 =
        *ctx->tuning_params.builtinzhreplicate_i64zigroup_sizze_232510;
    
    int64_t num_groups_232511 = sdiv_up64(num_elems_232504, group_sizze_232510);
    CUdeviceptr kernel_arg_237135 = mem_232503.mem;
    
    if ((((((1 && num_groups_232511 != 0) && 1 != 0) && 1 != 0) &&
          group_sizze_232510 != 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_232511;
        grid[perm[1]] = 1;
        grid[perm[2]] = 1;
        
        void *kernel_args_237132[] = {&num_elems_232504, &val_232505,
                                      &kernel_arg_237135};
        int64_t time_start_237133 = 0, time_end_237134 = 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_232507",
                    (long) num_groups_232511, (long) 1, (long) 1,
                    (long) group_sizze_232510, (long) 1, (long) 1, (int) 0);
            time_start_237133 = get_wall_time();
        }
        
        cudaEvent_t *pevents = NULL;
        
        if (ctx->profiling && !ctx->profiling_paused) {
            pevents = cuda_get_events(&ctx->cuda,
                                      &ctx->builtinzhreplicate_i64zireplicate_232507_runs,
                                      &ctx->builtinzhreplicate_i64zireplicate_232507_total_runtime);
            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
        }
        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->builtinzhreplicate_i64zireplicate_232507,
                                              grid[0], grid[1], grid[2],
                                              group_sizze_232510, 1, 1, 0, NULL,
                                              kernel_args_237132, NULL));
        if (pevents != NULL)
            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
        if (ctx->debugging) {
            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
            time_end_237134 = get_wall_time();
            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                    "builtin#replicate_i64.replicate_232507", time_end_237134 -
                    time_start_237133);
        }
    }
    
  cleanup:
    { }
    return err;
}
static int futrts_builtinzhreplicate_i8(struct futhark_context *ctx,
                                        struct memblock_device mem_232261,
                                        int32_t num_elems_232262,
                                        int8_t val_232263)
{
    (void) ctx;
    
    int err = 0;
    int64_t group_sizze_232268;
    
    group_sizze_232268 =
        *ctx->tuning_params.builtinzhreplicate_i8zigroup_sizze_232268;
    
    int64_t num_groups_232269 = sdiv_up64(num_elems_232262, group_sizze_232268);
    CUdeviceptr kernel_arg_237139 = mem_232261.mem;
    
    if ((((((1 && num_groups_232269 != 0) && 1 != 0) && 1 != 0) &&
          group_sizze_232268 != 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_232269;
        grid[perm[1]] = 1;
        grid[perm[2]] = 1;
        
        void *kernel_args_237136[] = {&num_elems_232262, &val_232263,
                                      &kernel_arg_237139};
        int64_t time_start_237137 = 0, time_end_237138 = 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_232265",
                    (long) num_groups_232269, (long) 1, (long) 1,
                    (long) group_sizze_232268, (long) 1, (long) 1, (int) 0);
            time_start_237137 = get_wall_time();
        }
        
        cudaEvent_t *pevents = NULL;
        
        if (ctx->profiling && !ctx->profiling_paused) {
            pevents = cuda_get_events(&ctx->cuda,
                                      &ctx->builtinzhreplicate_i8zireplicate_232265_runs,
                                      &ctx->builtinzhreplicate_i8zireplicate_232265_total_runtime);
            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
        }
        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->builtinzhreplicate_i8zireplicate_232265,
                                              grid[0], grid[1], grid[2],
                                              group_sizze_232268, 1, 1, 0, NULL,
                                              kernel_args_237136, NULL));
        if (pevents != NULL)
            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
        if (ctx->debugging) {
            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
            time_end_237138 = get_wall_time();
            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                    "builtin#replicate_i8.replicate_232265", time_end_237138 -
                    time_start_237137);
        }
    }
    
  cleanup:
    { }
    return err;
}
static int futrts_entry_main(struct futhark_context *ctx,
                             struct memblock_device *mem_out_p_237140,
                             struct memblock_device *mem_out_p_237141,
                             struct memblock_device *mem_out_p_237142,
                             struct memblock_device Y_mem_229145,
                             int64_t m_203489, int64_t n_203490,
                             int64_t n_p_203492, int64_t q_s_203493,
                             int64_t q_t_203494, int64_t q_l_203495,
                             int64_t d_s_203496, int64_t d_t_203497,
                             int64_t d_l_203498, int64_t jump_s_203499,
                             int64_t jump_t_203500, int64_t jump_l_203501,
                             int64_t n_inner_203502, int64_t n_outer_203503,
                             int64_t jump_threshold_203504,
                             int64_t q_threshold_203505)
{
    (void) ctx;
    
    int err = 0;
    struct memblock_device mem_out_232247;
    
    mem_out_232247.references = NULL;
    
    struct memblock_device mem_out_232248;
    
    mem_out_232248.references = NULL;
    
    struct memblock_device mem_out_232249;
    
    mem_out_232249.references = NULL;
    
    double i64_res_203506 = sitofp_i64_f64(n_203490);
    double i64_res_203507 = sitofp_i64_f64(n_p_203492);
    double ceil_arg_203508 = i64_res_203506 / i64_res_203507;
    double ceil_res_203509;
    
    ceil_res_203509 = futrts_ceil64(ceil_arg_203508);
    
    int64_t defunc_0_f_res_203510 = fptosi_f64_i64(ceil_res_203509);
    bool bounds_invalid_upwards_203511 = slt64(n_p_203492, (int64_t) 0);
    bool valid_203512 = !bounds_invalid_upwards_203511;
    bool range_valid_c_203513;
    
    if (!valid_203512) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Range ", (long long) (int64_t) 0, "..",
                               (long long) (int64_t) 1, "..<",
                               (long long) n_p_203492, " is invalid.",
                               "-> #0  /prelude/array.fut:90:3-10\n   #1  /prelude/array.fut:195:11-16\n   #2  utils.fut:6:3-16\n   #3  stl.fut:403:29-408:37\n   #4  stl.fut:402:22-409:28\n   #5  stl.fut:455:3-469:34\n   #6  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool bounds_invalid_upwards_203515 = slt64(defunc_0_f_res_203510,
                                               (int64_t) 0);
    bool valid_203516 = !bounds_invalid_upwards_203515;
    bool range_valid_c_203517;
    
    if (!valid_203516) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Range ", (long long) (int64_t) 0, "..",
                               (long long) (int64_t) 1, "..<",
                               (long long) defunc_0_f_res_203510,
                               " is invalid.",
                               "-> #0  /prelude/array.fut:90:3-10\n   #1  /prelude/array.fut:195:11-16\n   #2  utils.fut:6:3-16\n   #3  stl.fut:404:36-407:52\n   #4  /prelude/soacs.fut:59:3-10\n   #5  /prelude/array.fut:195:3-17\n   #6  utils.fut:6:3-16\n   #7  stl.fut:403:29-408:37\n   #8  stl.fut:402:22-409:28\n   #9  stl.fut:455:3-469:34\n   #10 stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t segscan_group_sizze_206862;
    
    segscan_group_sizze_206862 =
        *ctx->tuning_params.mainzisegscan_group_sizze_206861;
    
    int64_t num_groups_206864;
    int32_t max_num_groups_232250;
    
    max_num_groups_232250 = *ctx->tuning_params.mainzisegscan_num_groups_206863;
    num_groups_206864 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(m_203489,
                                                             segscan_group_sizze_206862),
                                                   sext_i32_i64(max_num_groups_232250))));
    
    int64_t binop_x_229146 = m_203489 * n_203490;
    int64_t bytes_229147 = (int64_t) 8 * binop_x_229146;
    struct memblock_device mem_229148;
    
    mem_229148.references = NULL;
    if (memblock_alloc_device(ctx, &mem_229148, bytes_229147, "mem_229148")) {
        err = 1;
        goto cleanup;
    }
    if (futrts_builtinzhgpu_map_transpose_f64(ctx, mem_229148, (int64_t) 0,
                                              Y_mem_229145, (int64_t) 0,
                                              (int64_t) 1, n_203490,
                                              m_203489) != 0) {
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t binop_y_229150 = (int64_t) 8 * m_203489;
    int64_t bytes_229151 = smax64((int64_t) 0, binop_y_229150);
    struct memblock_device mem_229152;
    
    mem_229152.references = NULL;
    if (memblock_alloc_device(ctx, &mem_229152, bytes_229151, "mem_229152")) {
        err = 1;
        goto cleanup;
    }
    
    struct memblock_device mem_229155;
    
    mem_229155.references = NULL;
    if (memblock_alloc_device(ctx, &mem_229155, bytes_229151, "mem_229155")) {
        err = 1;
        goto cleanup;
    }
    
    int64_t bytes_229156 = smax64((int64_t) 0, m_203489);
    struct memblock_device mem_229157;
    
    mem_229157.references = NULL;
    if (memblock_alloc_device(ctx, &mem_229157, bytes_229156, "mem_229157")) {
        err = 1;
        goto cleanup;
    }
    if (slt64((int64_t) 0, m_203489)) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegScan");
        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_232251 = sdiv_up64(m_203489,
                                              segscan_group_sizze_206862 *
                                              (int64_t) 11) *
                segscan_group_sizze_206862;
        int64_t numGroups_232252 = sdiv_up64(m_203489,
                                             segscan_group_sizze_206862 *
                                             (int64_t) 11);
        struct memblock_device mainziid_counter_mem_232253 =
                               ctx->mainziid_counter_mem_232253;
        struct memblock_device status_flags_mem_232255;
        
        status_flags_mem_232255.references = NULL;
        if (memblock_alloc_device(ctx, &status_flags_mem_232255,
                                  numGroups_232252,
                                  "status_flags_mem_232255")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device aggregates_mem_232257;
        
        aggregates_mem_232257.references = NULL;
        if (memblock_alloc_device(ctx, &aggregates_mem_232257, (int64_t) 8 *
                                  numGroups_232252, "aggregates_mem_232257")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device incprefixes_mem_232259;
        
        incprefixes_mem_232259.references = NULL;
        if (memblock_alloc_device(ctx, &incprefixes_mem_232259, (int64_t) 8 *
                                  numGroups_232252, "incprefixes_mem_232259")) {
            err = 1;
            goto cleanup;
        }
        if (futrts_builtinzhreplicate_i8(ctx, status_flags_mem_232255,
                                         numGroups_232252, (int8_t) 0) != 0) {
            if (memblock_unref_device(ctx, &incprefixes_mem_232259,
                                      "incprefixes_mem_232259") != 0)
                return 1;
            if (memblock_unref_device(ctx, &aggregates_mem_232257,
                                      "aggregates_mem_232257") != 0)
                return 1;
            if (memblock_unref_device(ctx, &status_flags_mem_232255,
                                      "status_flags_mem_232255") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") !=
                0)
                return 1;
            err = 1;
            goto cleanup;
        }
        
        unsigned int shared_sizze_237147 = smax64(smax64((int64_t) 288,
                                                         (int64_t) 8 *
                                                         segscan_group_sizze_206862),
                                                  (int64_t) 11 *
                                                  segscan_group_sizze_206862 *
                                                  (int64_t) 8);
        CUdeviceptr kernel_arg_237149 = mem_229148.mem;
        CUdeviceptr kernel_arg_237150 = mem_229152.mem;
        CUdeviceptr kernel_arg_237151 = mem_229155.mem;
        CUdeviceptr kernel_arg_237152 = mem_229157.mem;
        CUdeviceptr kernel_arg_237153 = mainziid_counter_mem_232253.mem;
        CUdeviceptr kernel_arg_237154 = status_flags_mem_232255.mem;
        CUdeviceptr kernel_arg_237155 = aggregates_mem_232257.mem;
        CUdeviceptr kernel_arg_237156 = incprefixes_mem_232259.mem;
        unsigned int shared_offset_237148 = 0;
        
        if ((((((1 && sdiv_up64(m_203489, segscan_group_sizze_206862 *
                                (int64_t) 11) != 0) && 1 != 0) && 1 != 0) &&
              segscan_group_sizze_206862 != 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_203489, segscan_group_sizze_206862 *
                                      (int64_t) 11);
            grid[perm[1]] = 1;
            grid[perm[2]] = 1;
            
            void *kernel_args_237144[] = {&ctx->global_failure,
                                          &ctx->failure_is_an_option,
                                          &ctx->global_failure_args,
                                          &shared_offset_237148, &m_203489,
                                          &n_203490, &n_p_203492,
                                          &defunc_0_f_res_203510,
                                          &kernel_arg_237149,
                                          &kernel_arg_237150,
                                          &kernel_arg_237151,
                                          &kernel_arg_237152,
                                          &kernel_arg_237153,
                                          &kernel_arg_237154,
                                          &kernel_arg_237155,
                                          &kernel_arg_237156};
            int64_t time_start_237145 = 0, time_end_237146 = 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_206867", (long) sdiv_up64(m_203489,
                                                                segscan_group_sizze_206862 *
                                                                (int64_t) 11),
                        (long) 1, (long) 1, (long) segscan_group_sizze_206862,
                        (long) 1, (long) 1, (int) (0 + (shared_sizze_237147 +
                                                        (8 -
                                                         shared_sizze_237147 %
                                                         8) % 8)));
                time_start_237145 = get_wall_time();
            }
            
            cudaEvent_t *pevents = NULL;
            
            if (ctx->profiling && !ctx->profiling_paused) {
                pevents = cuda_get_events(&ctx->cuda,
                                          &ctx->mainzisegscan_206867_runs,
                                          &ctx->mainzisegscan_206867_total_runtime);
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
            }
            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegscan_206867,
                                                  grid[0], grid[1], grid[2],
                                                  segscan_group_sizze_206862, 1,
                                                  1, 0 + (shared_sizze_237147 +
                                                          (8 -
                                                           shared_sizze_237147 %
                                                           8) % 8), NULL,
                                                  kernel_args_237144, NULL));
            if (pevents != NULL)
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
            if (ctx->debugging) {
                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                time_end_237146 = get_wall_time();
                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                        "main.segscan_206867", time_end_237146 -
                        time_start_237145);
            }
        }
        ctx->failure_is_an_option = 1;
        if (memblock_unref_device(ctx, &incprefixes_mem_232259,
                                  "incprefixes_mem_232259") != 0)
            return 1;
        if (memblock_unref_device(ctx, &aggregates_mem_232257,
                                  "aggregates_mem_232257") != 0)
            return 1;
        if (memblock_unref_device(ctx, &status_flags_mem_232255,
                                  "status_flags_mem_232255") != 0)
            return 1;
    }
    if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
        return 1;
    
    int64_t last_index_203575 = m_203489 - (int64_t) 1;
    bool is_empty_203576 = m_203489 == (int64_t) 0;
    int64_t partition_sizze_203577;
    
    if (is_empty_203576) {
        partition_sizze_203577 = (int64_t) 0;
    } else {
        int64_t last_offset_203578;
        int64_t read_res_237157;
        
        {
            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_237157,
                                                mem_229152.mem +
                                                last_index_203575 *
                                                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_203578 = read_res_237157;
        partition_sizze_203577 = last_offset_203578;
    }
    
    int64_t bytes_229160 = smax64((int64_t) 0, bytes_229147);
    struct memblock_device mem_229161;
    
    mem_229161.references = NULL;
    if (memblock_alloc_device(ctx, &mem_229161, bytes_229160, "mem_229161")) {
        err = 1;
        goto cleanup;
    }
    
    struct memblock_device mem_229164;
    
    mem_229164.references = NULL;
    if (memblock_alloc_device(ctx, &mem_229164, bytes_229151, "mem_229164")) {
        err = 1;
        goto cleanup;
    }
    
    int64_t segmap_group_sizze_206872;
    
    segmap_group_sizze_206872 =
        *ctx->tuning_params.mainzisegmap_group_sizze_206871;
    
    int64_t num_groups_206874;
    int32_t max_num_groups_232360;
    
    max_num_groups_232360 = *ctx->tuning_params.mainzisegmap_num_groups_206873;
    num_groups_206874 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(m_203489,
                                                             segmap_group_sizze_206872),
                                                   sext_i32_i64(max_num_groups_232360))));
    if (ctx->debugging)
        fprintf(ctx->log, "%s\n", "\n# SegMap");
    
    CUdeviceptr kernel_arg_237161 = mem_229148.mem;
    CUdeviceptr kernel_arg_237162 = mem_229152.mem;
    CUdeviceptr kernel_arg_237163 = mem_229155.mem;
    CUdeviceptr kernel_arg_237164 = mem_229161.mem;
    CUdeviceptr kernel_arg_237165 = mem_229164.mem;
    
    if ((((((1 && num_groups_206874 != 0) && 1 != 0) && 1 != 0) &&
          segmap_group_sizze_206872 != 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_206874;
        grid[perm[1]] = 1;
        grid[perm[2]] = 1;
        
        void *kernel_args_237158[] = {&ctx->global_failure, &m_203489,
                                      &n_203490, &num_groups_206874,
                                      &kernel_arg_237161, &kernel_arg_237162,
                                      &kernel_arg_237163, &kernel_arg_237164,
                                      &kernel_arg_237165};
        int64_t time_start_237159 = 0, time_end_237160 = 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_206869", (long) num_groups_206874, (long) 1,
                    (long) 1, (long) segmap_group_sizze_206872, (long) 1,
                    (long) 1, (int) 0);
            time_start_237159 = get_wall_time();
        }
        
        cudaEvent_t *pevents = NULL;
        
        if (ctx->profiling && !ctx->profiling_paused) {
            pevents = cuda_get_events(&ctx->cuda,
                                      &ctx->mainzisegmap_206869_runs,
                                      &ctx->mainzisegmap_206869_total_runtime);
            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
        }
        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_206869, grid[0],
                                              grid[1], grid[2],
                                              segmap_group_sizze_206872, 1, 1,
                                              0, NULL, kernel_args_237158,
                                              NULL));
        if (pevents != NULL)
            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
        if (ctx->debugging) {
            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
            time_end_237160 = get_wall_time();
            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                    "main.segmap_206869", time_end_237160 - time_start_237159);
        }
    }
    if (ctx->debugging)
        fprintf(ctx->log, "%s\n", "");
    if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
        return 1;
    
    bool empty_slice_203591 = partition_sizze_203577 == (int64_t) 0;
    int64_t m_203592 = sub64(partition_sizze_203577, (int64_t) 1);
    bool zzero_leq_i_p_m_t_s_203593 = sle64((int64_t) 0, m_203592);
    bool i_p_m_t_s_leq_w_203594 = slt64(m_203592, m_203489);
    bool i_lte_j_203595 = sle64((int64_t) 0, partition_sizze_203577);
    bool y_203596 = zzero_leq_i_p_m_t_s_203593 && i_p_m_t_s_leq_w_203594;
    bool y_203597 = i_lte_j_203595 && y_203596;
    bool ok_or_empty_203598 = empty_slice_203591 || y_203597;
    bool index_certs_203599;
    
    if (!ok_or_empty_203598) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Index [:", (long long) partition_sizze_203577,
                               "] out of bounds for array of shape [",
                               (long long) m_203489, "].",
                               "-> #0  /prelude/soacs.fut:163:6-16\n   #1  stl.fut:412:7-66\n   #2  stl.fut:455:3-469:34\n   #3  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool assert_cond_203602 = sle64((int64_t) 4, n_p_203492);
    bool assert_c_203603;
    
    if (!assert_cond_203602) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (n_p >= 4)",
                               "-> #0  stl.fut:69:13-33\n   #1  stl.fut:415:61-429:75\n   #2  stl.fut:455:3-469:34\n   #3  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t x_203604 = smod64(q_t_203494, (int64_t) 2);
    bool assert_cond_203605 = x_203604 == (int64_t) 1;
    bool assert_c_203606;
    
    if (!assert_cond_203605) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x % 2 == 1)",
                               "-> #0  utils.fut:20:3-23\n   #1  /prelude/functional.fut:39:62-64\n   #2  stl.fut:71:13-25\n   #3  stl.fut:415:61-429:75\n   #4  stl.fut:455:3-469:34\n   #5  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool assert_cond_203607 = slt64((int64_t) 0, q_t_203494);
    bool assert_c_203608;
    
    if (!assert_cond_203607) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x > 0)",
                               "-> #0  utils.fut:17:3-18\n   #1  /prelude/functional.fut:39:59-65\n   #2  stl.fut:71:13-25\n   #3  stl.fut:415:61-429:75\n   #4  stl.fut:455:3-469:34\n   #5  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t x_203609 = smod64(q_l_203495, (int64_t) 2);
    bool assert_cond_203610 = x_203609 == (int64_t) 1;
    bool assert_c_203611;
    
    if (!assert_cond_203610) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x % 2 == 1)",
                               "-> #0  utils.fut:20:3-23\n   #1  /prelude/functional.fut:39:62-64\n   #2  stl.fut:72:13-25\n   #3  stl.fut:415:61-429:75\n   #4  stl.fut:455:3-469:34\n   #5  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool assert_cond_203612 = slt64((int64_t) 0, q_l_203495);
    bool assert_c_203613;
    
    if (!assert_cond_203612) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x > 0)",
                               "-> #0  utils.fut:17:3-18\n   #1  /prelude/functional.fut:39:59-65\n   #2  stl.fut:72:13-25\n   #3  stl.fut:415:61-429:75\n   #4  stl.fut:455:3-469:34\n   #5  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool cond_203614 = sle64((int64_t) 0, d_t_203497);
    bool assert_cond_t_res_203615 = sle64(d_t_203497, (int64_t) 2);
    bool x_203616 = cond_203614 && assert_cond_t_res_203615;
    bool assert_c_203617;
    
    if (!x_203616) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x >= 0 && x <= 2)",
                               "-> #0  utils.fut:23:3-29\n   #1  stl.fut:74:13-25\n   #2  stl.fut:415:61-429:75\n   #3  stl.fut:455:3-469:34\n   #4  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool cond_203618 = sle64((int64_t) 0, d_l_203498);
    bool assert_cond_t_res_203619 = sle64(d_l_203498, (int64_t) 2);
    bool x_203620 = cond_203618 && assert_cond_t_res_203619;
    bool assert_c_203621;
    
    if (!x_203620) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x >= 0 && x <= 2)",
                               "-> #0  utils.fut:23:3-29\n   #1  stl.fut:75:13-25\n   #2  stl.fut:415:61-429:75\n   #3  stl.fut:455:3-469:34\n   #4  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool assert_cond_203622 = slt64((int64_t) 0, jump_t_203500);
    bool assert_c_203623;
    
    if (!assert_cond_203622) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x > 0)",
                               "-> #0  utils.fut:17:3-18\n   #1  stl.fut:77:16-31\n   #2  stl.fut:415:61-429:75\n   #3  stl.fut:455:3-469:34\n   #4  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool assert_cond_203624 = slt64((int64_t) 0, jump_l_203501);
    bool assert_c_203625;
    
    if (!assert_cond_203624) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x > 0)",
                               "-> #0  utils.fut:17:3-18\n   #1  stl.fut:78:16-31\n   #2  stl.fut:415:61-429:75\n   #3  stl.fut:455:3-469:34\n   #4  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool assert_cond_203626 = slt64((int64_t) 0, n_inner_203502);
    bool assert_c_203627;
    
    if (!assert_cond_203626) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x > 0)",
                               "-> #0  utils.fut:17:3-18\n   #1  stl.fut:80:17-33\n   #2  stl.fut:415:61-429:75\n   #3  stl.fut:455:3-469:34\n   #4  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool assert_cond_203628 = slt64((int64_t) 0, n_outer_203503);
    bool assert_c_203629;
    
    if (!assert_cond_203628) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x > 0)",
                               "-> #0  utils.fut:17:3-18\n   #1  stl.fut:81:17-33\n   #2  stl.fut:415:61-429:75\n   #3  stl.fut:455:3-469:34\n   #4  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    double ceil_res_203630;
    
    ceil_res_203630 = futrts_ceil64(ceil_arg_203508);
    
    int64_t defunc_0_f_res_203631 = fptosi_f64_i64(ceil_res_203630);
    int64_t pad_css_len_203632 = add64((int64_t) 2, defunc_0_f_res_203631);
    int64_t y_203633 = mul64((int64_t) 2, n_p_203492);
    int64_t C_len_203634 = add64(n_203490, y_203633);
    bool cond_203635 = jump_s_203499 == (int64_t) 1;
    int64_t s_n_m_203636;
    
    if (cond_203635) {
        s_n_m_203636 = pad_css_len_203632;
    } else {
        bool zzero_203637 = jump_s_203499 == (int64_t) 0;
        bool nonzzero_203638 = !zzero_203637;
        bool nonzzero_cert_203639;
        
        if (!nonzzero_203638) {
            ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                                   "division by zero",
                                   "-> #0  stl.fut:88:52-71\n   #1  stl.fut:415:61-429:75\n   #2  stl.fut:455:3-469:34\n   #3  stl.fut:439:1-469:34\n");
            if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") !=
                0)
                return 1;
            err = 1;
            goto cleanup;
        }
        
        int64_t x_203640 = sdiv64(defunc_0_f_res_203631, jump_s_203499);
        int64_t s_n_m_f_res_203641 = add64((int64_t) 3, x_203640);
        
        s_n_m_203636 = s_n_m_f_res_203641;
    }
    
    bool cond_203642 = jump_l_203501 == (int64_t) 1;
    int64_t l_n_m_203643;
    
    if (cond_203642) {
        l_n_m_203643 = n_203490;
    } else {
        bool zzero_203644 = jump_l_203501 == (int64_t) 0;
        bool nonzzero_203645 = !zzero_203644;
        bool nonzzero_cert_203646;
        
        if (!nonzzero_203645) {
            ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                                   "division by zero",
                                   "-> #0  stl.fut:94:42-51\n   #1  stl.fut:415:61-429:75\n   #2  stl.fut:455:3-469:34\n   #3  stl.fut:439:1-469:34\n");
            if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") !=
                0)
                return 1;
            err = 1;
            goto cleanup;
        }
        
        int64_t x_203647 = sdiv64(n_203490, jump_l_203501);
        int64_t l_n_m_f_res_203648 = add64((int64_t) 1, x_203647);
        
        l_n_m_203643 = l_n_m_f_res_203648;
    }
    
    bool cond_203649 = jump_t_203500 == (int64_t) 1;
    int64_t t_n_m_203650;
    
    if (cond_203649) {
        t_n_m_203650 = n_203490;
    } else {
        bool zzero_203651 = jump_t_203500 == (int64_t) 0;
        bool nonzzero_203652 = !zzero_203651;
        bool nonzzero_cert_203653;
        
        if (!nonzzero_203652) {
            ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                                   "division by zero",
                                   "-> #0  stl.fut:98:42-51\n   #1  stl.fut:415:61-429:75\n   #2  stl.fut:455:3-469:34\n   #3  stl.fut:439:1-469:34\n");
            if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") !=
                0)
                return 1;
            err = 1;
            goto cleanup;
        }
        
        int64_t x_203654 = sdiv64(n_203490, jump_t_203500);
        int64_t t_n_m_f_res_203655 = add64((int64_t) 1, x_203654);
        
        t_n_m_203650 = t_n_m_f_res_203655;
    }
    
    double x_203656 = i64_res_203506 / 2.0;
    double floor_arg_203657 = 1.0 + x_203656;
    double floor_res_203658;
    
    floor_res_203658 = futrts_floor64(floor_arg_203657);
    
    int64_t defunc_0_f_res_203659 = fptosi_f64_i64(floor_res_203658);
    int64_t x_203660 = sub64(n_203490, defunc_0_f_res_203659);
    int64_t mid2_203661 = add64((int64_t) 1, x_203660);
    bool cond_203662 = defunc_0_f_res_203659 == mid2_203661;
    int64_t stl_res_t_res_203663 = sub64(defunc_0_f_res_203659, (int64_t) 1);
    int64_t stl_res_203664;
    int64_t stl_res_203665;
    
    if (cond_203662) {
        stl_res_203664 = stl_res_t_res_203663;
        stl_res_203665 = defunc_0_f_res_203659;
    } else {
        int64_t min_res_203666 = smin64(defunc_0_f_res_203659, mid2_203661);
        int64_t stl_res_f_res_203667 = sub64(min_res_203666, (int64_t) 1);
        int64_t max_res_203668 = smax64(defunc_0_f_res_203659, mid2_203661);
        
        stl_res_203664 = stl_res_f_res_203667;
        stl_res_203665 = max_res_203668;
    }
    
    int64_t i_203670 = sub64(n_203490, (int64_t) 1);
    bool x_203671 = sle64((int64_t) 0, i_203670);
    bool y_203672 = slt64(i_203670, n_203490);
    bool bounds_check_203673 = x_203671 && y_203672;
    bool index_certs_203674;
    
    if (!bounds_check_203673) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Index [", (long long) i_203670,
                               "] out of bounds for array of shape [",
                               (long long) n_203490, "].",
                               "-> #0  /prelude/array.fut:26:29-34\n   #1  utils.fut:45:13-20\n   #2  stl.fut:112:31-49\n   #3  stl.fut:415:61-429:75\n   #4  stl.fut:455:3-469:34\n   #5  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t max_group_sizze_206887;
    
    max_group_sizze_206887 = ctx->cuda.max_block_size;
    
    bool fits_206888 = sle64(n_203490, max_group_sizze_206887);
    bool suff_intra_par_206886;
    
    suff_intra_par_206886 = *ctx->tuning_params.mainzisuff_intra_par_0 <=
        n_203490;
    if (ctx->logging)
        fprintf(ctx->log, "Compared %s <= %ld: %s.\n", "main.suff_intra_par_0",
                (long) n_203490, suff_intra_par_206886 ? "true" : "false");
    
    bool intra_suff_and_fits_206889 = suff_intra_par_206886 && fits_206888;
    int64_t nest_sizze_207000 = n_203490 * partition_sizze_203577;
    int64_t segscan_group_sizze_207001;
    
    segscan_group_sizze_207001 =
        *ctx->tuning_params.mainzisegscan_group_sizze_206981;
    
    int64_t num_groups_207002;
    int32_t max_num_groups_232374;
    
    max_num_groups_232374 = *ctx->tuning_params.mainzisegscan_num_groups_206983;
    num_groups_207002 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(nest_sizze_207000,
                                                             segscan_group_sizze_207001),
                                                   sext_i32_i64(max_num_groups_232374))));
    
    int64_t segmap_group_sizze_207040;
    
    segmap_group_sizze_207040 =
        *ctx->tuning_params.mainzisegmap_group_sizze_206925;
    
    int64_t binop_y_229176 = (int64_t) 8 * nest_sizze_207000;
    int64_t bytes_229177 = smax64((int64_t) 0, binop_y_229176);
    int64_t binop_y_229179 = (int64_t) 8 * partition_sizze_203577;
    int64_t bytes_229180 = smax64((int64_t) 0, binop_y_229179);
    int64_t binop_y_229168 = (int64_t) 8 * n_203490;
    int64_t bytes_229169 = smax64((int64_t) 0, binop_y_229168);
    struct memblock_device ext_mem_229197;
    
    ext_mem_229197.references = NULL;
    
    struct memblock_device ext_mem_229196;
    
    ext_mem_229196.references = NULL;
    
    int32_t local_memory_capacity_232534;
    
    local_memory_capacity_232534 = ctx->cuda.max_shared_memory;
    if (sle64(bytes_229169 + srem64((int64_t) 8 - srem64(bytes_229169,
                                                         (int64_t) 8),
                                    (int64_t) 8) + (bytes_229169 +
                                                    srem64((int64_t) 8 -
                                                           srem64(bytes_229169,
                                                                  (int64_t) 8),
                                                           (int64_t) 8)),
              sext_i32_i64(local_memory_capacity_232534)) &&
        intra_suff_and_fits_206889) {
        struct memblock_device mem_229178;
        
        mem_229178.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229178, bytes_229177,
                                  "mem_229178")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_229181;
        
        mem_229181.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229181, bytes_229180,
                                  "mem_229181")) {
            err = 1;
            goto cleanup;
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegMap");
        
        unsigned int shared_sizze_237169 = bytes_229169;
        unsigned int shared_sizze_237171 = bytes_229169;
        CUdeviceptr kernel_arg_237173 = mem_229161.mem;
        CUdeviceptr kernel_arg_237174 = mem_229178.mem;
        CUdeviceptr kernel_arg_237175 = mem_229181.mem;
        unsigned int shared_offset_237170 = 0;
        unsigned int shared_offset_237172 = 0 + (shared_sizze_237169 + (8 -
                                                                        shared_sizze_237169 %
                                                                        8) % 8);
        
        if ((((((1 && partition_sizze_203577 != 0) && 1 != 0) && 1 != 0) &&
              n_203490 != 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_203577;
            grid[perm[1]] = 1;
            grid[perm[2]] = 1;
            
            void *kernel_args_237166[] = {&ctx->global_failure,
                                          &shared_offset_237170,
                                          &shared_offset_237172, &n_203490,
                                          &partition_sizze_203577, &i_203670,
                                          &kernel_arg_237173,
                                          &kernel_arg_237174,
                                          &kernel_arg_237175};
            int64_t time_start_237167 = 0, time_end_237168 = 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_206893",
                        (long) partition_sizze_203577, (long) 1, (long) 1,
                        (long) n_203490, (long) 1, (long) 1, (int) (0 +
                                                                    (shared_sizze_237169 +
                                                                     (8 -
                                                                      shared_sizze_237169 %
                                                                      8) % 8) +
                                                                    (shared_sizze_237171 +
                                                                     (8 -
                                                                      shared_sizze_237171 %
                                                                      8) % 8)));
                time_start_237167 = get_wall_time();
            }
            
            cudaEvent_t *pevents = NULL;
            
            if (ctx->profiling && !ctx->profiling_paused) {
                pevents = cuda_get_events(&ctx->cuda,
                                          &ctx->mainzisegmap_intragroup_206893_runs,
                                          &ctx->mainzisegmap_intragroup_206893_total_runtime);
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
            }
            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_intragroup_206893,
                                                  grid[0], grid[1], grid[2],
                                                  n_203490, 1, 1, 0 +
                                                  (shared_sizze_237169 + (8 -
                                                                          shared_sizze_237169 %
                                                                          8) %
                                                   8) + (shared_sizze_237171 +
                                                         (8 -
                                                          shared_sizze_237171 %
                                                          8) % 8), NULL,
                                                  kernel_args_237166, NULL));
            if (pevents != NULL)
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
            if (ctx->debugging) {
                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                time_end_237168 = get_wall_time();
                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                        "main.segmap_intragroup_206893", time_end_237168 -
                        time_start_237167);
            }
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "");
        if (memblock_set_device(ctx, &ext_mem_229197, &mem_229178,
                                "mem_229178") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_229196, &mem_229181,
                                "mem_229181") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229181, "mem_229181") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229178, "mem_229178") != 0)
            return 1;
    } else {
        struct memblock_device mem_229186;
        
        mem_229186.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229186, bytes_229177,
                                  "mem_229186")) {
            err = 1;
            goto cleanup;
        }
        if (slt64((int64_t) 0, partition_sizze_203577 * n_203490)) {
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegScan");
            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_232400 = sdiv_up64(partition_sizze_203577 *
                                                  n_203490,
                                                  segscan_group_sizze_207001 *
                                                  (int64_t) 11) *
                    segscan_group_sizze_207001;
            int64_t numGroups_232401 = sdiv_up64(partition_sizze_203577 *
                                                 n_203490,
                                                 segscan_group_sizze_207001 *
                                                 (int64_t) 11);
            struct memblock_device mainziid_counter_mem_232402 =
                                   ctx->mainziid_counter_mem_232402;
            struct memblock_device status_flags_mem_232404;
            
            status_flags_mem_232404.references = NULL;
            if (memblock_alloc_device(ctx, &status_flags_mem_232404,
                                      numGroups_232401,
                                      "status_flags_mem_232404")) {
                err = 1;
                goto cleanup;
            }
            
            struct memblock_device aggregates_mem_232406;
            
            aggregates_mem_232406.references = NULL;
            if (memblock_alloc_device(ctx, &aggregates_mem_232406, (int64_t) 8 *
                                      numGroups_232401,
                                      "aggregates_mem_232406")) {
                err = 1;
                goto cleanup;
            }
            
            struct memblock_device incprefixes_mem_232408;
            
            incprefixes_mem_232408.references = NULL;
            if (memblock_alloc_device(ctx, &incprefixes_mem_232408,
                                      (int64_t) 8 * numGroups_232401,
                                      "incprefixes_mem_232408")) {
                err = 1;
                goto cleanup;
            }
            if (futrts_builtinzhreplicate_i8(ctx, status_flags_mem_232404,
                                             numGroups_232401, (int8_t) 0) !=
                0) {
                if (memblock_unref_device(ctx, &incprefixes_mem_232408,
                                          "incprefixes_mem_232408") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &aggregates_mem_232406,
                                          "aggregates_mem_232406") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &status_flags_mem_232404,
                                          "status_flags_mem_232404") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229186, "mem_229186") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229196,
                                          "ext_mem_229196") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229197,
                                          "ext_mem_229197") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_out_232249,
                                          "mem_out_232249") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_out_232248,
                                          "mem_out_232248") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_out_232247,
                                          "mem_out_232247") != 0)
                    return 1;
                err = 1;
                goto cleanup;
            }
            
            unsigned int shared_sizze_237180 = smax64(smax64((int64_t) 288,
                                                             (int64_t) 8 *
                                                             segscan_group_sizze_207001),
                                                      (int64_t) 11 *
                                                      segscan_group_sizze_207001 *
                                                      (int64_t) 8);
            CUdeviceptr kernel_arg_237182 = mem_229161.mem;
            CUdeviceptr kernel_arg_237183 = mem_229186.mem;
            CUdeviceptr kernel_arg_237184 = mainziid_counter_mem_232402.mem;
            CUdeviceptr kernel_arg_237185 = status_flags_mem_232404.mem;
            CUdeviceptr kernel_arg_237186 = aggregates_mem_232406.mem;
            CUdeviceptr kernel_arg_237187 = incprefixes_mem_232408.mem;
            unsigned int shared_offset_237181 = 0;
            
            if ((((((1 && sdiv_up64(partition_sizze_203577 * n_203490,
                                    segscan_group_sizze_207001 *
                                    (int64_t) 11) != 0) && 1 != 0) && 1 != 0) &&
                  segscan_group_sizze_207001 != 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_203577 * n_203490,
                                          segscan_group_sizze_207001 *
                                          (int64_t) 11);
                grid[perm[1]] = 1;
                grid[perm[2]] = 1;
                
                void *kernel_args_237177[] = {&ctx->global_failure,
                                              &shared_offset_237181, &n_203490,
                                              &partition_sizze_203577,
                                              &kernel_arg_237182,
                                              &kernel_arg_237183,
                                              &kernel_arg_237184,
                                              &kernel_arg_237185,
                                              &kernel_arg_237186,
                                              &kernel_arg_237187};
                int64_t time_start_237178 = 0, time_end_237179 = 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_207007",
                            (long) sdiv_up64(partition_sizze_203577 * n_203490,
                                             segscan_group_sizze_207001 *
                                             (int64_t) 11), (long) 1, (long) 1,
                            (long) segscan_group_sizze_207001, (long) 1,
                            (long) 1, (int) (0 + (shared_sizze_237180 + (8 -
                                                                         shared_sizze_237180 %
                                                                         8) %
                                                  8)));
                    time_start_237178 = get_wall_time();
                }
                
                cudaEvent_t *pevents = NULL;
                
                if (ctx->profiling && !ctx->profiling_paused) {
                    pevents = cuda_get_events(&ctx->cuda,
                                              &ctx->mainzisegscan_207007_runs,
                                              &ctx->mainzisegscan_207007_total_runtime);
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                }
                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegscan_207007,
                                                      grid[0], grid[1], grid[2],
                                                      segscan_group_sizze_207001,
                                                      1, 1, 0 +
                                                      (shared_sizze_237180 +
                                                       (8 -
                                                        shared_sizze_237180 %
                                                        8) % 8), NULL,
                                                      kernel_args_237177,
                                                      NULL));
                if (pevents != NULL)
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                if (ctx->debugging) {
                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                    time_end_237179 = get_wall_time();
                    fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                            "main.segscan_207007", time_end_237179 -
                            time_start_237178);
                }
            }
            if (memblock_unref_device(ctx, &incprefixes_mem_232408,
                                      "incprefixes_mem_232408") != 0)
                return 1;
            if (memblock_unref_device(ctx, &aggregates_mem_232406,
                                      "aggregates_mem_232406") != 0)
                return 1;
            if (memblock_unref_device(ctx, &status_flags_mem_232404,
                                      "status_flags_mem_232404") != 0)
                return 1;
        }
        
        struct memblock_device mem_229190;
        
        mem_229190.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229190, bytes_229177,
                                  "mem_229190")) {
            err = 1;
            goto cleanup;
        }
        if (futrts_builtinzhreplicate_i64(ctx, mem_229190,
                                          partition_sizze_203577 * n_203490,
                                          (int64_t) -1) != 0) {
            if (memblock_unref_device(ctx, &mem_229190, "mem_229190") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229186, "mem_229186") != 0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_229196, "ext_mem_229196") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_229197, "ext_mem_229197") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") !=
                0)
                return 1;
            err = 1;
            goto cleanup;
        }
        
        int64_t segmap_usable_groups_207041 = sdiv_up64(nest_sizze_207000,
                                                        segmap_group_sizze_207040);
        
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegMap");
        
        CUdeviceptr kernel_arg_237191 = mem_229161.mem;
        CUdeviceptr kernel_arg_237192 = mem_229186.mem;
        CUdeviceptr kernel_arg_237193 = mem_229190.mem;
        
        if ((((((1 && segmap_usable_groups_207041 != 0) && 1 != 0) && 1 != 0) &&
              segmap_group_sizze_207040 != 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_207041;
            grid[perm[1]] = 1;
            grid[perm[2]] = 1;
            
            void *kernel_args_237188[] = {&ctx->global_failure, &n_203490,
                                          &partition_sizze_203577,
                                          &kernel_arg_237191,
                                          &kernel_arg_237192,
                                          &kernel_arg_237193};
            int64_t time_start_237189 = 0, time_end_237190 = 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_207045",
                        (long) segmap_usable_groups_207041, (long) 1, (long) 1,
                        (long) segmap_group_sizze_207040, (long) 1, (long) 1,
                        (int) 0);
                time_start_237189 = get_wall_time();
            }
            
            cudaEvent_t *pevents = NULL;
            
            if (ctx->profiling && !ctx->profiling_paused) {
                pevents = cuda_get_events(&ctx->cuda,
                                          &ctx->mainzisegmap_207045_runs,
                                          &ctx->mainzisegmap_207045_total_runtime);
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
            }
            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_207045,
                                                  grid[0], grid[1], grid[2],
                                                  segmap_group_sizze_207040, 1,
                                                  1, 0, NULL,
                                                  kernel_args_237188, NULL));
            if (pevents != NULL)
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
            if (ctx->debugging) {
                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                time_end_237190 = get_wall_time();
                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                        "main.segmap_207045", time_end_237190 -
                        time_start_237189);
            }
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "");
        
        struct memblock_device mem_229194;
        
        mem_229194.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229194, bytes_229180,
                                  "mem_229194")) {
            err = 1;
            goto cleanup;
        }
        
        int64_t group_sizze_232528;
        
        group_sizze_232528 = *ctx->tuning_params.mainzigroup_sizze_232528;
        
        int64_t num_groups_232529 = sdiv_up64(partition_sizze_203577,
                                              group_sizze_232528);
        CUdeviceptr kernel_arg_237197 = mem_229186.mem;
        CUdeviceptr kernel_arg_237198 = mem_229194.mem;
        
        if ((((((1 && num_groups_232529 != 0) && 1 != 0) && 1 != 0) &&
              group_sizze_232528 != 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_232529;
            grid[perm[1]] = 1;
            grid[perm[2]] = 1;
            
            void *kernel_args_237194[] = {&n_203490, &partition_sizze_203577,
                                          &i_203670, &kernel_arg_237197,
                                          &kernel_arg_237198};
            int64_t time_start_237195 = 0, time_end_237196 = 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_232525", (long) num_groups_232529, (long) 1,
                        (long) 1, (long) group_sizze_232528, (long) 1, (long) 1,
                        (int) 0);
                time_start_237195 = get_wall_time();
            }
            
            cudaEvent_t *pevents = NULL;
            
            if (ctx->profiling && !ctx->profiling_paused) {
                pevents = cuda_get_events(&ctx->cuda,
                                          &ctx->mainzicopy_232525_runs,
                                          &ctx->mainzicopy_232525_total_runtime);
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
            }
            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzicopy_232525,
                                                  grid[0], grid[1], grid[2],
                                                  group_sizze_232528, 1, 1, 0,
                                                  NULL, kernel_args_237194,
                                                  NULL));
            if (pevents != NULL)
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
            if (ctx->debugging) {
                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                time_end_237196 = get_wall_time();
                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                        "main.copy_232525", time_end_237196 -
                        time_start_237195);
            }
        }
        if (memblock_unref_device(ctx, &mem_229186, "mem_229186") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_229197, &mem_229190,
                                "mem_229190") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_229196, &mem_229194,
                                "mem_229194") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229194, "mem_229194") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229190, "mem_229190") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229186, "mem_229186") != 0)
            return 1;
    }
    
    bool bounds_invalid_upwards_203698 = slt64(defunc_0_f_res_203631,
                                               (int64_t) 0);
    bool valid_203699 = !bounds_invalid_upwards_203698;
    bool range_valid_c_203700;
    
    if (!valid_203699) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Range ", (long long) (int64_t) 0, "..",
                               (long long) (int64_t) 1, "..<",
                               (long long) defunc_0_f_res_203631,
                               " is invalid.",
                               "-> #0  /prelude/array.fut:90:3-10\n   #1  /prelude/array.fut:195:11-16\n   #2  utils.fut:6:3-16\n   #3  stl.fut:119:20-125:36\n   #4  /prelude/soacs.fut:59:3-10\n   #5  /prelude/array.fut:195:3-17\n   #6  utils.fut:6:3-16\n   #7  stl.fut:117:12-126:20\n   #8  stl.fut:116:5-127:11\n   #9  stl.fut:415:61-429:75\n   #10 stl.fut:455:3-469:34\n   #11 stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &ext_mem_229196, "ext_mem_229196") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229197, "ext_mem_229197") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t y_207162 = n_p_203492 * defunc_0_f_res_203631;
    int64_t nest_sizze_207163 = partition_sizze_203577 * y_207162;
    int64_t segmap_group_sizze_207164;
    
    segmap_group_sizze_207164 =
        *ctx->tuning_params.mainzisegmap_group_sizze_207082;
    
    int64_t segmap_usable_groups_207165 = sdiv_up64(nest_sizze_207163,
                                                    segmap_group_sizze_207164);
    struct memblock_device mem_229200;
    
    mem_229200.references = NULL;
    if (memblock_alloc_device(ctx, &mem_229200, bytes_229147, "mem_229200")) {
        err = 1;
        goto cleanup;
    }
    {
        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_229200.mem + (int64_t) 0,
                                        mem_229161.mem + (int64_t) 0, m_203489 *
                                        n_203490 * (int64_t) 8));
        if (pevents != NULL)
            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
    }
    
    int64_t binop_x_229202 = n_p_203492 * partition_sizze_203577;
    int64_t binop_x_229203 = defunc_0_f_res_203631 * binop_x_229202;
    int64_t binop_y_229204 = (int64_t) 8 * binop_x_229203;
    int64_t bytes_229205 = smax64((int64_t) 0, binop_y_229204);
    struct memblock_device mem_229206;
    
    mem_229206.references = NULL;
    if (memblock_alloc_device(ctx, &mem_229206, bytes_229205, "mem_229206")) {
        err = 1;
        goto cleanup;
    }
    if (ctx->debugging)
        fprintf(ctx->log, "%s\n", "\n# SegMap");
    
    CUdeviceptr kernel_arg_237202 = mem_229200.mem;
    CUdeviceptr kernel_arg_237203 = mem_229206.mem;
    
    if ((((((1 && segmap_usable_groups_207165 != 0) && 1 != 0) && 1 != 0) &&
          segmap_group_sizze_207164 != 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_207165;
        grid[perm[1]] = 1;
        grid[perm[2]] = 1;
        
        void *kernel_args_237199[] = {&ctx->global_failure,
                                      &ctx->failure_is_an_option,
                                      &ctx->global_failure_args, &n_203490,
                                      &n_p_203492, &partition_sizze_203577,
                                      &defunc_0_f_res_203631, &i_203670,
                                      &kernel_arg_237202, &kernel_arg_237203};
        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",
                    "main.segmap_207170", (long) segmap_usable_groups_207165,
                    (long) 1, (long) 1, (long) segmap_group_sizze_207164,
                    (long) 1, (long) 1, (int) 0);
            time_start_237200 = get_wall_time();
        }
        
        cudaEvent_t *pevents = NULL;
        
        if (ctx->profiling && !ctx->profiling_paused) {
            pevents = cuda_get_events(&ctx->cuda,
                                      &ctx->mainzisegmap_207170_runs,
                                      &ctx->mainzisegmap_207170_total_runtime);
            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
        }
        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_207170, grid[0],
                                              grid[1], grid[2],
                                              segmap_group_sizze_207164, 1, 1,
                                              0, 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",
                    "main.segmap_207170", time_end_237201 - time_start_237200);
        }
    }
    ctx->failure_is_an_option = 1;
    if (ctx->debugging)
        fprintf(ctx->log, "%s\n", "");
    if (memblock_unref_device(ctx, &mem_229200, "mem_229200") != 0)
        return 1;
    
    int64_t i_203718 = sub64(defunc_0_f_res_203631, (int64_t) 1);
    bool x_203719 = sle64((int64_t) 0, i_203718);
    bool y_203720 = slt64(i_203718, defunc_0_f_res_203631);
    bool bounds_check_203721 = x_203719 && y_203720;
    bool index_certs_203722;
    
    if (!bounds_check_203721) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Index [", (long long) i_203718,
                               "] out of bounds for array of shape [",
                               (long long) defunc_0_f_res_203631, "].",
                               "-> #0  /prelude/array.fut:26:29-34\n   #1  utils.fut:45:13-20\n   #2  stl.fut:133:51-67\n   #3  stl.fut:132:12-135:21\n   #4  stl.fut:131:5-136:16\n   #5  stl.fut:415:61-429:75\n   #6  stl.fut:455:3-469:34\n   #7  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229206, "mem_229206") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229200, "mem_229200") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229196, "ext_mem_229196") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229197, "ext_mem_229197") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t y_207235 = smin64(n_p_203492, y_207162);
    int64_t intra_avail_par_207236 = smin64(y_207162, y_207235);
    int64_t computed_group_sizze_207187 = smax64(n_p_203492, y_207162);
    bool fits_207243 = sle64(computed_group_sizze_207187,
                             max_group_sizze_206887);
    bool suff_intra_par_207241;
    
    suff_intra_par_207241 = *ctx->tuning_params.mainzisuff_intra_par_1 <=
        intra_avail_par_207236;
    if (ctx->logging)
        fprintf(ctx->log, "Compared %s <= %ld: %s.\n", "main.suff_intra_par_1",
                (long) intra_avail_par_207236,
                suff_intra_par_207241 ? "true" : "false");
    
    bool intra_suff_and_fits_207244 = suff_intra_par_207241 && fits_207243;
    bool fits_207514 = sle64(defunc_0_f_res_203631, max_group_sizze_206887);
    bool suff_intra_par_207516;
    
    suff_intra_par_207516 = *ctx->tuning_params.mainzisuff_intra_par_2 <=
        defunc_0_f_res_203631;
    if (ctx->logging)
        fprintf(ctx->log, "Compared %s <= %ld: %s.\n", "main.suff_intra_par_2",
                (long) defunc_0_f_res_203631,
                suff_intra_par_207516 ? "true" : "false");
    
    bool intra_suff_and_fits_207517 = fits_207514 && suff_intra_par_207516;
    int64_t segscan_group_sizze_207552;
    
    segscan_group_sizze_207552 =
        *ctx->tuning_params.mainzisegscan_group_sizze_207419;
    
    int64_t num_groups_207553;
    int32_t max_num_groups_232547;
    
    max_num_groups_232547 = *ctx->tuning_params.mainzisegscan_num_groups_207421;
    num_groups_207553 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(binop_x_229203,
                                                             segscan_group_sizze_207552),
                                                   sext_i32_i64(max_num_groups_232547))));
    
    int64_t segmap_group_sizze_207599;
    
    segmap_group_sizze_207599 =
        *ctx->tuning_params.mainzisegmap_group_sizze_207350;
    
    int64_t binop_y_229224 = (int64_t) 8 * binop_x_229202;
    int64_t bytes_229225 = smax64((int64_t) 0, binop_y_229224);
    int64_t binop_y_229210 = (int64_t) 8 * y_207162;
    int64_t bytes_229211 = smax64((int64_t) 0, binop_y_229210);
    int64_t binop_y_229229 = (int64_t) 8 * defunc_0_f_res_203631;
    int64_t bytes_229230 = smax64((int64_t) 0, binop_y_229229);
    struct memblock_device ext_mem_229265;
    
    ext_mem_229265.references = NULL;
    
    struct memblock_device ext_mem_229264;
    
    ext_mem_229264.references = NULL;
    
    int32_t local_memory_capacity_232739;
    
    local_memory_capacity_232739 = ctx->cuda.max_shared_memory;
    if (sle64(bytes_229211 + srem64((int64_t) 8 - srem64(bytes_229211,
                                                         (int64_t) 8),
                                    (int64_t) 8) + (bytes_229211 +
                                                    srem64((int64_t) 8 -
                                                           srem64(bytes_229211,
                                                                  (int64_t) 8),
                                                           (int64_t) 8)),
              sext_i32_i64(local_memory_capacity_232739)) &&
        intra_suff_and_fits_207244) {
        struct memblock_device mem_229222;
        
        mem_229222.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229222, bytes_229205,
                                  "mem_229222")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_229226;
        
        mem_229226.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229226, bytes_229225,
                                  "mem_229226")) {
            err = 1;
            goto cleanup;
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegMap");
        
        unsigned int shared_sizze_237207 = bytes_229211;
        unsigned int shared_sizze_237209 = bytes_229211;
        CUdeviceptr kernel_arg_237211 = mem_229206.mem;
        CUdeviceptr kernel_arg_237212 = mem_229222.mem;
        CUdeviceptr kernel_arg_237213 = mem_229226.mem;
        unsigned int shared_offset_237208 = 0;
        unsigned int shared_offset_237210 = 0 + (shared_sizze_237207 + (8 -
                                                                        shared_sizze_237207 %
                                                                        8) % 8);
        
        if ((((((1 && partition_sizze_203577 != 0) && 1 != 0) && 1 != 0) &&
              computed_group_sizze_207187 != 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_203577;
            grid[perm[1]] = 1;
            grid[perm[2]] = 1;
            
            void *kernel_args_237204[] = {&ctx->global_failure,
                                          &shared_offset_237208,
                                          &shared_offset_237210, &n_p_203492,
                                          &partition_sizze_203577,
                                          &defunc_0_f_res_203631, &i_203718,
                                          &computed_group_sizze_207187,
                                          &kernel_arg_237211,
                                          &kernel_arg_237212,
                                          &kernel_arg_237213};
            int64_t time_start_237205 = 0, time_end_237206 = 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_207248",
                        (long) partition_sizze_203577, (long) 1, (long) 1,
                        (long) computed_group_sizze_207187, (long) 1, (long) 1,
                        (int) (0 + (shared_sizze_237207 + (8 -
                                                           shared_sizze_237207 %
                                                           8) % 8) +
                               (shared_sizze_237209 + (8 - shared_sizze_237209 %
                                                       8) % 8)));
                time_start_237205 = get_wall_time();
            }
            
            cudaEvent_t *pevents = NULL;
            
            if (ctx->profiling && !ctx->profiling_paused) {
                pevents = cuda_get_events(&ctx->cuda,
                                          &ctx->mainzisegmap_intragroup_207248_runs,
                                          &ctx->mainzisegmap_intragroup_207248_total_runtime);
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
            }
            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_intragroup_207248,
                                                  grid[0], grid[1], grid[2],
                                                  computed_group_sizze_207187,
                                                  1, 1, 0 +
                                                  (shared_sizze_237207 + (8 -
                                                                          shared_sizze_237207 %
                                                                          8) %
                                                   8) + (shared_sizze_237209 +
                                                         (8 -
                                                          shared_sizze_237209 %
                                                          8) % 8), NULL,
                                                  kernel_args_237204, NULL));
            if (pevents != NULL)
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
            if (ctx->debugging) {
                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                time_end_237206 = get_wall_time();
                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                        "main.segmap_intragroup_207248", time_end_237206 -
                        time_start_237205);
            }
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "");
        if (memblock_set_device(ctx, &ext_mem_229265, &mem_229222,
                                "mem_229222") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_229264, &mem_229226,
                                "mem_229226") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229226, "mem_229226") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229222, "mem_229222") != 0)
            return 1;
    } else {
        struct memblock_device ext_mem_229263;
        
        ext_mem_229263.references = NULL;
        
        struct memblock_device ext_mem_229262;
        
        ext_mem_229262.references = NULL;
        
        int32_t local_memory_capacity_232738;
        
        local_memory_capacity_232738 = ctx->cuda.max_shared_memory;
        if (sle64(bytes_229230 + srem64((int64_t) 8 - srem64(bytes_229230,
                                                             (int64_t) 8),
                                        (int64_t) 8) + (bytes_229230 +
                                                        srem64((int64_t) 8 -
                                                               srem64(bytes_229230,
                                                                      (int64_t) 8),
                                                               (int64_t) 8)),
                  sext_i32_i64(local_memory_capacity_232738)) &&
            intra_suff_and_fits_207517) {
            struct memblock_device mem_229240;
            
            mem_229240.references = NULL;
            if (memblock_alloc_device(ctx, &mem_229240, bytes_229205,
                                      "mem_229240")) {
                err = 1;
                goto cleanup;
            }
            
            struct memblock_device mem_229244;
            
            mem_229244.references = NULL;
            if (memblock_alloc_device(ctx, &mem_229244, bytes_229225,
                                      "mem_229244")) {
                err = 1;
                goto cleanup;
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            
            unsigned int shared_sizze_237217 = bytes_229230;
            unsigned int shared_sizze_237219 = bytes_229230;
            CUdeviceptr kernel_arg_237221 = mem_229206.mem;
            CUdeviceptr kernel_arg_237222 = mem_229240.mem;
            CUdeviceptr kernel_arg_237223 = mem_229244.mem;
            unsigned int shared_offset_237218 = 0;
            unsigned int shared_offset_237220 = 0 + (shared_sizze_237217 + (8 -
                                                                            shared_sizze_237217 %
                                                                            8) %
                                                     8);
            
            if ((((((1 && binop_x_229202 != 0) && 1 != 0) && 1 != 0) &&
                  defunc_0_f_res_203631 != 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_229202;
                grid[perm[1]] = 1;
                grid[perm[2]] = 1;
                
                void *kernel_args_237214[] = {&ctx->global_failure,
                                              &shared_offset_237218,
                                              &shared_offset_237220,
                                              &n_p_203492,
                                              &partition_sizze_203577,
                                              &defunc_0_f_res_203631, &i_203718,
                                              &kernel_arg_237221,
                                              &kernel_arg_237222,
                                              &kernel_arg_237223};
                int64_t time_start_237215 = 0, time_end_237216 = 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_207524",
                            (long) binop_x_229202, (long) 1, (long) 1,
                            (long) defunc_0_f_res_203631, (long) 1, (long) 1,
                            (int) (0 + (shared_sizze_237217 + (8 -
                                                               shared_sizze_237217 %
                                                               8) % 8) +
                                   (shared_sizze_237219 + (8 -
                                                           shared_sizze_237219 %
                                                           8) % 8)));
                    time_start_237215 = get_wall_time();
                }
                
                cudaEvent_t *pevents = NULL;
                
                if (ctx->profiling && !ctx->profiling_paused) {
                    pevents = cuda_get_events(&ctx->cuda,
                                              &ctx->mainzisegmap_intragroup_207524_runs,
                                              &ctx->mainzisegmap_intragroup_207524_total_runtime);
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                }
                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_intragroup_207524,
                                                      grid[0], grid[1], grid[2],
                                                      defunc_0_f_res_203631, 1,
                                                      1, 0 +
                                                      (shared_sizze_237217 +
                                                       (8 -
                                                        shared_sizze_237217 %
                                                        8) % 8) +
                                                      (shared_sizze_237219 +
                                                       (8 -
                                                        shared_sizze_237219 %
                                                        8) % 8), NULL,
                                                      kernel_args_237214,
                                                      NULL));
                if (pevents != NULL)
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                if (ctx->debugging) {
                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                    time_end_237216 = get_wall_time();
                    fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                            "main.segmap_intragroup_207524", time_end_237216 -
                            time_start_237215);
                }
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            if (memblock_set_device(ctx, &ext_mem_229263, &mem_229240,
                                    "mem_229240") != 0)
                return 1;
            if (memblock_set_device(ctx, &ext_mem_229262, &mem_229244,
                                    "mem_229244") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229244, "mem_229244") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229240, "mem_229240") != 0)
                return 1;
        } else {
            struct memblock_device mem_229250;
            
            mem_229250.references = NULL;
            if (memblock_alloc_device(ctx, &mem_229250, bytes_229205,
                                      "mem_229250")) {
                err = 1;
                goto cleanup;
            }
            if (slt64((int64_t) 0, partition_sizze_203577 * n_p_203492 *
                      defunc_0_f_res_203631)) {
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegScan");
                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_232607 = sdiv_up64(partition_sizze_203577 *
                                                      n_p_203492 *
                                                      defunc_0_f_res_203631,
                                                      segscan_group_sizze_207552 *
                                                      (int64_t) 11) *
                        segscan_group_sizze_207552;
                int64_t numGroups_232608 = sdiv_up64(partition_sizze_203577 *
                                                     n_p_203492 *
                                                     defunc_0_f_res_203631,
                                                     segscan_group_sizze_207552 *
                                                     (int64_t) 11);
                struct memblock_device mainziid_counter_mem_232609 =
                                       ctx->mainziid_counter_mem_232609;
                struct memblock_device status_flags_mem_232611;
                
                status_flags_mem_232611.references = NULL;
                if (memblock_alloc_device(ctx, &status_flags_mem_232611,
                                          numGroups_232608,
                                          "status_flags_mem_232611")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device aggregates_mem_232613;
                
                aggregates_mem_232613.references = NULL;
                if (memblock_alloc_device(ctx, &aggregates_mem_232613,
                                          (int64_t) 8 * numGroups_232608,
                                          "aggregates_mem_232613")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device incprefixes_mem_232615;
                
                incprefixes_mem_232615.references = NULL;
                if (memblock_alloc_device(ctx, &incprefixes_mem_232615,
                                          (int64_t) 8 * numGroups_232608,
                                          "incprefixes_mem_232615")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhreplicate_i8(ctx, status_flags_mem_232611,
                                                 numGroups_232608,
                                                 (int8_t) 0) != 0) {
                    if (memblock_unref_device(ctx, &incprefixes_mem_232615,
                                              "incprefixes_mem_232615") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &aggregates_mem_232613,
                                              "aggregates_mem_232613") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &status_flags_mem_232611,
                                              "status_flags_mem_232611") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229250, "mem_229250") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229262,
                                              "ext_mem_229262") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229263,
                                              "ext_mem_229263") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229264,
                                              "ext_mem_229264") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229265,
                                              "ext_mem_229265") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229206, "mem_229206") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229200, "mem_229200") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229196,
                                              "ext_mem_229196") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229197,
                                              "ext_mem_229197") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229164, "mem_229164") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229161, "mem_229161") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229157, "mem_229157") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229155, "mem_229155") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229152, "mem_229152") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229148, "mem_229148") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232249,
                                              "mem_out_232249") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232248,
                                              "mem_out_232248") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232247,
                                              "mem_out_232247") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                unsigned int shared_sizze_237228 = smax64(smax64((int64_t) 288,
                                                                 (int64_t) 8 *
                                                                 segscan_group_sizze_207552),
                                                          (int64_t) 11 *
                                                          segscan_group_sizze_207552 *
                                                          (int64_t) 8);
                CUdeviceptr kernel_arg_237230 = mem_229206.mem;
                CUdeviceptr kernel_arg_237231 = mem_229250.mem;
                CUdeviceptr kernel_arg_237232 = mainziid_counter_mem_232609.mem;
                CUdeviceptr kernel_arg_237233 = status_flags_mem_232611.mem;
                CUdeviceptr kernel_arg_237234 = aggregates_mem_232613.mem;
                CUdeviceptr kernel_arg_237235 = incprefixes_mem_232615.mem;
                unsigned int shared_offset_237229 = 0;
                
                if ((((((1 && sdiv_up64(partition_sizze_203577 * n_p_203492 *
                                        defunc_0_f_res_203631,
                                        segscan_group_sizze_207552 *
                                        (int64_t) 11) != 0) && 1 != 0) && 1 !=
                       0) && segscan_group_sizze_207552 != 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_203577 *
                                              n_p_203492 *
                                              defunc_0_f_res_203631,
                                              segscan_group_sizze_207552 *
                                              (int64_t) 11);
                    grid[perm[1]] = 1;
                    grid[perm[2]] = 1;
                    
                    void *kernel_args_237225[] = {&ctx->global_failure,
                                                  &shared_offset_237229,
                                                  &n_p_203492,
                                                  &partition_sizze_203577,
                                                  &defunc_0_f_res_203631,
                                                  &kernel_arg_237230,
                                                  &kernel_arg_237231,
                                                  &kernel_arg_237232,
                                                  &kernel_arg_237233,
                                                  &kernel_arg_237234,
                                                  &kernel_arg_237235};
                    int64_t time_start_237226 = 0, time_end_237227 = 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_207559",
                                (long) sdiv_up64(partition_sizze_203577 *
                                                 n_p_203492 *
                                                 defunc_0_f_res_203631,
                                                 segscan_group_sizze_207552 *
                                                 (int64_t) 11), (long) 1,
                                (long) 1, (long) segscan_group_sizze_207552,
                                (long) 1, (long) 1, (int) (0 +
                                                           (shared_sizze_237228 +
                                                            (8 -
                                                             shared_sizze_237228 %
                                                             8) % 8)));
                        time_start_237226 = get_wall_time();
                    }
                    
                    cudaEvent_t *pevents = NULL;
                    
                    if (ctx->profiling && !ctx->profiling_paused) {
                        pevents = cuda_get_events(&ctx->cuda,
                                                  &ctx->mainzisegscan_207559_runs,
                                                  &ctx->mainzisegscan_207559_total_runtime);
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                    }
                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegscan_207559,
                                                          grid[0], grid[1],
                                                          grid[2],
                                                          segscan_group_sizze_207552,
                                                          1, 1, 0 +
                                                          (shared_sizze_237228 +
                                                           (8 -
                                                            shared_sizze_237228 %
                                                            8) % 8), NULL,
                                                          kernel_args_237225,
                                                          NULL));
                    if (pevents != NULL)
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                    if (ctx->debugging) {
                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                        time_end_237227 = get_wall_time();
                        fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                "main.segscan_207559", time_end_237227 -
                                time_start_237226);
                    }
                }
                if (memblock_unref_device(ctx, &incprefixes_mem_232615,
                                          "incprefixes_mem_232615") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &aggregates_mem_232613,
                                          "aggregates_mem_232613") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &status_flags_mem_232611,
                                          "status_flags_mem_232611") != 0)
                    return 1;
            }
            
            struct memblock_device mem_229255;
            
            mem_229255.references = NULL;
            if (memblock_alloc_device(ctx, &mem_229255, bytes_229205,
                                      "mem_229255")) {
                err = 1;
                goto cleanup;
            }
            if (futrts_builtinzhreplicate_i64(ctx, mem_229255,
                                              partition_sizze_203577 *
                                              n_p_203492 *
                                              defunc_0_f_res_203631,
                                              (int64_t) -1) != 0) {
                if (memblock_unref_device(ctx, &mem_229255, "mem_229255") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229250, "mem_229250") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229262,
                                          "ext_mem_229262") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229263,
                                          "ext_mem_229263") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229264,
                                          "ext_mem_229264") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229265,
                                          "ext_mem_229265") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229206, "mem_229206") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229200, "mem_229200") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229196,
                                          "ext_mem_229196") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229197,
                                          "ext_mem_229197") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_out_232249,
                                          "mem_out_232249") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_out_232248,
                                          "mem_out_232248") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_out_232247,
                                          "mem_out_232247") != 0)
                    return 1;
                err = 1;
                goto cleanup;
            }
            
            int64_t segmap_usable_groups_207600 = sdiv_up64(nest_sizze_207163,
                                                            segmap_group_sizze_207599);
            
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            
            CUdeviceptr kernel_arg_237239 = mem_229206.mem;
            CUdeviceptr kernel_arg_237240 = mem_229250.mem;
            CUdeviceptr kernel_arg_237241 = mem_229255.mem;
            
            if ((((((1 && segmap_usable_groups_207600 != 0) && 1 != 0) && 1 !=
                   0) && segmap_group_sizze_207599 != 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_207600;
                grid[perm[1]] = 1;
                grid[perm[2]] = 1;
                
                void *kernel_args_237236[] = {&ctx->global_failure, &n_p_203492,
                                              &partition_sizze_203577,
                                              &defunc_0_f_res_203631,
                                              &kernel_arg_237239,
                                              &kernel_arg_237240,
                                              &kernel_arg_237241};
                int64_t time_start_237237 = 0, time_end_237238 = 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_207605",
                            (long) segmap_usable_groups_207600, (long) 1,
                            (long) 1, (long) segmap_group_sizze_207599,
                            (long) 1, (long) 1, (int) 0);
                    time_start_237237 = get_wall_time();
                }
                
                cudaEvent_t *pevents = NULL;
                
                if (ctx->profiling && !ctx->profiling_paused) {
                    pevents = cuda_get_events(&ctx->cuda,
                                              &ctx->mainzisegmap_207605_runs,
                                              &ctx->mainzisegmap_207605_total_runtime);
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                }
                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_207605,
                                                      grid[0], grid[1], grid[2],
                                                      segmap_group_sizze_207599,
                                                      1, 1, 0, NULL,
                                                      kernel_args_237236,
                                                      NULL));
                if (pevents != NULL)
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                if (ctx->debugging) {
                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                    time_end_237238 = get_wall_time();
                    fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                            "main.segmap_207605", time_end_237238 -
                            time_start_237237);
                }
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            
            struct memblock_device mem_229260;
            
            mem_229260.references = NULL;
            if (memblock_alloc_device(ctx, &mem_229260, bytes_229225,
                                      "mem_229260")) {
                err = 1;
                goto cleanup;
            }
            
            int64_t group_sizze_232729;
            
            group_sizze_232729 = *ctx->tuning_params.mainzigroup_sizze_232729;
            
            int64_t num_groups_232730 = sdiv_up64(partition_sizze_203577 *
                                                  n_p_203492,
                                                  group_sizze_232729);
            CUdeviceptr kernel_arg_237245 = mem_229250.mem;
            CUdeviceptr kernel_arg_237246 = mem_229260.mem;
            
            if ((((((1 && num_groups_232730 != 0) && 1 != 0) && 1 != 0) &&
                  group_sizze_232729 != 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_232730;
                grid[perm[1]] = 1;
                grid[perm[2]] = 1;
                
                void *kernel_args_237242[] = {&n_p_203492,
                                              &partition_sizze_203577,
                                              &defunc_0_f_res_203631, &i_203718,
                                              &kernel_arg_237245,
                                              &kernel_arg_237246};
                int64_t time_start_237243 = 0, time_end_237244 = 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_232726", (long) num_groups_232730,
                            (long) 1, (long) 1, (long) group_sizze_232729,
                            (long) 1, (long) 1, (int) 0);
                    time_start_237243 = get_wall_time();
                }
                
                cudaEvent_t *pevents = NULL;
                
                if (ctx->profiling && !ctx->profiling_paused) {
                    pevents = cuda_get_events(&ctx->cuda,
                                              &ctx->mainzicopy_232726_runs,
                                              &ctx->mainzicopy_232726_total_runtime);
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                }
                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzicopy_232726,
                                                      grid[0], grid[1], grid[2],
                                                      group_sizze_232729, 1, 1,
                                                      0, NULL,
                                                      kernel_args_237242,
                                                      NULL));
                if (pevents != NULL)
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                if (ctx->debugging) {
                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                    time_end_237244 = get_wall_time();
                    fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                            "main.copy_232726", time_end_237244 -
                            time_start_237243);
                }
            }
            if (memblock_unref_device(ctx, &mem_229250, "mem_229250") != 0)
                return 1;
            if (memblock_set_device(ctx, &ext_mem_229263, &mem_229255,
                                    "mem_229255") != 0)
                return 1;
            if (memblock_set_device(ctx, &ext_mem_229262, &mem_229260,
                                    "mem_229260") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229255, "mem_229255") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229250, "mem_229250") != 0)
                return 1;
        }
        if (memblock_set_device(ctx, &ext_mem_229265, &ext_mem_229263,
                                "ext_mem_229263") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_229264, &ext_mem_229262,
                                "ext_mem_229262") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229262, "ext_mem_229262") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229263, "ext_mem_229263") != 0)
            return 1;
    }
    if (memblock_unref_device(ctx, &mem_229206, "mem_229206") != 0)
        return 1;
    
    int64_t min_res_203749 = smin64(q_s_203493, defunc_0_f_res_203631);
    bool bounds_invalid_upwards_203750 = slt64(s_n_m_203636, (int64_t) 0);
    bool valid_203751 = !bounds_invalid_upwards_203750;
    bool range_valid_c_203752;
    
    if (!valid_203751) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Range ", (long long) (int64_t) 0, "..",
                               (long long) (int64_t) 1, "..<",
                               (long long) s_n_m_203636, " is invalid.",
                               "-> #0  /prelude/array.fut:90:3-10\n   #1  /prelude/array.fut:195:11-16\n   #2  utils.fut:6:3-16\n   #3  loess.fut:443:3-470:10\n   #4  loess.fut:517:15-50\n   #5  stl.fut:142:20-80\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:141:12-143:40\n   #9  /prelude/soacs.fut:67:19-23\n   #10 /prelude/soacs.fut:67:3-37\n   #11 stl.fut:140:5-144:36\n   #12 stl.fut:415:61-429:75\n   #13 stl.fut:455:3-469:34\n   #14 stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &ext_mem_229264, "ext_mem_229264") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229265, "ext_mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229206, "mem_229206") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229200, "mem_229200") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229196, "ext_mem_229196") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229197, "ext_mem_229197") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool loop_cond_203754 = slt64((int64_t) 1, min_res_203749);
    double i64_res_203755 = sitofp_i64_f64(q_s_203493);
    int64_t one_intra_par_min_207760 = n_p_203492 * s_n_m_203636;
    int64_t y_207763 = smin64(n_p_203492, one_intra_par_min_207760);
    int64_t intra_avail_par_207764 = smin64(y_207162, y_207763);
    int64_t y_207765 = smax64(n_p_203492, one_intra_par_min_207760);
    int64_t computed_group_sizze_207619 = smax64(y_207162, y_207765);
    bool fits_207772 = sle64(computed_group_sizze_207619,
                             max_group_sizze_206887);
    bool suff_intra_par_207770;
    
    suff_intra_par_207770 = *ctx->tuning_params.mainzisuff_intra_par_3 <=
        intra_avail_par_207764;
    if (ctx->logging)
        fprintf(ctx->log, "Compared %s <= %ld: %s.\n", "main.suff_intra_par_3",
                (long) intra_avail_par_207764,
                suff_intra_par_207770 ? "true" : "false");
    
    bool intra_suff_and_fits_207773 = suff_intra_par_207770 && fits_207772;
    int64_t intra_avail_par_208666 = smin64(defunc_0_f_res_203631,
                                            s_n_m_203636);
    int64_t computed_group_sizze_208667 = smax64(defunc_0_f_res_203631,
                                                 s_n_m_203636);
    bool fits_208671 = sle64(computed_group_sizze_208667,
                             max_group_sizze_206887);
    bool suff_intra_par_208673;
    
    suff_intra_par_208673 = *ctx->tuning_params.mainzisuff_intra_par_4 <=
        intra_avail_par_208666;
    if (ctx->logging)
        fprintf(ctx->log, "Compared %s <= %ld: %s.\n", "main.suff_intra_par_4",
                (long) intra_avail_par_208666,
                suff_intra_par_208673 ? "true" : "false");
    
    bool intra_suff_and_fits_208674 = fits_208671 && suff_intra_par_208673;
    int64_t segmap_group_sizze_208812;
    
    segmap_group_sizze_208812 =
        *ctx->tuning_params.mainzisegmap_group_sizze_208475;
    
    int64_t segmap_group_sizze_208824;
    
    segmap_group_sizze_208824 =
        *ctx->tuning_params.mainzisegmap_group_sizze_208444;
    
    int64_t nest_sizze_208848 = partition_sizze_203577 *
            one_intra_par_min_207760;
    int64_t segmap_group_sizze_208849;
    
    segmap_group_sizze_208849 =
        *ctx->tuning_params.mainzisegmap_group_sizze_208205;
    
    int64_t binop_x_229295 = s_n_m_203636 * binop_x_229202;
    int64_t binop_y_229296 = (int64_t) 8 * binop_x_229295;
    int64_t bytes_229297 = smax64((int64_t) 0, binop_y_229296);
    int64_t binop_y_229273 = (int64_t) 8 * n_p_203492;
    int64_t bytes_229274 = smax64((int64_t) 0, binop_y_229273);
    int64_t binop_y_229287 = (int64_t) 8 * one_intra_par_min_207760;
    int64_t bytes_229288 = smax64((int64_t) 0, binop_y_229287);
    int64_t binop_y_229310 = (int64_t) 8 * s_n_m_203636;
    int64_t bytes_229311 = smax64((int64_t) 0, binop_y_229310);
    struct memblock_device ext_mem_229363;
    
    ext_mem_229363.references = NULL;
    
    struct memblock_device ext_mem_229362;
    
    ext_mem_229362.references = NULL;
    
    int32_t local_memory_capacity_232841;
    
    local_memory_capacity_232841 = ctx->cuda.max_shared_memory;
    if (sle64(bytes_229288 + srem64((int64_t) 8 - srem64(bytes_229288,
                                                         (int64_t) 8),
                                    (int64_t) 8) + (bytes_229288 +
                                                    srem64((int64_t) 8 -
                                                           srem64(bytes_229288,
                                                                  (int64_t) 8),
                                                           (int64_t) 8)) +
              (bytes_229274 + srem64((int64_t) 8 - srem64(bytes_229274,
                                                          (int64_t) 8),
                                     (int64_t) 8)) + (bytes_229274 +
                                                      srem64((int64_t) 8 -
                                                             srem64(bytes_229274,
                                                                    (int64_t) 8),
                                                             (int64_t) 8)) +
              (bytes_229274 + srem64((int64_t) 8 - srem64(bytes_229274,
                                                          (int64_t) 8),
                                     (int64_t) 8)) + (bytes_229274 +
                                                      srem64((int64_t) 8 -
                                                             srem64(bytes_229274,
                                                                    (int64_t) 8),
                                                             (int64_t) 8)) +
              (bytes_229211 + srem64((int64_t) 8 - srem64(bytes_229211,
                                                          (int64_t) 8),
                                     (int64_t) 8)),
              sext_i32_i64(local_memory_capacity_232841)) &&
        intra_suff_and_fits_207773) {
        struct memblock_device mem_229298;
        
        mem_229298.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229298, bytes_229297,
                                  "mem_229298")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_229303;
        
        mem_229303.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229303, bytes_229297,
                                  "mem_229303")) {
            err = 1;
            goto cleanup;
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegMap");
        
        unsigned int shared_sizze_237250 = bytes_229211;
        unsigned int shared_sizze_237252 = bytes_229274;
        unsigned int shared_sizze_237254 = bytes_229274;
        unsigned int shared_sizze_237256 = bytes_229274;
        unsigned int shared_sizze_237258 = bytes_229274;
        unsigned int shared_sizze_237260 = bytes_229288;
        unsigned int shared_sizze_237262 = bytes_229288;
        CUdeviceptr kernel_arg_237264 = ext_mem_229264.mem;
        CUdeviceptr kernel_arg_237265 = ext_mem_229265.mem;
        CUdeviceptr kernel_arg_237266 = mem_229298.mem;
        CUdeviceptr kernel_arg_237267 = mem_229303.mem;
        unsigned int shared_offset_237251 = 0;
        unsigned int shared_offset_237253 = 0 + (shared_sizze_237250 + (8 -
                                                                        shared_sizze_237250 %
                                                                        8) % 8);
        unsigned int shared_offset_237255 = 0 + (shared_sizze_237250 + (8 -
                                                                        shared_sizze_237250 %
                                                                        8) %
                                                 8) + (shared_sizze_237252 +
                                                       (8 -
                                                        shared_sizze_237252 %
                                                        8) % 8);
        unsigned int shared_offset_237257 = 0 + (shared_sizze_237250 + (8 -
                                                                        shared_sizze_237250 %
                                                                        8) %
                                                 8) + (shared_sizze_237252 +
                                                       (8 -
                                                        shared_sizze_237252 %
                                                        8) % 8) +
                     (shared_sizze_237254 + (8 - shared_sizze_237254 % 8) % 8);
        unsigned int shared_offset_237259 = 0 + (shared_sizze_237250 + (8 -
                                                                        shared_sizze_237250 %
                                                                        8) %
                                                 8) + (shared_sizze_237252 +
                                                       (8 -
                                                        shared_sizze_237252 %
                                                        8) % 8) +
                     (shared_sizze_237254 + (8 - shared_sizze_237254 % 8) % 8) +
                     (shared_sizze_237256 + (8 - shared_sizze_237256 % 8) % 8);
        unsigned int shared_offset_237261 = 0 + (shared_sizze_237250 + (8 -
                                                                        shared_sizze_237250 %
                                                                        8) %
                                                 8) + (shared_sizze_237252 +
                                                       (8 -
                                                        shared_sizze_237252 %
                                                        8) % 8) +
                     (shared_sizze_237254 + (8 - shared_sizze_237254 % 8) % 8) +
                     (shared_sizze_237256 + (8 - shared_sizze_237256 % 8) % 8) +
                     (shared_sizze_237258 + (8 - shared_sizze_237258 % 8) % 8);
        unsigned int shared_offset_237263 = 0 + (shared_sizze_237250 + (8 -
                                                                        shared_sizze_237250 %
                                                                        8) %
                                                 8) + (shared_sizze_237252 +
                                                       (8 -
                                                        shared_sizze_237252 %
                                                        8) % 8) +
                     (shared_sizze_237254 + (8 - shared_sizze_237254 % 8) % 8) +
                     (shared_sizze_237256 + (8 - shared_sizze_237256 % 8) % 8) +
                     (shared_sizze_237258 + (8 - shared_sizze_237258 % 8) % 8) +
                     (shared_sizze_237260 + (8 - shared_sizze_237260 % 8) % 8);
        
        if ((((((1 && partition_sizze_203577 != 0) && 1 != 0) && 1 != 0) &&
              computed_group_sizze_207619 != 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_203577;
            grid[perm[1]] = 1;
            grid[perm[2]] = 1;
            
            void *kernel_args_237247[] = {&ctx->global_failure,
                                          &ctx->failure_is_an_option,
                                          &ctx->global_failure_args,
                                          &shared_offset_237251,
                                          &shared_offset_237253,
                                          &shared_offset_237255,
                                          &shared_offset_237257,
                                          &shared_offset_237259,
                                          &shared_offset_237261,
                                          &shared_offset_237263, &n_p_203492,
                                          &q_s_203493, &jump_s_203499,
                                          &partition_sizze_203577,
                                          &defunc_0_f_res_203631,
                                          &pad_css_len_203632, &s_n_m_203636,
                                          &i_203718, &x_203719, &min_res_203749,
                                          &loop_cond_203754, &i64_res_203755,
                                          &computed_group_sizze_207619,
                                          &kernel_arg_237264,
                                          &kernel_arg_237265,
                                          &kernel_arg_237266,
                                          &kernel_arg_237267};
            int64_t time_start_237248 = 0, time_end_237249 = 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_207777",
                        (long) partition_sizze_203577, (long) 1, (long) 1,
                        (long) computed_group_sizze_207619, (long) 1, (long) 1,
                        (int) (0 + (shared_sizze_237250 + (8 -
                                                           shared_sizze_237250 %
                                                           8) % 8) +
                               (shared_sizze_237252 + (8 - shared_sizze_237252 %
                                                       8) % 8) +
                               (shared_sizze_237254 + (8 - shared_sizze_237254 %
                                                       8) % 8) +
                               (shared_sizze_237256 + (8 - shared_sizze_237256 %
                                                       8) % 8) +
                               (shared_sizze_237258 + (8 - shared_sizze_237258 %
                                                       8) % 8) +
                               (shared_sizze_237260 + (8 - shared_sizze_237260 %
                                                       8) % 8) +
                               (shared_sizze_237262 + (8 - shared_sizze_237262 %
                                                       8) % 8)));
                time_start_237248 = get_wall_time();
            }
            
            cudaEvent_t *pevents = NULL;
            
            if (ctx->profiling && !ctx->profiling_paused) {
                pevents = cuda_get_events(&ctx->cuda,
                                          &ctx->mainzisegmap_intragroup_207777_runs,
                                          &ctx->mainzisegmap_intragroup_207777_total_runtime);
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
            }
            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_intragroup_207777,
                                                  grid[0], grid[1], grid[2],
                                                  computed_group_sizze_207619,
                                                  1, 1, 0 +
                                                  (shared_sizze_237250 + (8 -
                                                                          shared_sizze_237250 %
                                                                          8) %
                                                   8) + (shared_sizze_237252 +
                                                         (8 -
                                                          shared_sizze_237252 %
                                                          8) % 8) +
                                                  (shared_sizze_237254 + (8 -
                                                                          shared_sizze_237254 %
                                                                          8) %
                                                   8) + (shared_sizze_237256 +
                                                         (8 -
                                                          shared_sizze_237256 %
                                                          8) % 8) +
                                                  (shared_sizze_237258 + (8 -
                                                                          shared_sizze_237258 %
                                                                          8) %
                                                   8) + (shared_sizze_237260 +
                                                         (8 -
                                                          shared_sizze_237260 %
                                                          8) % 8) +
                                                  (shared_sizze_237262 + (8 -
                                                                          shared_sizze_237262 %
                                                                          8) %
                                                   8), NULL, kernel_args_237247,
                                                  NULL));
            if (pevents != NULL)
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
            if (ctx->debugging) {
                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                time_end_237249 = get_wall_time();
                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                        "main.segmap_intragroup_207777", time_end_237249 -
                        time_start_237248);
            }
        }
        ctx->failure_is_an_option = 1;
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "");
        if (memblock_set_device(ctx, &ext_mem_229363, &mem_229298,
                                "mem_229298") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_229362, &mem_229303,
                                "mem_229303") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229303, "mem_229303") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229298, "mem_229298") != 0)
            return 1;
    } else {
        struct memblock_device ext_mem_229361;
        
        ext_mem_229361.references = NULL;
        
        struct memblock_device ext_mem_229360;
        
        ext_mem_229360.references = NULL;
        
        int32_t local_memory_capacity_232840;
        
        local_memory_capacity_232840 = ctx->cuda.max_shared_memory;
        if (sle64(bytes_229311 + srem64((int64_t) 8 - srem64(bytes_229311,
                                                             (int64_t) 8),
                                        (int64_t) 8) + (bytes_229311 +
                                                        srem64((int64_t) 8 -
                                                               srem64(bytes_229311,
                                                                      (int64_t) 8),
                                                               (int64_t) 8)) +
                  (bytes_229230 + srem64((int64_t) 8 - srem64(bytes_229230,
                                                              (int64_t) 8),
                                         (int64_t) 8)),
                  sext_i32_i64(local_memory_capacity_232840)) &&
            intra_suff_and_fits_208674) {
            struct memblock_device mem_229320;
            
            mem_229320.references = NULL;
            if (memblock_alloc_device(ctx, &mem_229320, bytes_229297,
                                      "mem_229320")) {
                err = 1;
                goto cleanup;
            }
            
            struct memblock_device mem_229325;
            
            mem_229325.references = NULL;
            if (memblock_alloc_device(ctx, &mem_229325, bytes_229297,
                                      "mem_229325")) {
                err = 1;
                goto cleanup;
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            
            unsigned int shared_sizze_237271 = bytes_229230;
            unsigned int shared_sizze_237273 = bytes_229311;
            unsigned int shared_sizze_237275 = bytes_229311;
            CUdeviceptr kernel_arg_237277 = ext_mem_229264.mem;
            CUdeviceptr kernel_arg_237278 = ext_mem_229265.mem;
            CUdeviceptr kernel_arg_237279 = mem_229320.mem;
            CUdeviceptr kernel_arg_237280 = mem_229325.mem;
            unsigned int shared_offset_237272 = 0;
            unsigned int shared_offset_237274 = 0 + (shared_sizze_237271 + (8 -
                                                                            shared_sizze_237271 %
                                                                            8) %
                                                     8);
            unsigned int shared_offset_237276 = 0 + (shared_sizze_237271 + (8 -
                                                                            shared_sizze_237271 %
                                                                            8) %
                                                     8) + (shared_sizze_237273 +
                                                           (8 -
                                                            shared_sizze_237273 %
                                                            8) % 8);
            
            if ((((((1 && binop_x_229202 != 0) && 1 != 0) && 1 != 0) &&
                  computed_group_sizze_208667 != 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_229202;
                grid[perm[1]] = 1;
                grid[perm[2]] = 1;
                
                void *kernel_args_237268[] = {&ctx->global_failure,
                                              &ctx->failure_is_an_option,
                                              &ctx->global_failure_args,
                                              &shared_offset_237272,
                                              &shared_offset_237274,
                                              &shared_offset_237276,
                                              &n_p_203492, &q_s_203493,
                                              &jump_s_203499,
                                              &partition_sizze_203577,
                                              &defunc_0_f_res_203631,
                                              &pad_css_len_203632,
                                              &s_n_m_203636, &i_203718,
                                              &x_203719, &min_res_203749,
                                              &loop_cond_203754,
                                              &i64_res_203755,
                                              &computed_group_sizze_208667,
                                              &kernel_arg_237277,
                                              &kernel_arg_237278,
                                              &kernel_arg_237279,
                                              &kernel_arg_237280};
                int64_t time_start_237269 = 0, time_end_237270 = 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_208681",
                            (long) binop_x_229202, (long) 1, (long) 1,
                            (long) computed_group_sizze_208667, (long) 1,
                            (long) 1, (int) (0 + (shared_sizze_237271 + (8 -
                                                                         shared_sizze_237271 %
                                                                         8) %
                                                  8) + (shared_sizze_237273 +
                                                        (8 -
                                                         shared_sizze_237273 %
                                                         8) % 8) +
                                             (shared_sizze_237275 + (8 -
                                                                     shared_sizze_237275 %
                                                                     8) % 8)));
                    time_start_237269 = get_wall_time();
                }
                
                cudaEvent_t *pevents = NULL;
                
                if (ctx->profiling && !ctx->profiling_paused) {
                    pevents = cuda_get_events(&ctx->cuda,
                                              &ctx->mainzisegmap_intragroup_208681_runs,
                                              &ctx->mainzisegmap_intragroup_208681_total_runtime);
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                }
                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_intragroup_208681,
                                                      grid[0], grid[1], grid[2],
                                                      computed_group_sizze_208667,
                                                      1, 1, 0 +
                                                      (shared_sizze_237271 +
                                                       (8 -
                                                        shared_sizze_237271 %
                                                        8) % 8) +
                                                      (shared_sizze_237273 +
                                                       (8 -
                                                        shared_sizze_237273 %
                                                        8) % 8) +
                                                      (shared_sizze_237275 +
                                                       (8 -
                                                        shared_sizze_237275 %
                                                        8) % 8), NULL,
                                                      kernel_args_237268,
                                                      NULL));
                if (pevents != NULL)
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                if (ctx->debugging) {
                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                    time_end_237270 = get_wall_time();
                    fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                            "main.segmap_intragroup_208681", time_end_237270 -
                            time_start_237269);
                }
            }
            ctx->failure_is_an_option = 1;
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            if (memblock_set_device(ctx, &ext_mem_229361, &mem_229320,
                                    "mem_229320") != 0)
                return 1;
            if (memblock_set_device(ctx, &ext_mem_229360, &mem_229325,
                                    "mem_229325") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229325, "mem_229325") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229320, "mem_229320") != 0)
                return 1;
        } else {
            int64_t segmap_usable_groups_208813 = sdiv_up64(nest_sizze_207163,
                                                            segmap_group_sizze_208812);
            struct memblock_device mem_229331;
            
            mem_229331.references = NULL;
            if (memblock_alloc_device(ctx, &mem_229331, bytes_229205,
                                      "mem_229331")) {
                err = 1;
                goto cleanup;
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            
            CUdeviceptr kernel_arg_237284 = ext_mem_229265.mem;
            CUdeviceptr kernel_arg_237285 = mem_229331.mem;
            
            if ((((((1 && segmap_usable_groups_208813 != 0) && 1 != 0) && 1 !=
                   0) && segmap_group_sizze_208812 != 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_208813;
                grid[perm[1]] = 1;
                grid[perm[2]] = 1;
                
                void *kernel_args_237281[] = {&ctx->global_failure, &n_p_203492,
                                              &partition_sizze_203577,
                                              &defunc_0_f_res_203631,
                                              &kernel_arg_237284,
                                              &kernel_arg_237285};
                int64_t time_start_237282 = 0, time_end_237283 = 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_208818",
                            (long) segmap_usable_groups_208813, (long) 1,
                            (long) 1, (long) segmap_group_sizze_208812,
                            (long) 1, (long) 1, (int) 0);
                    time_start_237282 = get_wall_time();
                }
                
                cudaEvent_t *pevents = NULL;
                
                if (ctx->profiling && !ctx->profiling_paused) {
                    pevents = cuda_get_events(&ctx->cuda,
                                              &ctx->mainzisegmap_208818_runs,
                                              &ctx->mainzisegmap_208818_total_runtime);
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                }
                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_208818,
                                                      grid[0], grid[1], grid[2],
                                                      segmap_group_sizze_208812,
                                                      1, 1, 0, NULL,
                                                      kernel_args_237281,
                                                      NULL));
                if (pevents != NULL)
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                if (ctx->debugging) {
                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                    time_end_237283 = get_wall_time();
                    fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                            "main.segmap_208818", time_end_237283 -
                            time_start_237282);
                }
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            
            int64_t segmap_usable_groups_208825 = sdiv_up64(binop_x_229202,
                                                            segmap_group_sizze_208824);
            struct memblock_device mem_229336;
            
            mem_229336.references = NULL;
            if (memblock_alloc_device(ctx, &mem_229336, bytes_229225,
                                      "mem_229336")) {
                err = 1;
                goto cleanup;
            }
            
            struct memblock_device mem_229340;
            
            mem_229340.references = NULL;
            if (memblock_alloc_device(ctx, &mem_229340, bytes_229225,
                                      "mem_229340")) {
                err = 1;
                goto cleanup;
            }
            
            struct memblock_device mem_229344;
            
            mem_229344.references = NULL;
            if (memblock_alloc_device(ctx, &mem_229344, bytes_229225,
                                      "mem_229344")) {
                err = 1;
                goto cleanup;
            }
            
            struct memblock_device mem_229348;
            
            mem_229348.references = NULL;
            if (memblock_alloc_device(ctx, &mem_229348, bytes_229225,
                                      "mem_229348")) {
                err = 1;
                goto cleanup;
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            
            CUdeviceptr kernel_arg_237289 = ext_mem_229264.mem;
            CUdeviceptr kernel_arg_237290 = mem_229336.mem;
            CUdeviceptr kernel_arg_237291 = mem_229340.mem;
            CUdeviceptr kernel_arg_237292 = mem_229344.mem;
            CUdeviceptr kernel_arg_237293 = mem_229348.mem;
            
            if ((((((1 && segmap_usable_groups_208825 != 0) && 1 != 0) && 1 !=
                   0) && segmap_group_sizze_208824 != 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_208825;
                grid[perm[1]] = 1;
                grid[perm[2]] = 1;
                
                void *kernel_args_237286[] = {&ctx->global_failure, &n_p_203492,
                                              &q_s_203493,
                                              &partition_sizze_203577,
                                              &min_res_203749, &i64_res_203755,
                                              &kernel_arg_237289,
                                              &kernel_arg_237290,
                                              &kernel_arg_237291,
                                              &kernel_arg_237292,
                                              &kernel_arg_237293};
                int64_t time_start_237287 = 0, time_end_237288 = 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_208832",
                            (long) segmap_usable_groups_208825, (long) 1,
                            (long) 1, (long) segmap_group_sizze_208824,
                            (long) 1, (long) 1, (int) 0);
                    time_start_237287 = get_wall_time();
                }
                
                cudaEvent_t *pevents = NULL;
                
                if (ctx->profiling && !ctx->profiling_paused) {
                    pevents = cuda_get_events(&ctx->cuda,
                                              &ctx->mainzisegmap_208832_runs,
                                              &ctx->mainzisegmap_208832_total_runtime);
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                }
                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_208832,
                                                      grid[0], grid[1], grid[2],
                                                      segmap_group_sizze_208824,
                                                      1, 1, 0, NULL,
                                                      kernel_args_237286,
                                                      NULL));
                if (pevents != NULL)
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                if (ctx->debugging) {
                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                    time_end_237288 = get_wall_time();
                    fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                            "main.segmap_208832", time_end_237288 -
                            time_start_237287);
                }
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            
            int64_t segmap_usable_groups_208850 = sdiv_up64(nest_sizze_208848,
                                                            segmap_group_sizze_208849);
            struct memblock_device mem_229354;
            
            mem_229354.references = NULL;
            if (memblock_alloc_device(ctx, &mem_229354, bytes_229297,
                                      "mem_229354")) {
                err = 1;
                goto cleanup;
            }
            
            struct memblock_device mem_229359;
            
            mem_229359.references = NULL;
            if (memblock_alloc_device(ctx, &mem_229359, bytes_229297,
                                      "mem_229359")) {
                err = 1;
                goto cleanup;
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            
            CUdeviceptr kernel_arg_237297 = mem_229331.mem;
            CUdeviceptr kernel_arg_237298 = mem_229336.mem;
            CUdeviceptr kernel_arg_237299 = mem_229340.mem;
            CUdeviceptr kernel_arg_237300 = mem_229344.mem;
            CUdeviceptr kernel_arg_237301 = mem_229348.mem;
            CUdeviceptr kernel_arg_237302 = mem_229354.mem;
            CUdeviceptr kernel_arg_237303 = mem_229359.mem;
            
            if ((((((1 && segmap_usable_groups_208850 != 0) && 1 != 0) && 1 !=
                   0) && segmap_group_sizze_208849 != 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_208850;
                grid[perm[1]] = 1;
                grid[perm[2]] = 1;
                
                void *kernel_args_237294[] = {&ctx->global_failure,
                                              &ctx->failure_is_an_option,
                                              &ctx->global_failure_args,
                                              &n_p_203492, &jump_s_203499,
                                              &partition_sizze_203577,
                                              &defunc_0_f_res_203631,
                                              &pad_css_len_203632,
                                              &s_n_m_203636, &i_203718,
                                              &x_203719, &min_res_203749,
                                              &loop_cond_203754,
                                              &kernel_arg_237297,
                                              &kernel_arg_237298,
                                              &kernel_arg_237299,
                                              &kernel_arg_237300,
                                              &kernel_arg_237301,
                                              &kernel_arg_237302,
                                              &kernel_arg_237303};
                int64_t time_start_237295 = 0, time_end_237296 = 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_208856",
                            (long) segmap_usable_groups_208850, (long) 1,
                            (long) 1, (long) segmap_group_sizze_208849,
                            (long) 1, (long) 1, (int) 0);
                    time_start_237295 = get_wall_time();
                }
                
                cudaEvent_t *pevents = NULL;
                
                if (ctx->profiling && !ctx->profiling_paused) {
                    pevents = cuda_get_events(&ctx->cuda,
                                              &ctx->mainzisegmap_208856_runs,
                                              &ctx->mainzisegmap_208856_total_runtime);
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                }
                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_208856,
                                                      grid[0], grid[1], grid[2],
                                                      segmap_group_sizze_208849,
                                                      1, 1, 0, NULL,
                                                      kernel_args_237294,
                                                      NULL));
                if (pevents != NULL)
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                if (ctx->debugging) {
                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                    time_end_237296 = get_wall_time();
                    fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                            "main.segmap_208856", time_end_237296 -
                            time_start_237295);
                }
            }
            ctx->failure_is_an_option = 1;
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            if (memblock_unref_device(ctx, &mem_229331, "mem_229331") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229336, "mem_229336") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229340, "mem_229340") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229344, "mem_229344") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229348, "mem_229348") != 0)
                return 1;
            if (memblock_set_device(ctx, &ext_mem_229361, &mem_229359,
                                    "mem_229359") != 0)
                return 1;
            if (memblock_set_device(ctx, &ext_mem_229360, &mem_229354,
                                    "mem_229354") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229359, "mem_229359") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229354, "mem_229354") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229348, "mem_229348") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229344, "mem_229344") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229340, "mem_229340") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229336, "mem_229336") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229331, "mem_229331") != 0)
                return 1;
        }
        if (memblock_set_device(ctx, &ext_mem_229363, &ext_mem_229361,
                                "ext_mem_229361") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_229362, &ext_mem_229360,
                                "ext_mem_229360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229360, "ext_mem_229360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229361, "ext_mem_229361") != 0)
            return 1;
    }
    
    int64_t min_res_203881 = smin64(n_203490, q_l_203495);
    bool bounds_invalid_upwards_203882 = slt64(l_n_m_203643, (int64_t) 0);
    bool valid_203883 = !bounds_invalid_upwards_203882;
    bool range_valid_c_203884;
    
    if (!valid_203883) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Range ", (long long) (int64_t) 0, "..",
                               (long long) (int64_t) 1, "..<",
                               (long long) l_n_m_203643, " is invalid.",
                               "-> #0  /prelude/array.fut:90:3-10\n   #1  /prelude/array.fut:195:11-16\n   #2  utils.fut:6:3-16\n   #3  loess.fut:443:3-470:10\n   #4  loess.fut:503:15-61\n   #5  stl.fut:150:13-60\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:148:5-151:26\n   #9  stl.fut:415:61-429:75\n   #10 stl.fut:455:3-469:34\n   #11 stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &ext_mem_229362, "ext_mem_229362") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229363, "ext_mem_229363") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229264, "ext_mem_229264") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229265, "ext_mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229206, "mem_229206") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229200, "mem_229200") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229196, "ext_mem_229196") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229197, "ext_mem_229197") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool loop_cond_203886 = slt64((int64_t) 1, min_res_203881);
    double i64_res_203887 = sitofp_i64_f64(q_l_203495);
    int64_t intra_avail_par_209071 = smin64(n_203490, l_n_m_203643);
    int64_t computed_group_sizze_208973 = smax64(n_203490, l_n_m_203643);
    bool fits_209077 = sle64(computed_group_sizze_208973,
                             max_group_sizze_206887);
    bool suff_intra_par_209075;
    
    suff_intra_par_209075 = *ctx->tuning_params.mainzisuff_intra_par_5 <=
        intra_avail_par_209071;
    if (ctx->logging)
        fprintf(ctx->log, "Compared %s <= %ld: %s.\n", "main.suff_intra_par_5",
                (long) intra_avail_par_209071,
                suff_intra_par_209075 ? "true" : "false");
    
    bool intra_suff_and_fits_209078 = suff_intra_par_209075 && fits_209077;
    int64_t segmap_group_sizze_209461;
    
    segmap_group_sizze_209461 =
        *ctx->tuning_params.mainzisegmap_group_sizze_209437;
    
    int64_t segmap_group_sizze_209471;
    
    segmap_group_sizze_209471 =
        *ctx->tuning_params.mainzisegmap_group_sizze_209411;
    
    int64_t nest_sizze_209492 = partition_sizze_203577 * l_n_m_203643;
    int64_t segmap_group_sizze_209493;
    
    segmap_group_sizze_209493 =
        *ctx->tuning_params.mainzisegmap_group_sizze_209207;
    
    int64_t binop_y_229377 = (int64_t) 8 * nest_sizze_209492;
    int64_t bytes_229378 = smax64((int64_t) 0, binop_y_229377);
    int64_t binop_y_229370 = (int64_t) 8 * l_n_m_203643;
    int64_t bytes_229371 = smax64((int64_t) 0, binop_y_229370);
    struct memblock_device ext_mem_229412;
    
    ext_mem_229412.references = NULL;
    
    struct memblock_device ext_mem_229411;
    
    ext_mem_229411.references = NULL;
    
    int32_t local_memory_capacity_232901;
    
    local_memory_capacity_232901 = ctx->cuda.max_shared_memory;
    if (sle64(bytes_229371 + srem64((int64_t) 8 - srem64(bytes_229371,
                                                         (int64_t) 8),
                                    (int64_t) 8) + (bytes_229371 +
                                                    srem64((int64_t) 8 -
                                                           srem64(bytes_229371,
                                                                  (int64_t) 8),
                                                           (int64_t) 8)) +
              (bytes_229169 + srem64((int64_t) 8 - srem64(bytes_229169,
                                                          (int64_t) 8),
                                     (int64_t) 8)),
              sext_i32_i64(local_memory_capacity_232901)) &&
        intra_suff_and_fits_209078) {
        struct memblock_device mem_229379;
        
        mem_229379.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229379, bytes_229378,
                                  "mem_229379")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_229383;
        
        mem_229383.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229383, bytes_229378,
                                  "mem_229383")) {
            err = 1;
            goto cleanup;
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegMap");
        
        unsigned int shared_sizze_237307 = bytes_229169;
        unsigned int shared_sizze_237309 = bytes_229371;
        unsigned int shared_sizze_237311 = bytes_229371;
        CUdeviceptr kernel_arg_237313 = ext_mem_229196.mem;
        CUdeviceptr kernel_arg_237314 = ext_mem_229197.mem;
        CUdeviceptr kernel_arg_237315 = mem_229379.mem;
        CUdeviceptr kernel_arg_237316 = mem_229383.mem;
        unsigned int shared_offset_237308 = 0;
        unsigned int shared_offset_237310 = 0 + (shared_sizze_237307 + (8 -
                                                                        shared_sizze_237307 %
                                                                        8) % 8);
        unsigned int shared_offset_237312 = 0 + (shared_sizze_237307 + (8 -
                                                                        shared_sizze_237307 %
                                                                        8) %
                                                 8) + (shared_sizze_237309 +
                                                       (8 -
                                                        shared_sizze_237309 %
                                                        8) % 8);
        
        if ((((((1 && partition_sizze_203577 != 0) && 1 != 0) && 1 != 0) &&
              computed_group_sizze_208973 != 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_203577;
            grid[perm[1]] = 1;
            grid[perm[2]] = 1;
            
            void *kernel_args_237304[] = {&ctx->global_failure,
                                          &ctx->failure_is_an_option,
                                          &ctx->global_failure_args,
                                          &shared_offset_237308,
                                          &shared_offset_237310,
                                          &shared_offset_237312, &n_203490,
                                          &q_l_203495, &jump_l_203501,
                                          &partition_sizze_203577,
                                          &l_n_m_203643, &i_203670, &x_203671,
                                          &min_res_203881, &loop_cond_203886,
                                          &i64_res_203887,
                                          &computed_group_sizze_208973,
                                          &kernel_arg_237313,
                                          &kernel_arg_237314,
                                          &kernel_arg_237315,
                                          &kernel_arg_237316};
            int64_t time_start_237305 = 0, time_end_237306 = 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_209082",
                        (long) partition_sizze_203577, (long) 1, (long) 1,
                        (long) computed_group_sizze_208973, (long) 1, (long) 1,
                        (int) (0 + (shared_sizze_237307 + (8 -
                                                           shared_sizze_237307 %
                                                           8) % 8) +
                               (shared_sizze_237309 + (8 - shared_sizze_237309 %
                                                       8) % 8) +
                               (shared_sizze_237311 + (8 - shared_sizze_237311 %
                                                       8) % 8)));
                time_start_237305 = get_wall_time();
            }
            
            cudaEvent_t *pevents = NULL;
            
            if (ctx->profiling && !ctx->profiling_paused) {
                pevents = cuda_get_events(&ctx->cuda,
                                          &ctx->mainzisegmap_intragroup_209082_runs,
                                          &ctx->mainzisegmap_intragroup_209082_total_runtime);
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
            }
            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_intragroup_209082,
                                                  grid[0], grid[1], grid[2],
                                                  computed_group_sizze_208973,
                                                  1, 1, 0 +
                                                  (shared_sizze_237307 + (8 -
                                                                          shared_sizze_237307 %
                                                                          8) %
                                                   8) + (shared_sizze_237309 +
                                                         (8 -
                                                          shared_sizze_237309 %
                                                          8) % 8) +
                                                  (shared_sizze_237311 + (8 -
                                                                          shared_sizze_237311 %
                                                                          8) %
                                                   8), NULL, kernel_args_237304,
                                                  NULL));
            if (pevents != NULL)
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
            if (ctx->debugging) {
                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                time_end_237306 = get_wall_time();
                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                        "main.segmap_intragroup_209082", time_end_237306 -
                        time_start_237305);
            }
        }
        ctx->failure_is_an_option = 1;
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "");
        if (memblock_set_device(ctx, &ext_mem_229412, &mem_229379,
                                "mem_229379") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_229411, &mem_229383,
                                "mem_229383") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229383, "mem_229383") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229379, "mem_229379") != 0)
            return 1;
    } else {
        int64_t segmap_usable_groups_209462 = sdiv_up64(nest_sizze_207000,
                                                        segmap_group_sizze_209461);
        struct memblock_device mem_229388;
        
        mem_229388.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229388, bytes_229177,
                                  "mem_229388")) {
            err = 1;
            goto cleanup;
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegMap");
        
        CUdeviceptr kernel_arg_237320 = ext_mem_229197.mem;
        CUdeviceptr kernel_arg_237321 = mem_229388.mem;
        
        if ((((((1 && segmap_usable_groups_209462 != 0) && 1 != 0) && 1 != 0) &&
              segmap_group_sizze_209461 != 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_209462;
            grid[perm[1]] = 1;
            grid[perm[2]] = 1;
            
            void *kernel_args_237317[] = {&ctx->global_failure, &n_203490,
                                          &partition_sizze_203577,
                                          &kernel_arg_237320,
                                          &kernel_arg_237321};
            int64_t time_start_237318 = 0, time_end_237319 = 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_209466",
                        (long) segmap_usable_groups_209462, (long) 1, (long) 1,
                        (long) segmap_group_sizze_209461, (long) 1, (long) 1,
                        (int) 0);
                time_start_237318 = get_wall_time();
            }
            
            cudaEvent_t *pevents = NULL;
            
            if (ctx->profiling && !ctx->profiling_paused) {
                pevents = cuda_get_events(&ctx->cuda,
                                          &ctx->mainzisegmap_209466_runs,
                                          &ctx->mainzisegmap_209466_total_runtime);
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
            }
            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_209466,
                                                  grid[0], grid[1], grid[2],
                                                  segmap_group_sizze_209461, 1,
                                                  1, 0, NULL,
                                                  kernel_args_237317, NULL));
            if (pevents != NULL)
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
            if (ctx->debugging) {
                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                time_end_237319 = get_wall_time();
                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                        "main.segmap_209466", time_end_237319 -
                        time_start_237318);
            }
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "");
        
        int64_t segmap_usable_groups_209472 = sdiv_up64(partition_sizze_203577,
                                                        segmap_group_sizze_209471);
        struct memblock_device mem_229392;
        
        mem_229392.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229392, bytes_229180,
                                  "mem_229392")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_229395;
        
        mem_229395.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229395, bytes_229180,
                                  "mem_229395")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_229398;
        
        mem_229398.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229398, bytes_229180,
                                  "mem_229398")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_229401;
        
        mem_229401.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229401, bytes_229180,
                                  "mem_229401")) {
            err = 1;
            goto cleanup;
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegMap");
        
        CUdeviceptr kernel_arg_237325 = ext_mem_229196.mem;
        CUdeviceptr kernel_arg_237326 = mem_229392.mem;
        CUdeviceptr kernel_arg_237327 = mem_229395.mem;
        CUdeviceptr kernel_arg_237328 = mem_229398.mem;
        CUdeviceptr kernel_arg_237329 = mem_229401.mem;
        
        if ((((((1 && segmap_usable_groups_209472 != 0) && 1 != 0) && 1 != 0) &&
              segmap_group_sizze_209471 != 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_209472;
            grid[perm[1]] = 1;
            grid[perm[2]] = 1;
            
            void *kernel_args_237322[] = {&ctx->global_failure, &q_l_203495,
                                          &partition_sizze_203577,
                                          &min_res_203881, &i64_res_203887,
                                          &kernel_arg_237325,
                                          &kernel_arg_237326,
                                          &kernel_arg_237327,
                                          &kernel_arg_237328,
                                          &kernel_arg_237329};
            int64_t time_start_237323 = 0, time_end_237324 = 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_209478",
                        (long) segmap_usable_groups_209472, (long) 1, (long) 1,
                        (long) segmap_group_sizze_209471, (long) 1, (long) 1,
                        (int) 0);
                time_start_237323 = get_wall_time();
            }
            
            cudaEvent_t *pevents = NULL;
            
            if (ctx->profiling && !ctx->profiling_paused) {
                pevents = cuda_get_events(&ctx->cuda,
                                          &ctx->mainzisegmap_209478_runs,
                                          &ctx->mainzisegmap_209478_total_runtime);
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
            }
            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_209478,
                                                  grid[0], grid[1], grid[2],
                                                  segmap_group_sizze_209471, 1,
                                                  1, 0, NULL,
                                                  kernel_args_237322, NULL));
            if (pevents != NULL)
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
            if (ctx->debugging) {
                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                time_end_237324 = get_wall_time();
                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                        "main.segmap_209478", time_end_237324 -
                        time_start_237323);
            }
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "");
        
        int64_t segmap_usable_groups_209494 = sdiv_up64(nest_sizze_209492,
                                                        segmap_group_sizze_209493);
        struct memblock_device mem_229406;
        
        mem_229406.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229406, bytes_229378,
                                  "mem_229406")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_229410;
        
        mem_229410.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229410, bytes_229378,
                                  "mem_229410")) {
            err = 1;
            goto cleanup;
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegMap");
        
        CUdeviceptr kernel_arg_237333 = ext_mem_229197.mem;
        CUdeviceptr kernel_arg_237334 = mem_229388.mem;
        CUdeviceptr kernel_arg_237335 = mem_229392.mem;
        CUdeviceptr kernel_arg_237336 = mem_229395.mem;
        CUdeviceptr kernel_arg_237337 = mem_229398.mem;
        CUdeviceptr kernel_arg_237338 = mem_229401.mem;
        CUdeviceptr kernel_arg_237339 = mem_229406.mem;
        CUdeviceptr kernel_arg_237340 = mem_229410.mem;
        
        if ((((((1 && segmap_usable_groups_209494 != 0) && 1 != 0) && 1 != 0) &&
              segmap_group_sizze_209493 != 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_209494;
            grid[perm[1]] = 1;
            grid[perm[2]] = 1;
            
            void *kernel_args_237330[] = {&ctx->global_failure,
                                          &ctx->failure_is_an_option,
                                          &ctx->global_failure_args, &n_203490,
                                          &jump_l_203501,
                                          &partition_sizze_203577,
                                          &l_n_m_203643, &i_203670, &x_203671,
                                          &min_res_203881, &loop_cond_203886,
                                          &kernel_arg_237333,
                                          &kernel_arg_237334,
                                          &kernel_arg_237335,
                                          &kernel_arg_237336,
                                          &kernel_arg_237337,
                                          &kernel_arg_237338,
                                          &kernel_arg_237339,
                                          &kernel_arg_237340};
            int64_t time_start_237331 = 0, time_end_237332 = 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_209499",
                        (long) segmap_usable_groups_209494, (long) 1, (long) 1,
                        (long) segmap_group_sizze_209493, (long) 1, (long) 1,
                        (int) 0);
                time_start_237331 = get_wall_time();
            }
            
            cudaEvent_t *pevents = NULL;
            
            if (ctx->profiling && !ctx->profiling_paused) {
                pevents = cuda_get_events(&ctx->cuda,
                                          &ctx->mainzisegmap_209499_runs,
                                          &ctx->mainzisegmap_209499_total_runtime);
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
            }
            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_209499,
                                                  grid[0], grid[1], grid[2],
                                                  segmap_group_sizze_209493, 1,
                                                  1, 0, NULL,
                                                  kernel_args_237330, NULL));
            if (pevents != NULL)
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
            if (ctx->debugging) {
                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                time_end_237332 = get_wall_time();
                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                        "main.segmap_209499", time_end_237332 -
                        time_start_237331);
            }
        }
        ctx->failure_is_an_option = 1;
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "");
        if (memblock_unref_device(ctx, &mem_229388, "mem_229388") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229392, "mem_229392") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229395, "mem_229395") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229398, "mem_229398") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229401, "mem_229401") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_229412, &mem_229410,
                                "mem_229410") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_229411, &mem_229406,
                                "mem_229406") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229410, "mem_229410") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229406, "mem_229406") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229401, "mem_229401") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229398, "mem_229398") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229395, "mem_229395") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229392, "mem_229392") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229388, "mem_229388") != 0)
            return 1;
    }
    
    int64_t min_res_203993 = smin64(n_203490, q_t_203494);
    bool bounds_invalid_upwards_203994 = slt64(t_n_m_203650, (int64_t) 0);
    bool valid_203995 = !bounds_invalid_upwards_203994;
    bool range_valid_c_203996;
    
    if (!valid_203995) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Range ", (long long) (int64_t) 0, "..",
                               (long long) (int64_t) 1, "..<",
                               (long long) t_n_m_203650, " is invalid.",
                               "-> #0  /prelude/array.fut:90:3-10\n   #1  /prelude/array.fut:195:11-16\n   #2  utils.fut:6:3-16\n   #3  loess.fut:443:3-470:10\n   #4  loess.fut:503:15-61\n   #5  stl.fut:157:13-60\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:155:5-158:26\n   #9  stl.fut:415:61-429:75\n   #10 stl.fut:455:3-469:34\n   #11 stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &ext_mem_229411, "ext_mem_229411") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229412, "ext_mem_229412") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229362, "ext_mem_229362") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229363, "ext_mem_229363") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229264, "ext_mem_229264") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229265, "ext_mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229206, "mem_229206") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229200, "mem_229200") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229196, "ext_mem_229196") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229197, "ext_mem_229197") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool loop_cond_203998 = slt64((int64_t) 1, min_res_203993);
    double i64_res_203999 = sitofp_i64_f64(q_t_203494);
    int64_t intra_avail_par_209697 = smin64(n_203490, t_n_m_203650);
    int64_t computed_group_sizze_209599 = smax64(n_203490, t_n_m_203650);
    bool fits_209703 = sle64(computed_group_sizze_209599,
                             max_group_sizze_206887);
    bool suff_intra_par_209701;
    
    suff_intra_par_209701 = *ctx->tuning_params.mainzisuff_intra_par_6 <=
        intra_avail_par_209697;
    if (ctx->logging)
        fprintf(ctx->log, "Compared %s <= %ld: %s.\n", "main.suff_intra_par_6",
                (long) intra_avail_par_209697,
                suff_intra_par_209701 ? "true" : "false");
    
    bool intra_suff_and_fits_209704 = suff_intra_par_209701 && fits_209703;
    int64_t segmap_group_sizze_210087;
    
    segmap_group_sizze_210087 =
        *ctx->tuning_params.mainzisegmap_group_sizze_210063;
    
    int64_t segmap_group_sizze_210097;
    
    segmap_group_sizze_210097 =
        *ctx->tuning_params.mainzisegmap_group_sizze_210037;
    
    int64_t nest_sizze_210118 = partition_sizze_203577 * t_n_m_203650;
    int64_t segmap_group_sizze_210119;
    
    segmap_group_sizze_210119 =
        *ctx->tuning_params.mainzisegmap_group_sizze_209833;
    
    int64_t binop_y_229426 = (int64_t) 8 * nest_sizze_210118;
    int64_t bytes_229427 = smax64((int64_t) 0, binop_y_229426);
    int64_t binop_y_229419 = (int64_t) 8 * t_n_m_203650;
    int64_t bytes_229420 = smax64((int64_t) 0, binop_y_229419);
    struct memblock_device ext_mem_229461;
    
    ext_mem_229461.references = NULL;
    
    struct memblock_device ext_mem_229460;
    
    ext_mem_229460.references = NULL;
    
    int32_t local_memory_capacity_232961;
    
    local_memory_capacity_232961 = ctx->cuda.max_shared_memory;
    if (sle64(bytes_229420 + srem64((int64_t) 8 - srem64(bytes_229420,
                                                         (int64_t) 8),
                                    (int64_t) 8) + (bytes_229420 +
                                                    srem64((int64_t) 8 -
                                                           srem64(bytes_229420,
                                                                  (int64_t) 8),
                                                           (int64_t) 8)) +
              (bytes_229169 + srem64((int64_t) 8 - srem64(bytes_229169,
                                                          (int64_t) 8),
                                     (int64_t) 8)),
              sext_i32_i64(local_memory_capacity_232961)) &&
        intra_suff_and_fits_209704) {
        struct memblock_device mem_229428;
        
        mem_229428.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229428, bytes_229427,
                                  "mem_229428")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_229432;
        
        mem_229432.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229432, bytes_229427,
                                  "mem_229432")) {
            err = 1;
            goto cleanup;
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegMap");
        
        unsigned int shared_sizze_237344 = bytes_229169;
        unsigned int shared_sizze_237346 = bytes_229420;
        unsigned int shared_sizze_237348 = bytes_229420;
        CUdeviceptr kernel_arg_237350 = ext_mem_229196.mem;
        CUdeviceptr kernel_arg_237351 = ext_mem_229197.mem;
        CUdeviceptr kernel_arg_237352 = mem_229428.mem;
        CUdeviceptr kernel_arg_237353 = mem_229432.mem;
        unsigned int shared_offset_237345 = 0;
        unsigned int shared_offset_237347 = 0 + (shared_sizze_237344 + (8 -
                                                                        shared_sizze_237344 %
                                                                        8) % 8);
        unsigned int shared_offset_237349 = 0 + (shared_sizze_237344 + (8 -
                                                                        shared_sizze_237344 %
                                                                        8) %
                                                 8) + (shared_sizze_237346 +
                                                       (8 -
                                                        shared_sizze_237346 %
                                                        8) % 8);
        
        if ((((((1 && partition_sizze_203577 != 0) && 1 != 0) && 1 != 0) &&
              computed_group_sizze_209599 != 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_203577;
            grid[perm[1]] = 1;
            grid[perm[2]] = 1;
            
            void *kernel_args_237341[] = {&ctx->global_failure,
                                          &ctx->failure_is_an_option,
                                          &ctx->global_failure_args,
                                          &shared_offset_237345,
                                          &shared_offset_237347,
                                          &shared_offset_237349, &n_203490,
                                          &q_t_203494, &jump_t_203500,
                                          &partition_sizze_203577,
                                          &t_n_m_203650, &i_203670, &x_203671,
                                          &min_res_203993, &loop_cond_203998,
                                          &i64_res_203999,
                                          &computed_group_sizze_209599,
                                          &kernel_arg_237350,
                                          &kernel_arg_237351,
                                          &kernel_arg_237352,
                                          &kernel_arg_237353};
            int64_t time_start_237342 = 0, time_end_237343 = 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_209708",
                        (long) partition_sizze_203577, (long) 1, (long) 1,
                        (long) computed_group_sizze_209599, (long) 1, (long) 1,
                        (int) (0 + (shared_sizze_237344 + (8 -
                                                           shared_sizze_237344 %
                                                           8) % 8) +
                               (shared_sizze_237346 + (8 - shared_sizze_237346 %
                                                       8) % 8) +
                               (shared_sizze_237348 + (8 - shared_sizze_237348 %
                                                       8) % 8)));
                time_start_237342 = get_wall_time();
            }
            
            cudaEvent_t *pevents = NULL;
            
            if (ctx->profiling && !ctx->profiling_paused) {
                pevents = cuda_get_events(&ctx->cuda,
                                          &ctx->mainzisegmap_intragroup_209708_runs,
                                          &ctx->mainzisegmap_intragroup_209708_total_runtime);
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
            }
            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_intragroup_209708,
                                                  grid[0], grid[1], grid[2],
                                                  computed_group_sizze_209599,
                                                  1, 1, 0 +
                                                  (shared_sizze_237344 + (8 -
                                                                          shared_sizze_237344 %
                                                                          8) %
                                                   8) + (shared_sizze_237346 +
                                                         (8 -
                                                          shared_sizze_237346 %
                                                          8) % 8) +
                                                  (shared_sizze_237348 + (8 -
                                                                          shared_sizze_237348 %
                                                                          8) %
                                                   8), NULL, kernel_args_237341,
                                                  NULL));
            if (pevents != NULL)
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
            if (ctx->debugging) {
                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                time_end_237343 = get_wall_time();
                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                        "main.segmap_intragroup_209708", time_end_237343 -
                        time_start_237342);
            }
        }
        ctx->failure_is_an_option = 1;
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "");
        if (memblock_set_device(ctx, &ext_mem_229461, &mem_229428,
                                "mem_229428") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_229460, &mem_229432,
                                "mem_229432") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229432, "mem_229432") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229428, "mem_229428") != 0)
            return 1;
    } else {
        int64_t segmap_usable_groups_210088 = sdiv_up64(nest_sizze_207000,
                                                        segmap_group_sizze_210087);
        struct memblock_device mem_229437;
        
        mem_229437.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229437, bytes_229177,
                                  "mem_229437")) {
            err = 1;
            goto cleanup;
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegMap");
        
        CUdeviceptr kernel_arg_237357 = ext_mem_229197.mem;
        CUdeviceptr kernel_arg_237358 = mem_229437.mem;
        
        if ((((((1 && segmap_usable_groups_210088 != 0) && 1 != 0) && 1 != 0) &&
              segmap_group_sizze_210087 != 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_210088;
            grid[perm[1]] = 1;
            grid[perm[2]] = 1;
            
            void *kernel_args_237354[] = {&ctx->global_failure, &n_203490,
                                          &partition_sizze_203577,
                                          &kernel_arg_237357,
                                          &kernel_arg_237358};
            int64_t time_start_237355 = 0, time_end_237356 = 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_210092",
                        (long) segmap_usable_groups_210088, (long) 1, (long) 1,
                        (long) segmap_group_sizze_210087, (long) 1, (long) 1,
                        (int) 0);
                time_start_237355 = get_wall_time();
            }
            
            cudaEvent_t *pevents = NULL;
            
            if (ctx->profiling && !ctx->profiling_paused) {
                pevents = cuda_get_events(&ctx->cuda,
                                          &ctx->mainzisegmap_210092_runs,
                                          &ctx->mainzisegmap_210092_total_runtime);
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
            }
            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_210092,
                                                  grid[0], grid[1], grid[2],
                                                  segmap_group_sizze_210087, 1,
                                                  1, 0, NULL,
                                                  kernel_args_237354, NULL));
            if (pevents != NULL)
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
            if (ctx->debugging) {
                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                time_end_237356 = get_wall_time();
                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                        "main.segmap_210092", time_end_237356 -
                        time_start_237355);
            }
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "");
        
        int64_t segmap_usable_groups_210098 = sdiv_up64(partition_sizze_203577,
                                                        segmap_group_sizze_210097);
        struct memblock_device mem_229441;
        
        mem_229441.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229441, bytes_229180,
                                  "mem_229441")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_229444;
        
        mem_229444.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229444, bytes_229180,
                                  "mem_229444")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_229447;
        
        mem_229447.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229447, bytes_229180,
                                  "mem_229447")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_229450;
        
        mem_229450.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229450, bytes_229180,
                                  "mem_229450")) {
            err = 1;
            goto cleanup;
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegMap");
        
        CUdeviceptr kernel_arg_237362 = ext_mem_229196.mem;
        CUdeviceptr kernel_arg_237363 = mem_229441.mem;
        CUdeviceptr kernel_arg_237364 = mem_229444.mem;
        CUdeviceptr kernel_arg_237365 = mem_229447.mem;
        CUdeviceptr kernel_arg_237366 = mem_229450.mem;
        
        if ((((((1 && segmap_usable_groups_210098 != 0) && 1 != 0) && 1 != 0) &&
              segmap_group_sizze_210097 != 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_210098;
            grid[perm[1]] = 1;
            grid[perm[2]] = 1;
            
            void *kernel_args_237359[] = {&ctx->global_failure, &q_t_203494,
                                          &partition_sizze_203577,
                                          &min_res_203993, &i64_res_203999,
                                          &kernel_arg_237362,
                                          &kernel_arg_237363,
                                          &kernel_arg_237364,
                                          &kernel_arg_237365,
                                          &kernel_arg_237366};
            int64_t time_start_237360 = 0, time_end_237361 = 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_210104",
                        (long) segmap_usable_groups_210098, (long) 1, (long) 1,
                        (long) segmap_group_sizze_210097, (long) 1, (long) 1,
                        (int) 0);
                time_start_237360 = get_wall_time();
            }
            
            cudaEvent_t *pevents = NULL;
            
            if (ctx->profiling && !ctx->profiling_paused) {
                pevents = cuda_get_events(&ctx->cuda,
                                          &ctx->mainzisegmap_210104_runs,
                                          &ctx->mainzisegmap_210104_total_runtime);
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
            }
            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_210104,
                                                  grid[0], grid[1], grid[2],
                                                  segmap_group_sizze_210097, 1,
                                                  1, 0, NULL,
                                                  kernel_args_237359, NULL));
            if (pevents != NULL)
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
            if (ctx->debugging) {
                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                time_end_237361 = get_wall_time();
                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                        "main.segmap_210104", time_end_237361 -
                        time_start_237360);
            }
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "");
        
        int64_t segmap_usable_groups_210120 = sdiv_up64(nest_sizze_210118,
                                                        segmap_group_sizze_210119);
        struct memblock_device mem_229455;
        
        mem_229455.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229455, bytes_229427,
                                  "mem_229455")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_229459;
        
        mem_229459.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229459, bytes_229427,
                                  "mem_229459")) {
            err = 1;
            goto cleanup;
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegMap");
        
        CUdeviceptr kernel_arg_237370 = ext_mem_229197.mem;
        CUdeviceptr kernel_arg_237371 = mem_229437.mem;
        CUdeviceptr kernel_arg_237372 = mem_229441.mem;
        CUdeviceptr kernel_arg_237373 = mem_229444.mem;
        CUdeviceptr kernel_arg_237374 = mem_229447.mem;
        CUdeviceptr kernel_arg_237375 = mem_229450.mem;
        CUdeviceptr kernel_arg_237376 = mem_229455.mem;
        CUdeviceptr kernel_arg_237377 = mem_229459.mem;
        
        if ((((((1 && segmap_usable_groups_210120 != 0) && 1 != 0) && 1 != 0) &&
              segmap_group_sizze_210119 != 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_210120;
            grid[perm[1]] = 1;
            grid[perm[2]] = 1;
            
            void *kernel_args_237367[] = {&ctx->global_failure,
                                          &ctx->failure_is_an_option,
                                          &ctx->global_failure_args, &n_203490,
                                          &jump_t_203500,
                                          &partition_sizze_203577,
                                          &t_n_m_203650, &i_203670, &x_203671,
                                          &min_res_203993, &loop_cond_203998,
                                          &kernel_arg_237370,
                                          &kernel_arg_237371,
                                          &kernel_arg_237372,
                                          &kernel_arg_237373,
                                          &kernel_arg_237374,
                                          &kernel_arg_237375,
                                          &kernel_arg_237376,
                                          &kernel_arg_237377};
            int64_t time_start_237368 = 0, time_end_237369 = 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_210125",
                        (long) segmap_usable_groups_210120, (long) 1, (long) 1,
                        (long) segmap_group_sizze_210119, (long) 1, (long) 1,
                        (int) 0);
                time_start_237368 = get_wall_time();
            }
            
            cudaEvent_t *pevents = NULL;
            
            if (ctx->profiling && !ctx->profiling_paused) {
                pevents = cuda_get_events(&ctx->cuda,
                                          &ctx->mainzisegmap_210125_runs,
                                          &ctx->mainzisegmap_210125_total_runtime);
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
            }
            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_210125,
                                                  grid[0], grid[1], grid[2],
                                                  segmap_group_sizze_210119, 1,
                                                  1, 0, NULL,
                                                  kernel_args_237367, NULL));
            if (pevents != NULL)
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
            if (ctx->debugging) {
                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                time_end_237369 = get_wall_time();
                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                        "main.segmap_210125", time_end_237369 -
                        time_start_237368);
            }
        }
        ctx->failure_is_an_option = 1;
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "");
        if (memblock_unref_device(ctx, &mem_229437, "mem_229437") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229441, "mem_229441") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229444, "mem_229444") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229447, "mem_229447") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229450, "mem_229450") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_229461, &mem_229459,
                                "mem_229459") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_229460, &mem_229455,
                                "mem_229455") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229459, "mem_229459") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229455, "mem_229455") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229450, "mem_229450") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229447, "mem_229447") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229444, "mem_229444") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229441, "mem_229441") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229437, "mem_229437") != 0)
            return 1;
    }
    
    struct memblock_device mem_229465;
    
    mem_229465.references = NULL;
    if (memblock_alloc_device(ctx, &mem_229465, bytes_229177, "mem_229465")) {
        err = 1;
        goto cleanup;
    }
    if (futrts_builtinzhreplicate_f64(ctx, mem_229465, partition_sizze_203577 *
                                      n_203490, 0.0) != 0) {
        if (memblock_unref_device(ctx, &mem_229465, "mem_229465") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229460, "ext_mem_229460") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229461, "ext_mem_229461") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229411, "ext_mem_229411") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229412, "ext_mem_229412") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229362, "ext_mem_229362") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229363, "ext_mem_229363") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229264, "ext_mem_229264") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229265, "ext_mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229206, "mem_229206") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229200, "mem_229200") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229196, "ext_mem_229196") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229197, "ext_mem_229197") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    struct memblock_device mem_229469;
    
    mem_229469.references = NULL;
    if (memblock_alloc_device(ctx, &mem_229469, bytes_229177, "mem_229469")) {
        err = 1;
        goto cleanup;
    }
    if (futrts_builtinzhreplicate_f64(ctx, mem_229469, partition_sizze_203577 *
                                      n_203490, 1.0) != 0) {
        if (memblock_unref_device(ctx, &mem_229469, "mem_229469") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229465, "mem_229465") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229460, "ext_mem_229460") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229461, "ext_mem_229461") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229411, "ext_mem_229411") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229412, "ext_mem_229412") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229362, "ext_mem_229362") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229363, "ext_mem_229363") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229264, "ext_mem_229264") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229265, "ext_mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229206, "mem_229206") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229200, "mem_229200") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229196, "ext_mem_229196") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229197, "ext_mem_229197") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool cond_204107 = slt64((int64_t) 1, jump_l_203501);
    bool cond_204108 = slt64((int64_t) 1, jump_t_203500);
    int64_t y_204109 = sub64(n_outer_203503, (int64_t) 1);
    int64_t css_results_l_204110;
    
    if (cond_203635) {
        css_results_l_204110 = s_n_m_203636;
    } else {
        css_results_l_204110 = pad_css_len_203632;
    }
    
    bool zzero_204111 = n_p_203492 == (int64_t) 0;
    bool nonzzero_204112 = !zzero_204111;
    bool loop_not_taken_204113 = !assert_cond_203626;
    bool protect_assert_disj_204114 = nonzzero_204112 || loop_not_taken_204113;
    bool loop_not_taken_204115 = !assert_cond_203628;
    bool protect_assert_disj_204116 = protect_assert_disj_204114 ||
         loop_not_taken_204115;
    bool nonzzero_cert_204117;
    
    if (!protect_assert_disj_204116) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "division by zero",
                               "-> #0  stl.fut:226:51-57\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:226:28-74\n   #5  stl.fut:225:21-227:39\n   #6  stl.fut:415:61-429:75\n   #7  stl.fut:455:3-469:34\n   #8  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229469, "mem_229469") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229465, "mem_229465") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229460, "ext_mem_229460") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229461, "ext_mem_229461") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229411, "ext_mem_229411") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229412, "ext_mem_229412") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229362, "ext_mem_229362") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229363, "ext_mem_229363") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229264, "ext_mem_229264") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229265, "ext_mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229206, "mem_229206") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229200, "mem_229200") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229196, "ext_mem_229196") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229197, "ext_mem_229197") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t j_204118 = add64(n_203490, n_p_203492);
    bool empty_slice_204119 = n_203490 == (int64_t) 0;
    int64_t i_p_m_t_s_204120 = add64(n_p_203492, i_203670);
    bool zzero_leq_i_p_m_t_s_204121 = sle64((int64_t) 0, i_p_m_t_s_204120);
    bool i_p_m_t_s_leq_w_204122 = slt64(i_p_m_t_s_204120, C_len_203634);
    bool zzero_lte_i_204123 = sle64((int64_t) 0, n_p_203492);
    bool i_lte_j_204124 = sle64(n_p_203492, j_204118);
    bool y_204125 = i_p_m_t_s_leq_w_204122 && zzero_lte_i_204123;
    bool y_204126 = zzero_leq_i_p_m_t_s_204121 && y_204125;
    bool y_204127 = i_lte_j_204124 && y_204126;
    bool forwards_ok_204128 = zzero_lte_i_204123 && y_204127;
    bool ok_or_empty_204129 = empty_slice_204119 || forwards_ok_204128;
    bool protect_assert_disj_204130 = loop_not_taken_204113 ||
         ok_or_empty_204129;
    bool protect_assert_disj_204131 = loop_not_taken_204115 ||
         protect_assert_disj_204130;
    bool index_certs_204132;
    
    if (!protect_assert_disj_204131) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Index [", (long long) n_p_203492, ":",
                               (long long) j_204118,
                               "] out of bounds for array of shape [",
                               (long long) C_len_203634, "].",
                               "-> #0  stl.fut:262:35-50\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  stl.fut:260:13-265:26\n   #4  stl.fut:415:61-429:75\n   #5  stl.fut:455:3-469:34\n   #6  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229469, "mem_229469") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229465, "mem_229465") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229460, "ext_mem_229460") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229461, "ext_mem_229461") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229411, "ext_mem_229411") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229412, "ext_mem_229412") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229362, "ext_mem_229362") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229363, "ext_mem_229363") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229264, "ext_mem_229264") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229265, "ext_mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229206, "mem_229206") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229200, "mem_229200") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229196, "ext_mem_229196") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229197, "ext_mem_229197") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t j_m_i_204133 = sub64(stl_res_203665, stl_res_203664);
    int64_t lifted_single_ma_l_arg_204134 = add64((int64_t) 1, j_204118);
    int64_t m_204135 = sub64(n_p_203492, (int64_t) 1);
    bool zzero_leq_i_p_m_t_s_204136 = sle64((int64_t) 0, m_204135);
    bool i_p_m_t_s_leq_w_204137 = slt64(m_204135, C_len_203634);
    bool y_204138 = zzero_leq_i_p_m_t_s_204136 && i_p_m_t_s_leq_w_204137;
    bool y_204139 = zzero_lte_i_204123 && y_204138;
    bool ok_or_empty_204140 = zzero_204111 || y_204139;
    bool protect_assert_disj_204141 = loop_not_taken_204113 ||
         ok_or_empty_204140;
    bool protect_assert_disj_204142 = loop_not_taken_204115 ||
         protect_assert_disj_204141;
    bool index_certs_204143;
    
    if (!protect_assert_disj_204142) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Index [:", (long long) n_p_203492,
                               "] out of bounds for array of shape [",
                               (long long) C_len_203634, "].",
                               "-> #0  stl.fut:24:37-43\n   #1  stl.fut:24:20-48\n   #2  stl.fut:38:3-36\n   #3  stl.fut:231:23-47\n   #4  stl.fut:415:61-429:75\n   #5  stl.fut:455:3-469:34\n   #6  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229469, "mem_229469") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229465, "mem_229465") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229460, "ext_mem_229460") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229461, "ext_mem_229461") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229411, "ext_mem_229411") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229412, "ext_mem_229412") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229362, "ext_mem_229362") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229363, "ext_mem_229363") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229264, "ext_mem_229264") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229265, "ext_mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229206, "mem_229206") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229200, "mem_229200") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229196, "ext_mem_229196") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229197, "ext_mem_229197") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t dyn_lifted_single_ma_l_arg_204144 = add64((int64_t) 2, n_203490);
    bool i_p_m_t_s_leq_w_204145 = slt64(m_204135,
                                        lifted_single_ma_l_arg_204134);
    bool y_204146 = zzero_leq_i_p_m_t_s_204136 && i_p_m_t_s_leq_w_204145;
    bool y_204147 = zzero_lte_i_204123 && y_204146;
    bool ok_or_empty_204148 = zzero_204111 || y_204147;
    bool protect_assert_disj_204149 = loop_not_taken_204113 ||
         ok_or_empty_204148;
    bool protect_assert_disj_204150 = loop_not_taken_204115 ||
         protect_assert_disj_204149;
    bool index_certs_204151;
    
    if (!protect_assert_disj_204150) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Index [:", (long long) n_p_203492,
                               "] out of bounds for array of shape [",
                               (long long) lifted_single_ma_l_arg_204134, "].",
                               "-> #0  stl.fut:24:37-43\n   #1  stl.fut:24:20-48\n   #2  /prelude/functional.fut:9:42-44\n   #3  stl.fut:38:3-64\n   #4  stl.fut:231:23-47\n   #5  stl.fut:415:61-429:75\n   #6  stl.fut:455:3-469:34\n   #7  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229469, "mem_229469") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229465, "mem_229465") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229460, "ext_mem_229460") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229461, "ext_mem_229461") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229411, "ext_mem_229411") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229412, "ext_mem_229412") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229362, "ext_mem_229362") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229363, "ext_mem_229363") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229264, "ext_mem_229264") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229265, "ext_mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229206, "mem_229206") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229200, "mem_229200") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229196, "ext_mem_229196") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229197, "ext_mem_229197") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool i_p_m_t_s_leq_w_204152 = slt64((int64_t) 2,
                                        dyn_lifted_single_ma_l_arg_204144);
    bool protect_assert_disj_204153 = loop_not_taken_204113 ||
         i_p_m_t_s_leq_w_204152;
    bool protect_assert_disj_204154 = loop_not_taken_204115 ||
         protect_assert_disj_204153;
    bool index_certs_204155;
    
    if (!protect_assert_disj_204154) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Index [:", (long long) (int64_t) 3,
                               "] out of bounds for array of shape [",
                               (long long) dyn_lifted_single_ma_l_arg_204144,
                               "].",
                               "-> #0  stl.fut:24:37-43\n   #1  stl.fut:24:20-48\n   #2  /prelude/functional.fut:9:42-44\n   #3  stl.fut:38:3-84\n   #4  stl.fut:231:23-47\n   #5  stl.fut:415:61-429:75\n   #6  stl.fut:455:3-469:34\n   #7  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229469, "mem_229469") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229465, "mem_229465") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229460, "ext_mem_229460") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229461, "ext_mem_229461") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229411, "ext_mem_229411") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229412, "ext_mem_229412") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229362, "ext_mem_229362") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229363, "ext_mem_229363") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229264, "ext_mem_229264") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229265, "ext_mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229206, "mem_229206") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229200, "mem_229200") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229196, "ext_mem_229196") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229197, "ext_mem_229197") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool cond_204156 = slt64(jump_l_203501, jump_threshold_203504);
    bool cond_f_res_204157 = slt64(q_threshold_203505, q_l_203495);
    bool x_204158 = !cond_204156;
    bool y_204159 = cond_f_res_204157 && x_204158;
    bool cond_204160 = cond_204156 || y_204159;
    bool cond_204161 = slt64(jump_t_203500, jump_threshold_203504);
    bool cond_f_res_204162 = slt64(q_threshold_203505, q_t_203494);
    bool x_204163 = !cond_204161;
    bool y_204164 = cond_f_res_204162 && x_204163;
    bool cond_204165 = cond_204161 || y_204164;
    bool cond_204166 = slt64(jump_s_203499, jump_threshold_203504);
    bool cond_f_res_204167 = slt64(q_threshold_203505, q_s_203493);
    bool x_204168 = !cond_204166;
    bool y_204169 = cond_f_res_204167 && x_204168;
    bool cond_204170 = cond_204166 || y_204169;
    bool bounds_invalid_upwards_204171 = slt64(C_len_203634, (int64_t) 0);
    bool valid_204172 = !bounds_invalid_upwards_204171;
    bool protect_assert_disj_204173 = loop_not_taken_204113 || valid_204172;
    bool protect_assert_disj_204174 = loop_not_taken_204115 ||
         protect_assert_disj_204173;
    bool range_valid_c_204175;
    
    if (!protect_assert_disj_204174) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Range ", (long long) (int64_t) 0, "..",
                               (long long) (int64_t) 1, "..<",
                               (long long) C_len_203634, " is invalid.",
                               "-> #0  /prelude/array.fut:90:3-10\n   #1  /prelude/array.fut:195:11-16\n   #2  utils.fut:6:3-16\n   #3  stl.fut:226:28-74\n   #4  stl.fut:225:21-227:39\n   #5  stl.fut:415:61-429:75\n   #6  stl.fut:455:3-469:34\n   #7  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229469, "mem_229469") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229465, "mem_229465") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229460, "ext_mem_229460") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229461, "ext_mem_229461") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229411, "ext_mem_229411") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229412, "ext_mem_229412") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229362, "ext_mem_229362") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229363, "ext_mem_229363") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229264, "ext_mem_229264") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229265, "ext_mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229206, "mem_229206") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229200, "mem_229200") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229196, "ext_mem_229196") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229197, "ext_mem_229197") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool bounds_invalid_upwards_204177 = slt64(lifted_single_ma_l_arg_204134,
                                               (int64_t) 0);
    bool valid_204178 = !bounds_invalid_upwards_204177;
    bool protect_assert_disj_204179 = loop_not_taken_204113 || valid_204178;
    bool protect_assert_disj_204180 = loop_not_taken_204115 ||
         protect_assert_disj_204179;
    bool range_valid_c_204181;
    
    if (!protect_assert_disj_204180) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Range ", (long long) (int64_t) 0, "..",
                               (long long) (int64_t) 1, "..<",
                               (long long) lifted_single_ma_l_arg_204134,
                               " is invalid.",
                               "-> #0  /prelude/array.fut:90:3-10\n   #1  /prelude/array.fut:195:11-16\n   #2  utils.fut:6:3-16\n   #3  stl.fut:27:13-33:19\n   #4  /prelude/soacs.fut:67:19-23\n   #5  /prelude/soacs.fut:67:3-37\n   #6  stl.fut:26:5-34:23\n   #7  stl.fut:38:3-36\n   #8  stl.fut:231:23-47\n   #9  stl.fut:415:61-429:75\n   #10 stl.fut:455:3-469:34\n   #11 stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229469, "mem_229469") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229465, "mem_229465") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229460, "ext_mem_229460") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229461, "ext_mem_229461") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229411, "ext_mem_229411") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229412, "ext_mem_229412") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229362, "ext_mem_229362") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229363, "ext_mem_229363") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229264, "ext_mem_229264") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229265, "ext_mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229206, "mem_229206") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229200, "mem_229200") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229196, "ext_mem_229196") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229197, "ext_mem_229197") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool bounds_invalid_upwards_204183 =
         slt64(dyn_lifted_single_ma_l_arg_204144, (int64_t) 0);
    bool valid_204184 = !bounds_invalid_upwards_204183;
    bool protect_assert_disj_204185 = loop_not_taken_204113 || valid_204184;
    bool protect_assert_disj_204186 = loop_not_taken_204115 ||
         protect_assert_disj_204185;
    bool range_valid_c_204187;
    
    if (!protect_assert_disj_204186) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Range ", (long long) (int64_t) 0, "..",
                               (long long) (int64_t) 1, "..<",
                               (long long) dyn_lifted_single_ma_l_arg_204144,
                               " is invalid.",
                               "-> #0  /prelude/array.fut:90:3-10\n   #1  /prelude/array.fut:195:11-16\n   #2  utils.fut:6:3-16\n   #3  stl.fut:27:13-33:19\n   #4  /prelude/soacs.fut:67:19-23\n   #5  /prelude/soacs.fut:67:3-37\n   #6  stl.fut:26:5-34:23\n   #7  /prelude/functional.fut:9:42-44\n   #8  stl.fut:38:3-64\n   #9  stl.fut:231:23-47\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229469, "mem_229469") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229465, "mem_229465") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229460, "ext_mem_229460") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229461, "ext_mem_229461") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229411, "ext_mem_229411") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229412, "ext_mem_229412") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229362, "ext_mem_229362") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229363, "ext_mem_229363") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229264, "ext_mem_229264") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229265, "ext_mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229206, "mem_229206") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229200, "mem_229200") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229196, "ext_mem_229196") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229197, "ext_mem_229197") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t segmap_group_sizze_210262;
    
    segmap_group_sizze_210262 =
        *ctx->tuning_params.mainzisegmap_group_sizze_210236;
    
    int64_t segmap_usable_groups_210263 = sdiv_up_safe64(nest_sizze_207000,
                                                         segmap_group_sizze_210262);
    int64_t segmap_group_sizze_210405;
    
    segmap_group_sizze_210405 =
        *ctx->tuning_params.mainzisegmap_group_sizze_210299;
    
    int64_t segmap_usable_groups_210406 = sdiv_up_safe64(nest_sizze_207163,
                                                         segmap_group_sizze_210405);
    int64_t nest_sizze_218556 = partition_sizze_203577 * C_len_203634;
    int64_t segmap_group_sizze_218557;
    
    segmap_group_sizze_218557 =
        *ctx->tuning_params.mainzisegmap_group_sizze_218511;
    
    int64_t segmap_usable_groups_218558 = sdiv_up_safe64(nest_sizze_218556,
                                                         segmap_group_sizze_218557);
    bool suff_outer_par_218578;
    
    suff_outer_par_218578 = *ctx->tuning_params.mainzisuff_outer_par_19 <=
        partition_sizze_203577;
    if (ctx->logging)
        fprintf(ctx->log, "Compared %s <= %ld: %s.\n", "main.suff_outer_par_19",
                (long) partition_sizze_203577,
                suff_outer_par_218578 ? "true" : "false");
    
    int64_t segmap_group_sizze_218594;
    
    segmap_group_sizze_218594 =
        *ctx->tuning_params.mainzisegmap_group_sizze_218582;
    
    int64_t segred_group_sizze_218625;
    
    segred_group_sizze_218625 =
        *ctx->tuning_params.mainzisegred_group_sizze_218608;
    
    int64_t num_groups_218626;
    int32_t max_num_groups_232974;
    
    max_num_groups_232974 = *ctx->tuning_params.mainzisegred_num_groups_218610;
    num_groups_218626 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(binop_x_229202,
                                                             segred_group_sizze_218625),
                                                   sext_i32_i64(max_num_groups_232974))));
    
    int64_t nest_sizze_218676 = partition_sizze_203577 *
            lifted_single_ma_l_arg_204134;
    int64_t segscan_group_sizze_218677;
    
    segscan_group_sizze_218677 =
        *ctx->tuning_params.mainzisegscan_group_sizze_218641;
    
    int64_t num_groups_218678;
    int32_t max_num_groups_232975;
    
    max_num_groups_232975 = *ctx->tuning_params.mainzisegscan_num_groups_218643;
    num_groups_218678 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(nest_sizze_218676,
                                                             segscan_group_sizze_218677),
                                                   sext_i32_i64(max_num_groups_232975))));
    
    bool suff_outer_par_218709;
    
    suff_outer_par_218709 = *ctx->tuning_params.mainzisuff_outer_par_20 <=
        partition_sizze_203577;
    if (ctx->logging)
        fprintf(ctx->log, "Compared %s <= %ld: %s.\n", "main.suff_outer_par_20",
                (long) partition_sizze_203577,
                suff_outer_par_218709 ? "true" : "false");
    
    int64_t segmap_group_sizze_218725;
    
    segmap_group_sizze_218725 =
        *ctx->tuning_params.mainzisegmap_group_sizze_218713;
    
    int64_t segred_group_sizze_218756;
    
    segred_group_sizze_218756 =
        *ctx->tuning_params.mainzisegred_group_sizze_218739;
    
    int64_t num_groups_218757;
    int32_t max_num_groups_232976;
    
    max_num_groups_232976 = *ctx->tuning_params.mainzisegred_num_groups_218741;
    num_groups_218757 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(binop_x_229202,
                                                             segred_group_sizze_218756),
                                                   sext_i32_i64(max_num_groups_232976))));
    
    int64_t nest_sizze_218807 = partition_sizze_203577 *
            dyn_lifted_single_ma_l_arg_204144;
    int64_t segscan_group_sizze_218808;
    
    segscan_group_sizze_218808 =
        *ctx->tuning_params.mainzisegscan_group_sizze_218772;
    
    int64_t num_groups_218809;
    int32_t max_num_groups_232977;
    
    max_num_groups_232977 = *ctx->tuning_params.mainzisegscan_num_groups_218774;
    num_groups_218809 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(nest_sizze_218807,
                                                             segscan_group_sizze_218808),
                                                   sext_i32_i64(max_num_groups_232977))));
    
    bool suff_outer_par_218840;
    
    suff_outer_par_218840 = *ctx->tuning_params.mainzisuff_outer_par_21 <=
        partition_sizze_203577;
    if (ctx->logging)
        fprintf(ctx->log, "Compared %s <= %ld: %s.\n", "main.suff_outer_par_21",
                (long) partition_sizze_203577,
                suff_outer_par_218840 ? "true" : "false");
    
    int64_t segmap_group_sizze_218856;
    
    segmap_group_sizze_218856 =
        *ctx->tuning_params.mainzisegmap_group_sizze_218844;
    
    int64_t nest_sizze_218886 = (int64_t) 3 * partition_sizze_203577;
    int64_t segred_group_sizze_218887;
    
    segred_group_sizze_218887 =
        *ctx->tuning_params.mainzisegred_group_sizze_218870;
    
    int64_t num_groups_218888;
    int32_t max_num_groups_232978;
    
    max_num_groups_232978 = *ctx->tuning_params.mainzisegred_num_groups_218872;
    num_groups_218888 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(nest_sizze_218886,
                                                             segred_group_sizze_218887),
                                                   sext_i32_i64(max_num_groups_232978))));
    
    int64_t segscan_group_sizze_218939;
    
    segscan_group_sizze_218939 =
        *ctx->tuning_params.mainzisegscan_group_sizze_218903;
    
    int64_t num_groups_218940;
    int32_t max_num_groups_232979;
    
    max_num_groups_232979 = *ctx->tuning_params.mainzisegscan_num_groups_218905;
    num_groups_218940 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(nest_sizze_207000,
                                                             segscan_group_sizze_218939),
                                                   sext_i32_i64(max_num_groups_232979))));
    
    int64_t segmap_group_sizze_222439;
    
    segmap_group_sizze_222439 =
        *ctx->tuning_params.mainzisegmap_group_sizze_222413;
    
    int64_t segmap_usable_groups_222440 = sdiv_up_safe64(nest_sizze_207000,
                                                         segmap_group_sizze_222439);
    int64_t segmap_usable_groups_218595 = sdiv_up_safe64(partition_sizze_203577,
                                                         segmap_group_sizze_218594);
    int64_t segmap_usable_groups_218726 = sdiv_up_safe64(partition_sizze_203577,
                                                         segmap_group_sizze_218725);
    int64_t segmap_usable_groups_218857 = sdiv_up_safe64(partition_sizze_203577,
                                                         segmap_group_sizze_218856);
    struct memblock_device mem_229520;
    
    mem_229520.references = NULL;
    if (memblock_alloc_device(ctx, &mem_229520, bytes_229177, "mem_229520")) {
        err = 1;
        goto cleanup;
    }
    
    struct memblock_device mem_229526;
    
    mem_229526.references = NULL;
    if (memblock_alloc_device(ctx, &mem_229526, bytes_229205, "mem_229526")) {
        err = 1;
        goto cleanup;
    }
    
    struct memblock_device mem_229531;
    
    mem_229531.references = NULL;
    if (memblock_alloc_device(ctx, &mem_229531, bytes_229205, "mem_229531")) {
        err = 1;
        goto cleanup;
    }
    
    int64_t binop_x_230490 = pad_css_len_203632 * binop_x_229202;
    int64_t binop_y_230491 = (int64_t) 8 * binop_x_230490;
    int64_t bytes_230492 = smax64((int64_t) 0, binop_y_230491);
    int64_t binop_y_230498 = (int64_t) 8 * nest_sizze_218556;
    int64_t bytes_230499 = smax64((int64_t) 0, binop_y_230498);
    struct memblock_device mem_230500;
    
    mem_230500.references = NULL;
    if (memblock_alloc_device(ctx, &mem_230500, bytes_230499, "mem_230500")) {
        err = 1;
        goto cleanup;
    }
    
    int64_t binop_y_230515 = (int64_t) 8 * nest_sizze_218676;
    int64_t bytes_230516 = smax64((int64_t) 0, binop_y_230515);
    struct memblock_device mem_230517;
    
    mem_230517.references = NULL;
    if (memblock_alloc_device(ctx, &mem_230517, bytes_230516, "mem_230517")) {
        err = 1;
        goto cleanup;
    }
    
    int64_t binop_y_230532 = (int64_t) 8 * nest_sizze_218807;
    int64_t bytes_230533 = smax64((int64_t) 0, binop_y_230532);
    struct memblock_device mem_230534;
    
    mem_230534.references = NULL;
    if (memblock_alloc_device(ctx, &mem_230534, bytes_230533, "mem_230534")) {
        err = 1;
        goto cleanup;
    }
    
    struct memblock_device mem_230551;
    
    mem_230551.references = NULL;
    if (memblock_alloc_device(ctx, &mem_230551, bytes_229177, "mem_230551")) {
        err = 1;
        goto cleanup;
    }
    
    int64_t ext_230915;
    
    if (cond_204107) {
        ext_230915 = n_203490;
    } else {
        ext_230915 = l_n_m_203643;
    }
    
    int64_t ext_231512;
    
    if (cond_204108) {
        ext_231512 = n_203490;
    } else {
        ext_231512 = t_n_m_203650;
    }
    
    int64_t ext_231875;
    int64_t ext_231873;
    int64_t ext_231869;
    int64_t ext_231868;
    int64_t ext_231867;
    int64_t ext_231866;
    int64_t ext_231865;
    int64_t ext_231864;
    int64_t ext_231863;
    struct memblock_device ext_mem_231862;
    
    ext_mem_231862.references = NULL;
    
    struct memblock_device ext_mem_231861;
    
    ext_mem_231861.references = NULL;
    
    struct memblock_device ext_mem_231860;
    
    ext_mem_231860.references = NULL;
    
    struct memblock_device mem_param_229477;
    
    mem_param_229477.references = NULL;
    
    int64_t ctx_param_ext_229479;
    int64_t ctx_param_ext_229481;
    struct memblock_device mem_param_229485;
    
    mem_param_229485.references = NULL;
    
    int64_t ctx_param_ext_229486;
    int64_t ctx_param_ext_229487;
    int64_t ctx_param_ext_229488;
    int64_t ctx_param_ext_229489;
    int64_t ctx_param_ext_229490;
    int64_t ctx_param_ext_229491;
    int64_t ctx_param_ext_229492;
    struct memblock_device mem_param_229493;
    
    mem_param_229493.references = NULL;
    ctx_param_ext_229479 = n_203490;
    ctx_param_ext_229481 = n_203490;
    ctx_param_ext_229486 = partition_sizze_203577;
    ctx_param_ext_229487 = n_203490;
    ctx_param_ext_229488 = (int64_t) 0;
    ctx_param_ext_229489 = n_203490;
    ctx_param_ext_229490 = partition_sizze_203577;
    ctx_param_ext_229491 = (int64_t) 1;
    ctx_param_ext_229492 = n_203490;
    if (memblock_set_device(ctx, &mem_param_229477, &mem_229465,
                            "mem_229465") != 0)
        return 1;
    if (memblock_set_device(ctx, &mem_param_229485, &mem_229465,
                            "mem_229465") != 0)
        return 1;
    if (memblock_set_device(ctx, &mem_param_229493, &mem_229469,
                            "mem_229469") != 0)
        return 1;
    for (int64_t i_outer_204192 = 0; i_outer_204192 < n_outer_203503;
         i_outer_204192++) {
        int64_t ext_231524;
        int64_t ext_231522;
        struct memblock_device ext_mem_231518;
        
        ext_mem_231518.references = NULL;
        
        struct memblock_device ext_mem_231517;
        
        ext_mem_231517.references = NULL;
        
        struct memblock_device mem_param_229507;
        
        mem_param_229507.references = NULL;
        
        int64_t ctx_param_ext_229509;
        int64_t ctx_param_ext_229511;
        struct memblock_device mem_param_229515;
        
        mem_param_229515.references = NULL;
        ctx_param_ext_229509 = ctx_param_ext_229479;
        ctx_param_ext_229511 = ctx_param_ext_229481;
        if (memblock_set_device(ctx, &mem_param_229507, &mem_param_229477,
                                "mem_param_229477") != 0)
            return 1;
        if (memblock_set_device(ctx, &mem_param_229515, &mem_param_229485,
                                "mem_param_229485") != 0)
            return 1;
        for (int64_t _i_inner_204198 = 0; _i_inner_204198 < n_inner_203502;
             _i_inner_204198++) {
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            
            CUdeviceptr kernel_arg_237381 = mem_229161.mem;
            CUdeviceptr kernel_arg_237382 = mem_param_229515.mem;
            CUdeviceptr kernel_arg_237383 = mem_229520.mem;
            
            if ((((((1 && segmap_usable_groups_210263 != 0) && 1 != 0) && 1 !=
                   0) && segmap_group_sizze_210262 != 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_210263;
                grid[perm[1]] = 1;
                grid[perm[2]] = 1;
                
                void *kernel_args_237378[] = {&ctx->global_failure, &n_203490,
                                              &partition_sizze_203577,
                                              &ctx_param_ext_229511,
                                              &kernel_arg_237381,
                                              &kernel_arg_237382,
                                              &kernel_arg_237383};
                int64_t time_start_237379 = 0, time_end_237380 = 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_210267",
                            (long) segmap_usable_groups_210263, (long) 1,
                            (long) 1, (long) segmap_group_sizze_210262,
                            (long) 1, (long) 1, (int) 0);
                    time_start_237379 = get_wall_time();
                }
                
                cudaEvent_t *pevents = NULL;
                
                if (ctx->profiling && !ctx->profiling_paused) {
                    pevents = cuda_get_events(&ctx->cuda,
                                              &ctx->mainzisegmap_210267_runs,
                                              &ctx->mainzisegmap_210267_total_runtime);
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                }
                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_210267,
                                                      grid[0], grid[1], grid[2],
                                                      segmap_group_sizze_210262,
                                                      1, 1, 0, NULL,
                                                      kernel_args_237378,
                                                      NULL));
                if (pevents != NULL)
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                if (ctx->debugging) {
                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                    time_end_237380 = get_wall_time();
                    fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                            "main.segmap_210267", time_end_237380 -
                            time_start_237379);
                }
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            
            CUdeviceptr kernel_arg_237387 = ext_mem_229265.mem;
            CUdeviceptr kernel_arg_237388 = mem_param_229493.mem;
            CUdeviceptr kernel_arg_237389 = mem_229520.mem;
            CUdeviceptr kernel_arg_237390 = mem_229526.mem;
            CUdeviceptr kernel_arg_237391 = mem_229531.mem;
            
            if ((((((1 && segmap_usable_groups_210406 != 0) && 1 != 0) && 1 !=
                   0) && segmap_group_sizze_210405 != 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_210406;
                grid[perm[1]] = 1;
                grid[perm[2]] = 1;
                
                void *kernel_args_237384[] = {&ctx->global_failure,
                                              &ctx->failure_is_an_option,
                                              &ctx->global_failure_args,
                                              &n_203490, &n_p_203492,
                                              &partition_sizze_203577,
                                              &defunc_0_f_res_203631, &i_203670,
                                              &ctx_param_ext_229488,
                                              &ctx_param_ext_229489,
                                              &ctx_param_ext_229491,
                                              &kernel_arg_237387,
                                              &kernel_arg_237388,
                                              &kernel_arg_237389,
                                              &kernel_arg_237390,
                                              &kernel_arg_237391};
                int64_t time_start_237385 = 0, time_end_237386 = 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_210412",
                            (long) segmap_usable_groups_210406, (long) 1,
                            (long) 1, (long) segmap_group_sizze_210405,
                            (long) 1, (long) 1, (int) 0);
                    time_start_237385 = get_wall_time();
                }
                
                cudaEvent_t *pevents = NULL;
                
                if (ctx->profiling && !ctx->profiling_paused) {
                    pevents = cuda_get_events(&ctx->cuda,
                                              &ctx->mainzisegmap_210412_runs,
                                              &ctx->mainzisegmap_210412_total_runtime);
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                }
                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_210412,
                                                      grid[0], grid[1], grid[2],
                                                      segmap_group_sizze_210405,
                                                      1, 1, 0, NULL,
                                                      kernel_args_237384,
                                                      NULL));
                if (pevents != NULL)
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                if (ctx->debugging) {
                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                    time_end_237386 = get_wall_time();
                    fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                            "main.segmap_210412", time_end_237386 -
                            time_start_237385);
                }
            }
            ctx->failure_is_an_option = 1;
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            
            struct memblock_device ext_mem_230487;
            
            ext_mem_230487.references = NULL;
            
            struct memblock_device ext_mem_230486;
            
            ext_mem_230486.references = NULL;
            if (cond_204170) {
                bool match_lit_204240 = (int64_t) 0 == d_s_203496;
                struct memblock_device ext_mem_230420;
                
                ext_mem_230420.references = NULL;
                
                struct memblock_device ext_mem_230419;
                
                ext_mem_230419.references = NULL;
                if (match_lit_204240) {
                    struct memblock_device mem_229536;
                    
                    mem_229536.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_229536, bytes_229297,
                                              "mem_229536")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (futrts_builtinzhreplicate_f64(ctx, mem_229536,
                                                      partition_sizze_203577 *
                                                      n_p_203492 * s_n_m_203636,
                                                      0.0) != 0) {
                        if (memblock_unref_device(ctx, &mem_229536,
                                                  "mem_229536") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230419,
                                                  "ext_mem_230419") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230420,
                                                  "ext_mem_230420") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230486,
                                                  "ext_mem_230486") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230487,
                                                  "ext_mem_230487") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229515,
                                                  "mem_param_229515") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229507,
                                                  "mem_param_229507") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231517,
                                                  "ext_mem_231517") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231518,
                                                  "ext_mem_231518") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229493,
                                                  "mem_param_229493") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229485,
                                                  "mem_param_229485") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229477,
                                                  "mem_param_229477") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231860,
                                                  "ext_mem_231860") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231861,
                                                  "ext_mem_231861") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231862,
                                                  "ext_mem_231862") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230551,
                                                  "mem_230551") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230534,
                                                  "mem_230534") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230517,
                                                  "mem_230517") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230500,
                                                  "mem_230500") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229531,
                                                  "mem_229531") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229526,
                                                  "mem_229526") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229520,
                                                  "mem_229520") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229469,
                                                  "mem_229469") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229465,
                                                  "mem_229465") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229460,
                                                  "ext_mem_229460") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229461,
                                                  "ext_mem_229461") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229411,
                                                  "ext_mem_229411") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229412,
                                                  "ext_mem_229412") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229362,
                                                  "ext_mem_229362") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229363,
                                                  "ext_mem_229363") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229264,
                                                  "ext_mem_229264") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229265,
                                                  "ext_mem_229265") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229206,
                                                  "mem_229206") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229200,
                                                  "mem_229200") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229196,
                                                  "ext_mem_229196") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229197,
                                                  "ext_mem_229197") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229164,
                                                  "mem_229164") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229161,
                                                  "mem_229161") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229157,
                                                  "mem_229157") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229155,
                                                  "mem_229155") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229152,
                                                  "mem_229152") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229148,
                                                  "mem_229148") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232249,
                                                  "mem_out_232249") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232248,
                                                  "mem_out_232248") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232247,
                                                  "mem_out_232247") != 0)
                            return 1;
                        err = 1;
                        goto cleanup;
                    }
                    
                    bool suff_outer_par_210437;
                    
                    suff_outer_par_210437 =
                        *ctx->tuning_params.mainzisuff_outer_par_7 <=
                        partition_sizze_203577;
                    if (ctx->logging)
                        fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                "main.suff_outer_par_7",
                                (long) partition_sizze_203577,
                                suff_outer_par_210437 ? "true" : "false");
                    
                    int64_t segmap_group_sizze_210537;
                    
                    segmap_group_sizze_210537 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_210441;
                    
                    int64_t num_groups_210538;
                    int32_t max_num_groups_233023;
                    
                    max_num_groups_233023 =
                        *ctx->tuning_params.mainzisegmap_num_groups_210443;
                    num_groups_210538 = sext_i64_i32(smax64((int64_t) 1,
                                                            smin64(sdiv_up64(partition_sizze_203577,
                                                                             segmap_group_sizze_210537),
                                                                   sext_i32_i64(max_num_groups_233023))));
                    
                    int64_t segmap_group_sizze_211661;
                    
                    segmap_group_sizze_211661 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_210636;
                    
                    int64_t num_groups_211662;
                    int32_t max_num_groups_233024;
                    
                    max_num_groups_233024 =
                        *ctx->tuning_params.mainzisegmap_num_groups_210638;
                    num_groups_211662 = sext_i64_i32(smax64((int64_t) 1,
                                                            smin64(sdiv_up64(binop_x_229202,
                                                                             segmap_group_sizze_211661),
                                                                   sext_i32_i64(max_num_groups_233024))));
                    
                    bool suff_outer_par_211666;
                    
                    suff_outer_par_211666 =
                        *ctx->tuning_params.mainzisuff_outer_par_8 <=
                        binop_x_229202;
                    if (ctx->logging)
                        fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                "main.suff_outer_par_8", (long) binop_x_229202,
                                suff_outer_par_211666 ? "true" : "false");
                    
                    int64_t one_intra_par_min_211667 = q_s_203493 *
                            s_n_m_203636;
                    int64_t intra_avail_par_211669 = smin64(s_n_m_203636,
                                                            one_intra_par_min_211667);
                    int64_t computed_group_sizze_211670 = smax64(s_n_m_203636,
                                                                 one_intra_par_min_211667);
                    bool fits_211674 = sle64(computed_group_sizze_211670,
                                             max_group_sizze_206887);
                    bool suff_intra_par_211676;
                    
                    suff_intra_par_211676 =
                        *ctx->tuning_params.mainzisuff_intra_par_9 <=
                        intra_avail_par_211669;
                    if (ctx->logging)
                        fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                "main.suff_intra_par_9",
                                (long) intra_avail_par_211669,
                                suff_intra_par_211676 ? "true" : "false");
                    
                    bool intra_suff_and_fits_211677 = fits_211674 &&
                         suff_intra_par_211676;
                    int64_t segmap_group_sizze_211879;
                    
                    segmap_group_sizze_211879 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_210971;
                    
                    bool suff_outer_par_211884;
                    
                    suff_outer_par_211884 =
                        *ctx->tuning_params.mainzisuff_outer_par_10 <=
                        nest_sizze_208848;
                    if (ctx->logging)
                        fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                "main.suff_outer_par_10",
                                (long) nest_sizze_208848,
                                suff_outer_par_211884 ? "true" : "false");
                    
                    int64_t segmap_group_sizze_211972;
                    
                    segmap_group_sizze_211972 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_211232;
                    
                    int64_t nest_sizze_211994 = q_s_203493 * nest_sizze_208848;
                    int64_t segred_group_sizze_211995;
                    
                    segred_group_sizze_211995 =
                        *ctx->tuning_params.mainzisegred_group_sizze_211176;
                    
                    int64_t num_groups_211996;
                    int32_t max_num_groups_233025;
                    
                    max_num_groups_233025 =
                        *ctx->tuning_params.mainzisegred_num_groups_211178;
                    num_groups_211996 = sext_i64_i32(smax64((int64_t) 1,
                                                            smin64(sdiv_up64(nest_sizze_211994,
                                                                             segred_group_sizze_211995),
                                                                   sext_i32_i64(max_num_groups_233025))));
                    
                    int64_t segmap_group_sizze_212044;
                    
                    segmap_group_sizze_212044 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_211146;
                    
                    int64_t segred_group_sizze_212069;
                    
                    segred_group_sizze_212069 =
                        *ctx->tuning_params.mainzisegred_group_sizze_211074;
                    
                    int64_t num_groups_212070;
                    int32_t max_num_groups_233026;
                    
                    max_num_groups_233026 =
                        *ctx->tuning_params.mainzisegred_num_groups_211076;
                    num_groups_212070 = sext_i64_i32(smax64((int64_t) 1,
                                                            smin64(sdiv_up64(nest_sizze_211994,
                                                                             segred_group_sizze_212069),
                                                                   sext_i32_i64(max_num_groups_233026))));
                    
                    int64_t bytes_229539 = (int64_t) 8 * nest_sizze_208848;
                    int64_t bytes_229546 = (int64_t) 8 * nest_sizze_207163;
                    int64_t binop_x_229609 = partition_sizze_203577 *
                            s_n_m_203636;
                    int64_t binop_x_229610 = n_p_203492 * binop_x_229609;
                    int64_t bytes_229611 = (int64_t) 8 * binop_x_229610;
                    int64_t binop_x_229617 = partition_sizze_203577 *
                            defunc_0_f_res_203631;
                    int64_t binop_x_229618 = n_p_203492 * binop_x_229617;
                    int64_t bytes_229619 = (int64_t) 8 * binop_x_229618;
                    int64_t bytes_229654 = smax64((int64_t) 0, s_n_m_203636);
                    int64_t bytes_229690 = smax64((int64_t) 0, binop_x_229295);
                    int64_t num_threads_232109 = segmap_group_sizze_210537 *
                            num_groups_210538;
                    int64_t total_sizze_232110 = bytes_229288 *
                            num_threads_232109;
                    int64_t num_threads_232111 = segmap_group_sizze_211661 *
                            num_groups_211662;
                    int64_t total_sizze_232112 = bytes_229311 *
                            num_threads_232111;
                    struct memblock_device ext_mem_229730;
                    
                    ext_mem_229730.references = NULL;
                    
                    int32_t local_memory_capacity_233312;
                    
                    local_memory_capacity_233312 = ctx->cuda.max_shared_memory;
                    if (sle64((int64_t) 0,
                              sext_i32_i64(local_memory_capacity_233312)) &&
                        suff_outer_par_210437) {
                        struct memblock_device mem_229540;
                        
                        mem_229540.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_229540,
                                                  bytes_229539, "mem_229540")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                  mem_229540,
                                                                  (int64_t) 0,
                                                                  ext_mem_229362,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  n_p_203492 *
                                                                  s_n_m_203636,
                                                                  partition_sizze_203577) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_229540,
                                                      "mem_229540") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229730,
                                                      "ext_mem_229730") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229536,
                                                      "mem_229536") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230419,
                                                      "ext_mem_230419") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230420,
                                                      "ext_mem_230420") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230486,
                                                      "ext_mem_230486") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230487,
                                                      "ext_mem_230487") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229515,
                                                      "mem_param_229515") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229507,
                                                      "mem_param_229507") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231517,
                                                      "ext_mem_231517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231518,
                                                      "ext_mem_231518") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229493,
                                                      "mem_param_229493") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229485,
                                                      "mem_param_229485") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229477,
                                                      "mem_param_229477") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231860,
                                                      "ext_mem_231860") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231861,
                                                      "ext_mem_231861") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231862,
                                                      "ext_mem_231862") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230551,
                                                      "mem_230551") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230534,
                                                      "mem_230534") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230517,
                                                      "mem_230517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230500,
                                                      "mem_230500") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229531,
                                                      "mem_229531") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229526,
                                                      "mem_229526") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229520,
                                                      "mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229469,
                                                      "mem_229469") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229465,
                                                      "mem_229465") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229460,
                                                      "ext_mem_229460") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229461,
                                                      "ext_mem_229461") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229411,
                                                      "ext_mem_229411") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229412,
                                                      "ext_mem_229412") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229362,
                                                      "ext_mem_229362") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229363,
                                                      "ext_mem_229363") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229264,
                                                      "ext_mem_229264") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229265,
                                                      "ext_mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229206,
                                                      "mem_229206") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229200,
                                                      "mem_229200") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229196,
                                                      "ext_mem_229196") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229197,
                                                      "ext_mem_229197") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229164,
                                                      "mem_229164") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229161,
                                                      "mem_229161") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229157,
                                                      "mem_229157") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229155,
                                                      "mem_229155") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229152,
                                                      "mem_229152") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229148,
                                                      "mem_229148") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232249,
                                                      "mem_out_232249") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232248,
                                                      "mem_out_232248") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232247,
                                                      "mem_out_232247") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_229543;
                        
                        mem_229543.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_229543,
                                                  binop_y_229224,
                                                  "mem_229543")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                  mem_229543,
                                                                  (int64_t) 0,
                                                                  ext_mem_229264,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  n_p_203492,
                                                                  partition_sizze_203577) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_229543,
                                                      "mem_229543") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229540,
                                                      "mem_229540") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229730,
                                                      "ext_mem_229730") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229536,
                                                      "mem_229536") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230419,
                                                      "ext_mem_230419") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230420,
                                                      "ext_mem_230420") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230486,
                                                      "ext_mem_230486") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230487,
                                                      "ext_mem_230487") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229515,
                                                      "mem_param_229515") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229507,
                                                      "mem_param_229507") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231517,
                                                      "ext_mem_231517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231518,
                                                      "ext_mem_231518") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229493,
                                                      "mem_param_229493") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229485,
                                                      "mem_param_229485") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229477,
                                                      "mem_param_229477") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231860,
                                                      "ext_mem_231860") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231861,
                                                      "ext_mem_231861") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231862,
                                                      "ext_mem_231862") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230551,
                                                      "mem_230551") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230534,
                                                      "mem_230534") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230517,
                                                      "mem_230517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230500,
                                                      "mem_230500") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229531,
                                                      "mem_229531") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229526,
                                                      "mem_229526") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229520,
                                                      "mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229469,
                                                      "mem_229469") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229465,
                                                      "mem_229465") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229460,
                                                      "ext_mem_229460") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229461,
                                                      "ext_mem_229461") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229411,
                                                      "ext_mem_229411") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229412,
                                                      "ext_mem_229412") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229362,
                                                      "ext_mem_229362") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229363,
                                                      "ext_mem_229363") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229264,
                                                      "ext_mem_229264") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229265,
                                                      "ext_mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229206,
                                                      "mem_229206") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229200,
                                                      "mem_229200") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229196,
                                                      "ext_mem_229196") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229197,
                                                      "ext_mem_229197") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229164,
                                                      "mem_229164") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229161,
                                                      "mem_229161") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229157,
                                                      "mem_229157") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229155,
                                                      "mem_229155") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229152,
                                                      "mem_229152") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229148,
                                                      "mem_229148") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232249,
                                                      "mem_out_232249") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232248,
                                                      "mem_out_232248") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232247,
                                                      "mem_out_232247") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_229547;
                        
                        mem_229547.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_229547,
                                                  bytes_229546, "mem_229547")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                  mem_229547,
                                                                  (int64_t) 0,
                                                                  mem_229531,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  n_p_203492 *
                                                                  defunc_0_f_res_203631,
                                                                  partition_sizze_203577) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_229547,
                                                      "mem_229547") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229543,
                                                      "mem_229543") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229540,
                                                      "mem_229540") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229730,
                                                      "ext_mem_229730") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229536,
                                                      "mem_229536") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230419,
                                                      "ext_mem_230419") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230420,
                                                      "ext_mem_230420") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230486,
                                                      "ext_mem_230486") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230487,
                                                      "ext_mem_230487") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229515,
                                                      "mem_param_229515") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229507,
                                                      "mem_param_229507") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231517,
                                                      "ext_mem_231517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231518,
                                                      "ext_mem_231518") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229493,
                                                      "mem_param_229493") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229485,
                                                      "mem_param_229485") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229477,
                                                      "mem_param_229477") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231860,
                                                      "ext_mem_231860") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231861,
                                                      "ext_mem_231861") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231862,
                                                      "ext_mem_231862") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230551,
                                                      "mem_230551") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230534,
                                                      "mem_230534") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230517,
                                                      "mem_230517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230500,
                                                      "mem_230500") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229531,
                                                      "mem_229531") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229526,
                                                      "mem_229526") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229520,
                                                      "mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229469,
                                                      "mem_229469") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229465,
                                                      "mem_229465") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229460,
                                                      "ext_mem_229460") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229461,
                                                      "ext_mem_229461") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229411,
                                                      "ext_mem_229411") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229412,
                                                      "ext_mem_229412") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229362,
                                                      "ext_mem_229362") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229363,
                                                      "ext_mem_229363") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229264,
                                                      "ext_mem_229264") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229265,
                                                      "ext_mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229206,
                                                      "mem_229206") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229200,
                                                      "mem_229200") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229196,
                                                      "ext_mem_229196") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229197,
                                                      "ext_mem_229197") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229164,
                                                      "mem_229164") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229161,
                                                      "mem_229161") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229157,
                                                      "mem_229157") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229155,
                                                      "mem_229155") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229152,
                                                      "mem_229152") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229148,
                                                      "mem_229148") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232249,
                                                      "mem_out_232249") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232248,
                                                      "mem_out_232248") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232247,
                                                      "mem_out_232247") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_229551;
                        
                        mem_229551.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_229551,
                                                  bytes_229539, "mem_229551")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                  mem_229551,
                                                                  (int64_t) 0,
                                                                  ext_mem_229363,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  n_p_203492 *
                                                                  s_n_m_203636,
                                                                  partition_sizze_203577) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_229551,
                                                      "mem_229551") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229547,
                                                      "mem_229547") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229543,
                                                      "mem_229543") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229540,
                                                      "mem_229540") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229730,
                                                      "ext_mem_229730") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229536,
                                                      "mem_229536") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230419,
                                                      "ext_mem_230419") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230420,
                                                      "ext_mem_230420") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230486,
                                                      "ext_mem_230486") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230487,
                                                      "ext_mem_230487") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229515,
                                                      "mem_param_229515") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229507,
                                                      "mem_param_229507") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231517,
                                                      "ext_mem_231517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231518,
                                                      "ext_mem_231518") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229493,
                                                      "mem_param_229493") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229485,
                                                      "mem_param_229485") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229477,
                                                      "mem_param_229477") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231860,
                                                      "ext_mem_231860") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231861,
                                                      "ext_mem_231861") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231862,
                                                      "ext_mem_231862") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230551,
                                                      "mem_230551") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230534,
                                                      "mem_230534") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230517,
                                                      "mem_230517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230500,
                                                      "mem_230500") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229531,
                                                      "mem_229531") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229526,
                                                      "mem_229526") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229520,
                                                      "mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229469,
                                                      "mem_229469") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229465,
                                                      "mem_229465") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229460,
                                                      "ext_mem_229460") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229461,
                                                      "ext_mem_229461") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229411,
                                                      "ext_mem_229411") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229412,
                                                      "ext_mem_229412") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229362,
                                                      "ext_mem_229362") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229363,
                                                      "ext_mem_229363") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229264,
                                                      "ext_mem_229264") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229265,
                                                      "ext_mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229206,
                                                      "mem_229206") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229200,
                                                      "mem_229200") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229196,
                                                      "ext_mem_229196") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229197,
                                                      "ext_mem_229197") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229164,
                                                      "mem_229164") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229161,
                                                      "mem_229161") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229157,
                                                      "mem_229157") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229155,
                                                      "mem_229155") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229152,
                                                      "mem_229152") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229148,
                                                      "mem_229148") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232249,
                                                      "mem_out_232249") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232248,
                                                      "mem_out_232248") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232247,
                                                      "mem_out_232247") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_229555;
                        
                        mem_229555.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_229555,
                                                  bytes_229546, "mem_229555")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                  mem_229555,
                                                                  (int64_t) 0,
                                                                  mem_229526,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  n_p_203492 *
                                                                  defunc_0_f_res_203631,
                                                                  partition_sizze_203577) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_229555,
                                                      "mem_229555") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229551,
                                                      "mem_229551") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229547,
                                                      "mem_229547") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229543,
                                                      "mem_229543") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229540,
                                                      "mem_229540") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229730,
                                                      "ext_mem_229730") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229536,
                                                      "mem_229536") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230419,
                                                      "ext_mem_230419") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230420,
                                                      "ext_mem_230420") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230486,
                                                      "ext_mem_230486") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230487,
                                                      "ext_mem_230487") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229515,
                                                      "mem_param_229515") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229507,
                                                      "mem_param_229507") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231517,
                                                      "ext_mem_231517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231518,
                                                      "ext_mem_231518") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229493,
                                                      "mem_param_229493") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229485,
                                                      "mem_param_229485") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229477,
                                                      "mem_param_229477") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231860,
                                                      "ext_mem_231860") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231861,
                                                      "ext_mem_231861") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231862,
                                                      "ext_mem_231862") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230551,
                                                      "mem_230551") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230534,
                                                      "mem_230534") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230517,
                                                      "mem_230517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230500,
                                                      "mem_230500") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229531,
                                                      "mem_229531") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229526,
                                                      "mem_229526") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229520,
                                                      "mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229469,
                                                      "mem_229469") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229465,
                                                      "mem_229465") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229460,
                                                      "ext_mem_229460") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229461,
                                                      "ext_mem_229461") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229411,
                                                      "ext_mem_229411") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229412,
                                                      "ext_mem_229412") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229362,
                                                      "ext_mem_229362") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229363,
                                                      "ext_mem_229363") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229264,
                                                      "ext_mem_229264") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229265,
                                                      "ext_mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229206,
                                                      "mem_229206") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229200,
                                                      "mem_229200") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229196,
                                                      "ext_mem_229196") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229197,
                                                      "ext_mem_229197") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229164,
                                                      "mem_229164") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229161,
                                                      "mem_229161") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229157,
                                                      "mem_229157") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229155,
                                                      "mem_229155") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229152,
                                                      "mem_229152") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229148,
                                                      "mem_229148") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232249,
                                                      "mem_out_232249") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232248,
                                                      "mem_out_232248") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232247,
                                                      "mem_out_232247") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_229559;
                        
                        mem_229559.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_229559,
                                                  bytes_229546, "mem_229559")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                  mem_229559,
                                                                  (int64_t) 0,
                                                                  ext_mem_229265,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  n_p_203492 *
                                                                  defunc_0_f_res_203631,
                                                                  partition_sizze_203577) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_229559,
                                                      "mem_229559") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229555,
                                                      "mem_229555") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229551,
                                                      "mem_229551") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229547,
                                                      "mem_229547") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229543,
                                                      "mem_229543") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229540,
                                                      "mem_229540") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229730,
                                                      "ext_mem_229730") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229536,
                                                      "mem_229536") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230419,
                                                      "ext_mem_230419") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230420,
                                                      "ext_mem_230420") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230486,
                                                      "ext_mem_230486") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230487,
                                                      "ext_mem_230487") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229515,
                                                      "mem_param_229515") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229507,
                                                      "mem_param_229507") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231517,
                                                      "ext_mem_231517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231518,
                                                      "ext_mem_231518") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229493,
                                                      "mem_param_229493") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229485,
                                                      "mem_param_229485") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229477,
                                                      "mem_param_229477") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231860,
                                                      "ext_mem_231860") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231861,
                                                      "ext_mem_231861") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231862,
                                                      "ext_mem_231862") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230551,
                                                      "mem_230551") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230534,
                                                      "mem_230534") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230517,
                                                      "mem_230517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230500,
                                                      "mem_230500") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229531,
                                                      "mem_229531") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229526,
                                                      "mem_229526") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229520,
                                                      "mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229469,
                                                      "mem_229469") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229465,
                                                      "mem_229465") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229460,
                                                      "ext_mem_229460") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229461,
                                                      "ext_mem_229461") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229411,
                                                      "ext_mem_229411") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229412,
                                                      "ext_mem_229412") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229362,
                                                      "ext_mem_229362") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229363,
                                                      "ext_mem_229363") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229264,
                                                      "ext_mem_229264") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229265,
                                                      "ext_mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229206,
                                                      "mem_229206") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229200,
                                                      "mem_229200") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229196,
                                                      "ext_mem_229196") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229197,
                                                      "ext_mem_229197") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229164,
                                                      "mem_229164") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229161,
                                                      "mem_229161") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229157,
                                                      "mem_229157") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229155,
                                                      "mem_229155") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229152,
                                                      "mem_229152") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229148,
                                                      "mem_229148") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232249,
                                                      "mem_out_232249") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232248,
                                                      "mem_out_232248") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232247,
                                                      "mem_out_232247") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_229608;
                        
                        mem_229608.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_229608,
                                                  bytes_229539, "mem_229608")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device color_231986;
                        
                        color_231986.references = NULL;
                        if (memblock_alloc_device(ctx, &color_231986,
                                                  total_sizze_232110,
                                                  "color_231986")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        
                        CUdeviceptr kernel_arg_237395 = mem_229540.mem;
                        CUdeviceptr kernel_arg_237396 = mem_229543.mem;
                        CUdeviceptr kernel_arg_237397 = mem_229547.mem;
                        CUdeviceptr kernel_arg_237398 = mem_229551.mem;
                        CUdeviceptr kernel_arg_237399 = mem_229555.mem;
                        CUdeviceptr kernel_arg_237400 = mem_229559.mem;
                        CUdeviceptr kernel_arg_237401 = mem_229608.mem;
                        CUdeviceptr kernel_arg_237402 = color_231986.mem;
                        
                        if ((((((1 && num_groups_210538 != 0) && 1 != 0) && 1 !=
                               0) && segmap_group_sizze_210537 != 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_210538;
                            grid[perm[1]] = 1;
                            grid[perm[2]] = 1;
                            
                            void *kernel_args_237392[] = {&ctx->global_failure,
                                                          &n_p_203492,
                                                          &q_s_203493,
                                                          &jump_s_203499,
                                                          &partition_sizze_203577,
                                                          &defunc_0_f_res_203631,
                                                          &pad_css_len_203632,
                                                          &s_n_m_203636,
                                                          &num_groups_210538,
                                                          &num_threads_232109,
                                                          &kernel_arg_237395,
                                                          &kernel_arg_237396,
                                                          &kernel_arg_237397,
                                                          &kernel_arg_237398,
                                                          &kernel_arg_237399,
                                                          &kernel_arg_237400,
                                                          &kernel_arg_237401,
                                                          &kernel_arg_237402};
                            int64_t time_start_237393 = 0, time_end_237394 = 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_210542",
                                        (long) num_groups_210538, (long) 1,
                                        (long) 1,
                                        (long) segmap_group_sizze_210537,
                                        (long) 1, (long) 1, (int) 0);
                                time_start_237393 = get_wall_time();
                            }
                            
                            cudaEvent_t *pevents = NULL;
                            
                            if (ctx->profiling && !ctx->profiling_paused) {
                                pevents = cuda_get_events(&ctx->cuda,
                                                          &ctx->mainzisegmap_210542_runs,
                                                          &ctx->mainzisegmap_210542_total_runtime);
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                   0));
                            }
                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_210542,
                                                                  grid[0],
                                                                  grid[1],
                                                                  grid[2],
                                                                  segmap_group_sizze_210537,
                                                                  1, 1, 0, NULL,
                                                                  kernel_args_237392,
                                                                  NULL));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                            if (ctx->debugging) {
                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                time_end_237394 = get_wall_time();
                                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                        "main.segmap_210542", time_end_237394 -
                                        time_start_237393);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_unref_device(ctx, &mem_229540,
                                                  "mem_229540") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229543,
                                                  "mem_229543") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229547,
                                                  "mem_229547") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229551,
                                                  "mem_229551") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229555,
                                                  "mem_229555") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229559,
                                                  "mem_229559") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_231986,
                                                  "color_231986") != 0)
                            return 1;
                        
                        struct memblock_device mem_229728;
                        
                        mem_229728.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_229728,
                                                  bytes_229297, "mem_229728")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                  mem_229728,
                                                                  (int64_t) 0,
                                                                  mem_229608,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  partition_sizze_203577,
                                                                  n_p_203492 *
                                                                  s_n_m_203636) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_229728,
                                                      "mem_229728") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_231986,
                                                      "color_231986") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229608,
                                                      "mem_229608") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229559,
                                                      "mem_229559") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229555,
                                                      "mem_229555") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229551,
                                                      "mem_229551") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229547,
                                                      "mem_229547") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229543,
                                                      "mem_229543") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229540,
                                                      "mem_229540") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229730,
                                                      "ext_mem_229730") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229536,
                                                      "mem_229536") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230419,
                                                      "ext_mem_230419") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230420,
                                                      "ext_mem_230420") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230486,
                                                      "ext_mem_230486") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230487,
                                                      "ext_mem_230487") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229515,
                                                      "mem_param_229515") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229507,
                                                      "mem_param_229507") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231517,
                                                      "ext_mem_231517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231518,
                                                      "ext_mem_231518") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229493,
                                                      "mem_param_229493") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229485,
                                                      "mem_param_229485") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229477,
                                                      "mem_param_229477") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231860,
                                                      "ext_mem_231860") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231861,
                                                      "ext_mem_231861") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231862,
                                                      "ext_mem_231862") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230551,
                                                      "mem_230551") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230534,
                                                      "mem_230534") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230517,
                                                      "mem_230517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230500,
                                                      "mem_230500") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229531,
                                                      "mem_229531") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229526,
                                                      "mem_229526") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229520,
                                                      "mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229469,
                                                      "mem_229469") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229465,
                                                      "mem_229465") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229460,
                                                      "ext_mem_229460") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229461,
                                                      "ext_mem_229461") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229411,
                                                      "ext_mem_229411") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229412,
                                                      "ext_mem_229412") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229362,
                                                      "ext_mem_229362") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229363,
                                                      "ext_mem_229363") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229264,
                                                      "ext_mem_229264") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229265,
                                                      "ext_mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229206,
                                                      "mem_229206") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229200,
                                                      "mem_229200") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229196,
                                                      "ext_mem_229196") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229197,
                                                      "ext_mem_229197") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229164,
                                                      "mem_229164") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229161,
                                                      "mem_229161") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229157,
                                                      "mem_229157") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229155,
                                                      "mem_229155") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229152,
                                                      "mem_229152") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229148,
                                                      "mem_229148") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232249,
                                                      "mem_out_232249") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232248,
                                                      "mem_out_232248") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232247,
                                                      "mem_out_232247") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        if (memblock_unref_device(ctx, &mem_229608,
                                                  "mem_229608") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_229730,
                                                &mem_229728, "mem_229728") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229728,
                                                  "mem_229728") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_231986,
                                                  "color_231986") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229608,
                                                  "mem_229608") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229559,
                                                  "mem_229559") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229555,
                                                  "mem_229555") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229551,
                                                  "mem_229551") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229547,
                                                  "mem_229547") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229543,
                                                  "mem_229543") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229540,
                                                  "mem_229540") != 0)
                            return 1;
                    } else {
                        struct memblock_device ext_mem_229723;
                        
                        ext_mem_229723.references = NULL;
                        
                        int32_t local_memory_capacity_233311;
                        
                        local_memory_capacity_233311 =
                            ctx->cuda.max_shared_memory;
                        if (sle64((int64_t) 0,
                                  sext_i32_i64(local_memory_capacity_233311)) &&
                            suff_outer_par_211666) {
                            struct memblock_device mem_229612;
                            
                            mem_229612.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229612,
                                                      bytes_229611,
                                                      "mem_229612")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_229612,
                                                                      (int64_t) 0,
                                                                      ext_mem_229363,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      s_n_m_203636,
                                                                      partition_sizze_203577 *
                                                                      n_p_203492) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_229612,
                                                          "mem_229612") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229723,
                                                          "ext_mem_229723") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229730,
                                                          "ext_mem_229730") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229536,
                                                          "mem_229536") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230419,
                                                          "ext_mem_230419") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230420,
                                                          "ext_mem_230420") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_229616;
                            
                            mem_229616.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229616,
                                                      bytes_229611,
                                                      "mem_229616")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_229616,
                                                                      (int64_t) 0,
                                                                      ext_mem_229362,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      s_n_m_203636,
                                                                      partition_sizze_203577 *
                                                                      n_p_203492) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_229616,
                                                          "mem_229616") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229612,
                                                          "mem_229612") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229723,
                                                          "ext_mem_229723") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229730,
                                                          "ext_mem_229730") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229536,
                                                          "mem_229536") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230419,
                                                          "ext_mem_230419") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230420,
                                                          "ext_mem_230420") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_229620;
                            
                            mem_229620.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229620,
                                                      bytes_229619,
                                                      "mem_229620")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_229620,
                                                                      (int64_t) 0,
                                                                      ext_mem_229265,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      defunc_0_f_res_203631,
                                                                      partition_sizze_203577 *
                                                                      n_p_203492) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_229620,
                                                          "mem_229620") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229616,
                                                          "mem_229616") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229612,
                                                          "mem_229612") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229723,
                                                          "ext_mem_229723") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229730,
                                                          "ext_mem_229730") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229536,
                                                          "mem_229536") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230419,
                                                          "ext_mem_230419") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230420,
                                                          "ext_mem_230420") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_229624;
                            
                            mem_229624.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229624,
                                                      bytes_229619,
                                                      "mem_229624")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_229624,
                                                                      (int64_t) 0,
                                                                      mem_229531,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      defunc_0_f_res_203631,
                                                                      partition_sizze_203577 *
                                                                      n_p_203492) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_229624,
                                                          "mem_229624") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229620,
                                                          "mem_229620") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229616,
                                                          "mem_229616") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229612,
                                                          "mem_229612") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229723,
                                                          "ext_mem_229723") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229730,
                                                          "ext_mem_229730") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229536,
                                                          "mem_229536") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230419,
                                                          "ext_mem_230419") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230420,
                                                          "ext_mem_230420") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_229628;
                            
                            mem_229628.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229628,
                                                      bytes_229619,
                                                      "mem_229628")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_229628,
                                                                      (int64_t) 0,
                                                                      mem_229526,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      defunc_0_f_res_203631,
                                                                      partition_sizze_203577 *
                                                                      n_p_203492) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229624,
                                                          "mem_229624") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229620,
                                                          "mem_229620") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229616,
                                                          "mem_229616") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229612,
                                                          "mem_229612") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229723,
                                                          "ext_mem_229723") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229730,
                                                          "ext_mem_229730") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229536,
                                                          "mem_229536") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230419,
                                                          "ext_mem_230419") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230420,
                                                          "ext_mem_230420") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_229648;
                            
                            mem_229648.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229648,
                                                      bytes_229611,
                                                      "mem_229648")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_231987;
                            
                            color_231987.references = NULL;
                            if (memblock_alloc_device(ctx, &color_231987,
                                                      total_sizze_232112,
                                                      "color_231987")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            
                            CUdeviceptr kernel_arg_237406 = ext_mem_229264.mem;
                            CUdeviceptr kernel_arg_237407 = mem_229612.mem;
                            CUdeviceptr kernel_arg_237408 = mem_229616.mem;
                            CUdeviceptr kernel_arg_237409 = mem_229620.mem;
                            CUdeviceptr kernel_arg_237410 = mem_229624.mem;
                            CUdeviceptr kernel_arg_237411 = mem_229628.mem;
                            CUdeviceptr kernel_arg_237412 = mem_229648.mem;
                            CUdeviceptr kernel_arg_237413 = color_231987.mem;
                            
                            if ((((((1 && num_groups_211662 != 0) && 1 != 0) &&
                                   1 != 0) && segmap_group_sizze_211661 != 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_211662;
                                grid[perm[1]] = 1;
                                grid[perm[2]] = 1;
                                
                                void *kernel_args_237403[] =
                                     {&ctx->global_failure, &n_p_203492,
                                      &q_s_203493, &jump_s_203499,
                                      &partition_sizze_203577,
                                      &defunc_0_f_res_203631,
                                      &pad_css_len_203632, &s_n_m_203636,
                                      &num_groups_211662, &num_threads_232111,
                                      &kernel_arg_237406, &kernel_arg_237407,
                                      &kernel_arg_237408, &kernel_arg_237409,
                                      &kernel_arg_237410, &kernel_arg_237411,
                                      &kernel_arg_237412, &kernel_arg_237413};
                                int64_t time_start_237404 = 0, time_end_237405 =
                                        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_211682",
                                            (long) num_groups_211662, (long) 1,
                                            (long) 1,
                                            (long) segmap_group_sizze_211661,
                                            (long) 1, (long) 1, (int) 0);
                                    time_start_237404 = get_wall_time();
                                }
                                
                                cudaEvent_t *pevents = NULL;
                                
                                if (ctx->profiling && !ctx->profiling_paused) {
                                    pevents = cuda_get_events(&ctx->cuda,
                                                              &ctx->mainzisegmap_211682_runs,
                                                              &ctx->mainzisegmap_211682_total_runtime);
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                       0));
                                }
                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_211682,
                                                                      grid[0],
                                                                      grid[1],
                                                                      grid[2],
                                                                      segmap_group_sizze_211661,
                                                                      1, 1, 0,
                                                                      NULL,
                                                                      kernel_args_237403,
                                                                      NULL));
                                if (pevents != NULL)
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                       0));
                                if (ctx->debugging) {
                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                    time_end_237405 = get_wall_time();
                                    fprintf(ctx->log,
                                            "Kernel %s runtime: %ldus\n",
                                            "main.segmap_211682",
                                            time_end_237405 -
                                            time_start_237404);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx, &mem_229612,
                                                      "mem_229612") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229616,
                                                      "mem_229616") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229620,
                                                      "mem_229620") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229624,
                                                      "mem_229624") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229628,
                                                      "mem_229628") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_231987,
                                                      "color_231987") != 0)
                                return 1;
                            
                            struct memblock_device mem_229721;
                            
                            mem_229721.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229721,
                                                      bytes_229297,
                                                      "mem_229721")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_229721,
                                                                      (int64_t) 0,
                                                                      mem_229648,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      partition_sizze_203577 *
                                                                      n_p_203492,
                                                                      s_n_m_203636) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_229721,
                                                          "mem_229721") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_231987,
                                                          "color_231987") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229648,
                                                          "mem_229648") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229624,
                                                          "mem_229624") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229620,
                                                          "mem_229620") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229616,
                                                          "mem_229616") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229612,
                                                          "mem_229612") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229723,
                                                          "ext_mem_229723") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229730,
                                                          "ext_mem_229730") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229536,
                                                          "mem_229536") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230419,
                                                          "ext_mem_230419") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230420,
                                                          "ext_mem_230420") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_229648,
                                                      "mem_229648") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_229723,
                                                    &mem_229721,
                                                    "mem_229721") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229721,
                                                      "mem_229721") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_231987,
                                                      "color_231987") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229648,
                                                      "mem_229648") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229628,
                                                      "mem_229628") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229624,
                                                      "mem_229624") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229620,
                                                      "mem_229620") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229616,
                                                      "mem_229616") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229612,
                                                      "mem_229612") != 0)
                                return 1;
                        } else {
                            struct memblock_device ext_mem_229716;
                            
                            ext_mem_229716.references = NULL;
                            
                            int32_t local_memory_capacity_233310;
                            
                            local_memory_capacity_233310 =
                                ctx->cuda.max_shared_memory;
                            if (sle64(bytes_229311 + srem64((int64_t) 8 -
                                                            srem64(bytes_229311,
                                                                   (int64_t) 8),
                                                            (int64_t) 8) +
                                      (bytes_229311 + srem64((int64_t) 8 -
                                                             srem64(bytes_229311,
                                                                    (int64_t) 8),
                                                             (int64_t) 8)) +
                                      (bytes_229311 + srem64((int64_t) 8 -
                                                             srem64(bytes_229311,
                                                                    (int64_t) 8),
                                                             (int64_t) 8)) +
                                      (bytes_229654 + srem64((int64_t) 8 -
                                                             srem64(bytes_229654,
                                                                    (int64_t) 8),
                                                             (int64_t) 8)) +
                                      ((int64_t) 8 * (s_n_m_203636 *
                                                      q_s_203493) +
                                       srem64((int64_t) 8 - srem64((int64_t) 8 *
                                                                   (s_n_m_203636 *
                                                                    q_s_203493),
                                                                   (int64_t) 8),
                                              (int64_t) 8)) + ((int64_t) 8 *
                                                               (s_n_m_203636 *
                                                                q_s_203493) +
                                                               srem64((int64_t) 8 -
                                                                      srem64((int64_t) 8 *
                                                                             (s_n_m_203636 *
                                                                              q_s_203493),
                                                                             (int64_t) 8),
                                                                      (int64_t) 8)),
                                      sext_i32_i64(local_memory_capacity_233310)) &&
                                intra_suff_and_fits_211677) {
                                struct memblock_device mem_229675;
                                
                                mem_229675.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_229675,
                                                          bytes_229297,
                                                          "mem_229675")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                                
                                unsigned int shared_sizze_237417 = (int64_t) 8 *
                                             (s_n_m_203636 * q_s_203493);
                                unsigned int shared_sizze_237419 = (int64_t) 8 *
                                             (s_n_m_203636 * q_s_203493);
                                unsigned int shared_sizze_237421 = bytes_229654;
                                unsigned int shared_sizze_237423 = bytes_229311;
                                unsigned int shared_sizze_237425 = bytes_229311;
                                unsigned int shared_sizze_237427 = bytes_229311;
                                CUdeviceptr kernel_arg_237429 =
                                            ext_mem_229264.mem;
                                CUdeviceptr kernel_arg_237430 =
                                            ext_mem_229265.mem;
                                CUdeviceptr kernel_arg_237431 =
                                            ext_mem_229362.mem;
                                CUdeviceptr kernel_arg_237432 =
                                            ext_mem_229363.mem;
                                CUdeviceptr kernel_arg_237433 = mem_229526.mem;
                                CUdeviceptr kernel_arg_237434 = mem_229531.mem;
                                CUdeviceptr kernel_arg_237435 = mem_229675.mem;
                                unsigned int shared_offset_237418 = 0;
                                unsigned int shared_offset_237420 = 0 +
                                             (shared_sizze_237417 + (8 -
                                                                     shared_sizze_237417 %
                                                                     8) % 8);
                                unsigned int shared_offset_237422 = 0 +
                                             (shared_sizze_237417 + (8 -
                                                                     shared_sizze_237417 %
                                                                     8) % 8) +
                                             (shared_sizze_237419 + (8 -
                                                                     shared_sizze_237419 %
                                                                     8) % 8);
                                unsigned int shared_offset_237424 = 0 +
                                             (shared_sizze_237417 + (8 -
                                                                     shared_sizze_237417 %
                                                                     8) % 8) +
                                             (shared_sizze_237419 + (8 -
                                                                     shared_sizze_237419 %
                                                                     8) % 8) +
                                             (shared_sizze_237421 + (8 -
                                                                     shared_sizze_237421 %
                                                                     8) % 8);
                                unsigned int shared_offset_237426 = 0 +
                                             (shared_sizze_237417 + (8 -
                                                                     shared_sizze_237417 %
                                                                     8) % 8) +
                                             (shared_sizze_237419 + (8 -
                                                                     shared_sizze_237419 %
                                                                     8) % 8) +
                                             (shared_sizze_237421 + (8 -
                                                                     shared_sizze_237421 %
                                                                     8) % 8) +
                                             (shared_sizze_237423 + (8 -
                                                                     shared_sizze_237423 %
                                                                     8) % 8);
                                unsigned int shared_offset_237428 = 0 +
                                             (shared_sizze_237417 + (8 -
                                                                     shared_sizze_237417 %
                                                                     8) % 8) +
                                             (shared_sizze_237419 + (8 -
                                                                     shared_sizze_237419 %
                                                                     8) % 8) +
                                             (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);
                                
                                if ((((((1 && binop_x_229202 != 0) && 1 != 0) &&
                                       1 != 0) && computed_group_sizze_211670 !=
                                      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_229202;
                                    grid[perm[1]] = 1;
                                    grid[perm[2]] = 1;
                                    
                                    void *kernel_args_237414[] =
                                         {&ctx->global_failure,
                                          &shared_offset_237418,
                                          &shared_offset_237420,
                                          &shared_offset_237422,
                                          &shared_offset_237424,
                                          &shared_offset_237426,
                                          &shared_offset_237428, &n_p_203492,
                                          &q_s_203493, &jump_s_203499,
                                          &partition_sizze_203577,
                                          &defunc_0_f_res_203631,
                                          &pad_css_len_203632, &s_n_m_203636,
                                          &computed_group_sizze_211670,
                                          &kernel_arg_237429,
                                          &kernel_arg_237430,
                                          &kernel_arg_237431,
                                          &kernel_arg_237432,
                                          &kernel_arg_237433,
                                          &kernel_arg_237434,
                                          &kernel_arg_237435};
                                    int64_t time_start_237415 = 0,
                                            time_end_237416 = 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_211768",
                                                (long) binop_x_229202, (long) 1,
                                                (long) 1,
                                                (long) computed_group_sizze_211670,
                                                (long) 1, (long) 1, (int) (0 +
                                                                           (shared_sizze_237417 +
                                                                            (8 -
                                                                             shared_sizze_237417 %
                                                                             8) %
                                                                            8) +
                                                                           (shared_sizze_237419 +
                                                                            (8 -
                                                                             shared_sizze_237419 %
                                                                             8) %
                                                                            8) +
                                                                           (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) +
                                                                           (shared_sizze_237427 +
                                                                            (8 -
                                                                             shared_sizze_237427 %
                                                                             8) %
                                                                            8)));
                                        time_start_237415 = get_wall_time();
                                    }
                                    
                                    cudaEvent_t *pevents = NULL;
                                    
                                    if (ctx->profiling &&
                                        !ctx->profiling_paused) {
                                        pevents = cuda_get_events(&ctx->cuda,
                                                                  &ctx->mainzisegmap_intragroup_211768_runs,
                                                                  &ctx->mainzisegmap_intragroup_211768_total_runtime);
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                           0));
                                    }
                                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_intragroup_211768,
                                                                          grid[0],
                                                                          grid[1],
                                                                          grid[2],
                                                                          computed_group_sizze_211670,
                                                                          1, 1,
                                                                          0 +
                                                                          (shared_sizze_237417 +
                                                                           (8 -
                                                                            shared_sizze_237417 %
                                                                            8) %
                                                                           8) +
                                                                          (shared_sizze_237419 +
                                                                           (8 -
                                                                            shared_sizze_237419 %
                                                                            8) %
                                                                           8) +
                                                                          (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) +
                                                                          (shared_sizze_237427 +
                                                                           (8 -
                                                                            shared_sizze_237427 %
                                                                            8) %
                                                                           8),
                                                                          NULL,
                                                                          kernel_args_237414,
                                                                          NULL));
                                    if (pevents != NULL)
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                           0));
                                    if (ctx->debugging) {
                                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                        time_end_237416 = get_wall_time();
                                        fprintf(ctx->log,
                                                "Kernel %s runtime: %ldus\n",
                                                "main.segmap_intragroup_211768",
                                                time_end_237416 -
                                                time_start_237415);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_set_device(ctx, &ext_mem_229716,
                                                        &mem_229675,
                                                        "mem_229675") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229675,
                                                          "mem_229675") != 0)
                                    return 1;
                            } else {
                                int64_t segmap_usable_groups_211880 =
                                        sdiv_up64(nest_sizze_208848,
                                                  segmap_group_sizze_211879);
                                struct memblock_device ext_mem_229715;
                                
                                ext_mem_229715.references = NULL;
                                
                                int32_t local_memory_capacity_233309;
                                
                                local_memory_capacity_233309 =
                                    ctx->cuda.max_shared_memory;
                                if (sle64((int64_t) 0,
                                          sext_i32_i64(local_memory_capacity_233309)) &&
                                    suff_outer_par_211884) {
                                    struct memblock_device mem_229681;
                                    
                                    mem_229681.references = NULL;
                                    if (memblock_alloc_device(ctx, &mem_229681,
                                                              bytes_229297,
                                                              "mem_229681")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                                    
                                    CUdeviceptr kernel_arg_237439 =
                                                ext_mem_229264.mem;
                                    CUdeviceptr kernel_arg_237440 =
                                                ext_mem_229265.mem;
                                    CUdeviceptr kernel_arg_237441 =
                                                ext_mem_229362.mem;
                                    CUdeviceptr kernel_arg_237442 =
                                                ext_mem_229363.mem;
                                    CUdeviceptr kernel_arg_237443 =
                                                mem_229526.mem;
                                    CUdeviceptr kernel_arg_237444 =
                                                mem_229531.mem;
                                    CUdeviceptr kernel_arg_237445 =
                                                mem_229681.mem;
                                    
                                    if ((((((1 && segmap_usable_groups_211880 !=
                                             0) && 1 != 0) && 1 != 0) &&
                                          segmap_group_sizze_211879 != 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_211880;
                                        grid[perm[1]] = 1;
                                        grid[perm[2]] = 1;
                                        
                                        void *kernel_args_237436[] =
                                             {&ctx->global_failure, &n_p_203492,
                                              &q_s_203493, &jump_s_203499,
                                              &partition_sizze_203577,
                                              &defunc_0_f_res_203631,
                                              &pad_css_len_203632,
                                              &s_n_m_203636, &kernel_arg_237439,
                                              &kernel_arg_237440,
                                              &kernel_arg_237441,
                                              &kernel_arg_237442,
                                              &kernel_arg_237443,
                                              &kernel_arg_237444,
                                              &kernel_arg_237445};
                                        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_211890",
                                                    (long) segmap_usable_groups_211880,
                                                    (long) 1, (long) 1,
                                                    (long) segmap_group_sizze_211879,
                                                    (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_211890_runs,
                                                                &ctx->mainzisegmap_211890_total_runtime);
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                               0));
                                        }
                                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_211890,
                                                                              grid[0],
                                                                              grid[1],
                                                                              grid[2],
                                                                              segmap_group_sizze_211879,
                                                                              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_211890",
                                                    time_end_237438 -
                                                    time_start_237437);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_set_device(ctx,
                                                            &ext_mem_229715,
                                                            &mem_229681,
                                                            "mem_229681") != 0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229681,
                                                              "mem_229681") !=
                                        0)
                                        return 1;
                                } else {
                                    int64_t segmap_usable_groups_211973 =
                                            sdiv_up64(nest_sizze_208848,
                                                      segmap_group_sizze_211972);
                                    struct memblock_device mem_229687;
                                    
                                    mem_229687.references = NULL;
                                    if (memblock_alloc_device(ctx, &mem_229687,
                                                              bytes_229297,
                                                              "mem_229687")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device mem_229691;
                                    
                                    mem_229691.references = NULL;
                                    if (memblock_alloc_device(ctx, &mem_229691,
                                                              bytes_229690,
                                                              "mem_229691")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                                    
                                    CUdeviceptr kernel_arg_237449 =
                                                mem_229687.mem;
                                    CUdeviceptr kernel_arg_237450 =
                                                mem_229691.mem;
                                    
                                    if ((((((1 && segmap_usable_groups_211973 !=
                                             0) && 1 != 0) && 1 != 0) &&
                                          segmap_group_sizze_211972 != 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_211973;
                                        grid[perm[1]] = 1;
                                        grid[perm[2]] = 1;
                                        
                                        void *kernel_args_237446[] =
                                             {&ctx->global_failure, &n_p_203492,
                                              &jump_s_203499,
                                              &partition_sizze_203577,
                                              &defunc_0_f_res_203631,
                                              &pad_css_len_203632,
                                              &s_n_m_203636, &kernel_arg_237449,
                                              &kernel_arg_237450};
                                        int64_t time_start_237447 = 0,
                                                time_end_237448 = 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_211979",
                                                    (long) segmap_usable_groups_211973,
                                                    (long) 1, (long) 1,
                                                    (long) segmap_group_sizze_211972,
                                                    (long) 1, (long) 1,
                                                    (int) 0);
                                            time_start_237447 = get_wall_time();
                                        }
                                        
                                        cudaEvent_t *pevents = NULL;
                                        
                                        if (ctx->profiling &&
                                            !ctx->profiling_paused) {
                                            pevents =
                                                cuda_get_events(&ctx->cuda,
                                                                &ctx->mainzisegmap_211979_runs,
                                                                &ctx->mainzisegmap_211979_total_runtime);
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                               0));
                                        }
                                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_211979,
                                                                              grid[0],
                                                                              grid[1],
                                                                              grid[2],
                                                                              segmap_group_sizze_211972,
                                                                              1,
                                                                              1,
                                                                              0,
                                                                              NULL,
                                                                              kernel_args_237446,
                                                                              NULL));
                                        if (pevents != NULL)
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                               0));
                                        if (ctx->debugging) {
                                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                            time_end_237448 = get_wall_time();
                                            fprintf(ctx->log,
                                                    "Kernel %s runtime: %ldus\n",
                                                    "main.segmap_211979",
                                                    time_end_237448 -
                                                    time_start_237447);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_unref_device(ctx, &mem_229691,
                                                              "mem_229691") !=
                                        0)
                                        return 1;
                                    
                                    struct memblock_device mem_229697;
                                    
                                    mem_229697.references = NULL;
                                    if (memblock_alloc_device(ctx, &mem_229697,
                                                              bytes_229297,
                                                              "mem_229697")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    if (slt64(q_s_203493 * (int64_t) 2,
                                              segred_group_sizze_211995)) {
                                        int64_t segment_sizze_nonzzero_233145 =
                                                smax64((int64_t) 1, q_s_203493);
                                        int64_t num_threads_233146 =
                                                num_groups_211996 *
                                                segred_group_sizze_211995;
                                        
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n",
                                                    "\n# SegRed-small");
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "num_segments",
                                                    (long long) (partition_sizze_203577 *
                                                                 n_p_203492 *
                                                                 s_n_m_203636),
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "segment_size",
                                                    (long long) q_s_203493,
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "segments_per_group",
                                                    (long long) squot64(segred_group_sizze_211995,
                                                                        segment_sizze_nonzzero_233145),
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "required_groups",
                                                    (long long) sext_i64_i32(sdiv_up64(partition_sizze_203577 *
                                                                                       n_p_203492 *
                                                                                       s_n_m_203636,
                                                                                       squot64(segred_group_sizze_211995,
                                                                                               segment_sizze_nonzzero_233145))),
                                                    '\n');
                                        
                                        unsigned int shared_sizze_237454 =
                                                     (int64_t) 8 *
                                                     segred_group_sizze_211995;
                                        CUdeviceptr kernel_arg_237456 =
                                                    ext_mem_229264.mem;
                                        CUdeviceptr kernel_arg_237457 =
                                                    ext_mem_229265.mem;
                                        CUdeviceptr kernel_arg_237458 =
                                                    ext_mem_229362.mem;
                                        CUdeviceptr kernel_arg_237459 =
                                                    ext_mem_229363.mem;
                                        CUdeviceptr kernel_arg_237460 =
                                                    mem_229531.mem;
                                        CUdeviceptr kernel_arg_237461 =
                                                    mem_229687.mem;
                                        CUdeviceptr kernel_arg_237462 =
                                                    mem_229697.mem;
                                        unsigned int shared_offset_237455 = 0;
                                        
                                        if ((((((1 && num_groups_211996 != 0) &&
                                                1 != 0) && 1 != 0) &&
                                              segred_group_sizze_211995 != 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_211996;
                                            grid[perm[1]] = 1;
                                            grid[perm[2]] = 1;
                                            
                                            void *kernel_args_237451[] =
                                                 {&ctx->global_failure,
                                                  &shared_offset_237455,
                                                  &n_p_203492, &q_s_203493,
                                                  &partition_sizze_203577,
                                                  &defunc_0_f_res_203631,
                                                  &s_n_m_203636,
                                                  &num_groups_211996,
                                                  &segment_sizze_nonzzero_233145,
                                                  &kernel_arg_237456,
                                                  &kernel_arg_237457,
                                                  &kernel_arg_237458,
                                                  &kernel_arg_237459,
                                                  &kernel_arg_237460,
                                                  &kernel_arg_237461,
                                                  &kernel_arg_237462};
                                            int64_t time_start_237452 = 0,
                                                    time_end_237453 = 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_212003",
                                                        (long) num_groups_211996,
                                                        (long) 1, (long) 1,
                                                        (long) segred_group_sizze_211995,
                                                        (long) 1, (long) 1,
                                                        (int) (0 +
                                                               (shared_sizze_237454 +
                                                                (8 -
                                                                 shared_sizze_237454 %
                                                                 8) % 8)));
                                                time_start_237452 =
                                                    get_wall_time();
                                            }
                                            
                                            cudaEvent_t *pevents = NULL;
                                            
                                            if (ctx->profiling &&
                                                !ctx->profiling_paused) {
                                                pevents =
                                                    cuda_get_events(&ctx->cuda,
                                                                    &ctx->mainzisegred_small_212003_runs,
                                                                    &ctx->mainzisegred_small_212003_total_runtime);
                                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                                   0));
                                            }
                                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_small_212003,
                                                                                  grid[0],
                                                                                  grid[1],
                                                                                  grid[2],
                                                                                  segred_group_sizze_211995,
                                                                                  1,
                                                                                  1,
                                                                                  0 +
                                                                                  (shared_sizze_237454 +
                                                                                   (8 -
                                                                                    shared_sizze_237454 %
                                                                                    8) %
                                                                                   8),
                                                                                  NULL,
                                                                                  kernel_args_237451,
                                                                                  NULL));
                                            if (pevents != NULL)
                                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                                   0));
                                            if (ctx->debugging) {
                                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                                time_end_237453 =
                                                    get_wall_time();
                                                fprintf(ctx->log,
                                                        "Kernel %s runtime: %ldus\n",
                                                        "main.segred_small_212003",
                                                        time_end_237453 -
                                                        time_start_237452);
                                            }
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n", "");
                                    } else {
                                        int64_t groups_per_segment_233176 =
                                                sdiv_up64(num_groups_211996,
                                                          smax64((int64_t) 1,
                                                                 partition_sizze_203577 *
                                                                 n_p_203492 *
                                                                 s_n_m_203636));
                                        int64_t elements_per_thread_233177 =
                                                sdiv_up64(q_s_203493,
                                                          segred_group_sizze_211995 *
                                                          groups_per_segment_233176);
                                        int64_t virt_num_groups_233178 =
                                                groups_per_segment_233176 *
                                                (partition_sizze_203577 *
                                                 n_p_203492 * s_n_m_203636);
                                        int64_t num_threads_233179 =
                                                num_groups_211996 *
                                                segred_group_sizze_211995;
                                        int64_t threads_per_segment_233180 =
                                                groups_per_segment_233176 *
                                                segred_group_sizze_211995;
                                        
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n",
                                                    "\n# SegRed-large");
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "num_segments",
                                                    (long long) (partition_sizze_203577 *
                                                                 n_p_203492 *
                                                                 s_n_m_203636),
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "segment_size",
                                                    (long long) q_s_203493,
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "virt_num_groups",
                                                    (long long) virt_num_groups_233178,
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "num_groups",
                                                    (long long) num_groups_211996,
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "group_size",
                                                    (long long) segred_group_sizze_211995,
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "elems_per_thread",
                                                    (long long) elements_per_thread_233177,
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "groups_per_segment",
                                                    (long long) groups_per_segment_233176,
                                                    '\n');
                                        
                                        struct memblock_device
                                        segred_tmp_mem_233181;
                                        
                                        segred_tmp_mem_233181.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &segred_tmp_mem_233181,
                                                                  (int64_t) 8 *
                                                                  virt_num_groups_233178,
                                                                  "segred_tmp_mem_233181")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device
                                        mainzicounter_mem_233183 =
                                        ctx->mainzicounter_mem_233183;
                                        unsigned int shared_sizze_237467 = 1;
                                        unsigned int shared_sizze_237469 =
                                                     (int64_t) 8 *
                                                     segred_group_sizze_211995;
                                        CUdeviceptr kernel_arg_237471 =
                                                    ext_mem_229264.mem;
                                        CUdeviceptr kernel_arg_237472 =
                                                    ext_mem_229265.mem;
                                        CUdeviceptr kernel_arg_237473 =
                                                    ext_mem_229362.mem;
                                        CUdeviceptr kernel_arg_237474 =
                                                    ext_mem_229363.mem;
                                        CUdeviceptr kernel_arg_237475 =
                                                    mem_229531.mem;
                                        CUdeviceptr kernel_arg_237476 =
                                                    mem_229687.mem;
                                        CUdeviceptr kernel_arg_237477 =
                                                    mem_229697.mem;
                                        CUdeviceptr kernel_arg_237478 =
                                                    segred_tmp_mem_233181.mem;
                                        CUdeviceptr kernel_arg_237479 =
                                                    mainzicounter_mem_233183.mem;
                                        unsigned int shared_offset_237468 = 0;
                                        unsigned int shared_offset_237470 = 0 +
                                                     (shared_sizze_237467 + (8 -
                                                                             shared_sizze_237467 %
                                                                             8) %
                                                      8);
                                        
                                        if ((((((1 && num_groups_211996 != 0) &&
                                                1 != 0) && 1 != 0) &&
                                              segred_group_sizze_211995 != 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_211996;
                                            grid[perm[1]] = 1;
                                            grid[perm[2]] = 1;
                                            
                                            void *kernel_args_237464[] =
                                                 {&ctx->global_failure,
                                                  &shared_offset_237468,
                                                  &shared_offset_237470,
                                                  &n_p_203492, &q_s_203493,
                                                  &partition_sizze_203577,
                                                  &defunc_0_f_res_203631,
                                                  &s_n_m_203636,
                                                  &num_groups_211996,
                                                  &groups_per_segment_233176,
                                                  &elements_per_thread_233177,
                                                  &virt_num_groups_233178,
                                                  &threads_per_segment_233180,
                                                  &kernel_arg_237471,
                                                  &kernel_arg_237472,
                                                  &kernel_arg_237473,
                                                  &kernel_arg_237474,
                                                  &kernel_arg_237475,
                                                  &kernel_arg_237476,
                                                  &kernel_arg_237477,
                                                  &kernel_arg_237478,
                                                  &kernel_arg_237479};
                                            int64_t time_start_237465 = 0,
                                                    time_end_237466 = 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_212003",
                                                        (long) num_groups_211996,
                                                        (long) 1, (long) 1,
                                                        (long) segred_group_sizze_211995,
                                                        (long) 1, (long) 1,
                                                        (int) (0 +
                                                               (shared_sizze_237467 +
                                                                (8 -
                                                                 shared_sizze_237467 %
                                                                 8) % 8) +
                                                               (shared_sizze_237469 +
                                                                (8 -
                                                                 shared_sizze_237469 %
                                                                 8) % 8)));
                                                time_start_237465 =
                                                    get_wall_time();
                                            }
                                            
                                            cudaEvent_t *pevents = NULL;
                                            
                                            if (ctx->profiling &&
                                                !ctx->profiling_paused) {
                                                pevents =
                                                    cuda_get_events(&ctx->cuda,
                                                                    &ctx->mainzisegred_large_212003_runs,
                                                                    &ctx->mainzisegred_large_212003_total_runtime);
                                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                                   0));
                                            }
                                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_large_212003,
                                                                                  grid[0],
                                                                                  grid[1],
                                                                                  grid[2],
                                                                                  segred_group_sizze_211995,
                                                                                  1,
                                                                                  1,
                                                                                  0 +
                                                                                  (shared_sizze_237467 +
                                                                                   (8 -
                                                                                    shared_sizze_237467 %
                                                                                    8) %
                                                                                   8) +
                                                                                  (shared_sizze_237469 +
                                                                                   (8 -
                                                                                    shared_sizze_237469 %
                                                                                    8) %
                                                                                   8),
                                                                                  NULL,
                                                                                  kernel_args_237464,
                                                                                  NULL));
                                            if (pevents != NULL)
                                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                                   0));
                                            if (ctx->debugging) {
                                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                                time_end_237466 =
                                                    get_wall_time();
                                                fprintf(ctx->log,
                                                        "Kernel %s runtime: %ldus\n",
                                                        "main.segred_large_212003",
                                                        time_end_237466 -
                                                        time_start_237465);
                                            }
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n", "");
                                        if (memblock_unref_device(ctx,
                                                                  &segred_tmp_mem_233181,
                                                                  "segred_tmp_mem_233181") !=
                                            0)
                                            return 1;
                                    }
                                    if (memblock_unref_device(ctx, &mem_229687,
                                                              "mem_229687") !=
                                        0)
                                        return 1;
                                    
                                    int64_t segmap_usable_groups_212045 =
                                            sdiv_up64(nest_sizze_208848,
                                                      segmap_group_sizze_212044);
                                    struct memblock_device mem_229703;
                                    
                                    mem_229703.references = NULL;
                                    if (memblock_alloc_device(ctx, &mem_229703,
                                                              bytes_229297,
                                                              "mem_229703")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device mem_229708;
                                    
                                    mem_229708.references = NULL;
                                    if (memblock_alloc_device(ctx, &mem_229708,
                                                              bytes_229297,
                                                              "mem_229708")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                                    
                                    CUdeviceptr kernel_arg_237483 =
                                                mem_229697.mem;
                                    CUdeviceptr kernel_arg_237484 =
                                                mem_229703.mem;
                                    CUdeviceptr kernel_arg_237485 =
                                                mem_229708.mem;
                                    
                                    if ((((((1 && segmap_usable_groups_212045 !=
                                             0) && 1 != 0) && 1 != 0) &&
                                          segmap_group_sizze_212044 != 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_212045;
                                        grid[perm[1]] = 1;
                                        grid[perm[2]] = 1;
                                        
                                        void *kernel_args_237480[] =
                                             {&ctx->global_failure, &n_p_203492,
                                              &jump_s_203499,
                                              &partition_sizze_203577,
                                              &defunc_0_f_res_203631,
                                              &pad_css_len_203632,
                                              &s_n_m_203636, &kernel_arg_237483,
                                              &kernel_arg_237484,
                                              &kernel_arg_237485};
                                        int64_t time_start_237481 = 0,
                                                time_end_237482 = 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_212051",
                                                    (long) segmap_usable_groups_212045,
                                                    (long) 1, (long) 1,
                                                    (long) segmap_group_sizze_212044,
                                                    (long) 1, (long) 1,
                                                    (int) 0);
                                            time_start_237481 = get_wall_time();
                                        }
                                        
                                        cudaEvent_t *pevents = NULL;
                                        
                                        if (ctx->profiling &&
                                            !ctx->profiling_paused) {
                                            pevents =
                                                cuda_get_events(&ctx->cuda,
                                                                &ctx->mainzisegmap_212051_runs,
                                                                &ctx->mainzisegmap_212051_total_runtime);
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                               0));
                                        }
                                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_212051,
                                                                              grid[0],
                                                                              grid[1],
                                                                              grid[2],
                                                                              segmap_group_sizze_212044,
                                                                              1,
                                                                              1,
                                                                              0,
                                                                              NULL,
                                                                              kernel_args_237480,
                                                                              NULL));
                                        if (pevents != NULL)
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                               0));
                                        if (ctx->debugging) {
                                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                            time_end_237482 = get_wall_time();
                                            fprintf(ctx->log,
                                                    "Kernel %s runtime: %ldus\n",
                                                    "main.segmap_212051",
                                                    time_end_237482 -
                                                    time_start_237481);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_unref_device(ctx, &mem_229697,
                                                              "mem_229697") !=
                                        0)
                                        return 1;
                                    
                                    struct memblock_device mem_229714;
                                    
                                    mem_229714.references = NULL;
                                    if (memblock_alloc_device(ctx, &mem_229714,
                                                              bytes_229297,
                                                              "mem_229714")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    if (slt64(q_s_203493 * (int64_t) 2,
                                              segred_group_sizze_212069)) {
                                        int64_t segment_sizze_nonzzero_233233 =
                                                smax64((int64_t) 1, q_s_203493);
                                        int64_t num_threads_233234 =
                                                num_groups_212070 *
                                                segred_group_sizze_212069;
                                        
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n",
                                                    "\n# SegRed-small");
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "num_segments",
                                                    (long long) (partition_sizze_203577 *
                                                                 n_p_203492 *
                                                                 s_n_m_203636),
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "segment_size",
                                                    (long long) q_s_203493,
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "segments_per_group",
                                                    (long long) squot64(segred_group_sizze_212069,
                                                                        segment_sizze_nonzzero_233233),
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "required_groups",
                                                    (long long) sext_i64_i32(sdiv_up64(partition_sizze_203577 *
                                                                                       n_p_203492 *
                                                                                       s_n_m_203636,
                                                                                       squot64(segred_group_sizze_212069,
                                                                                               segment_sizze_nonzzero_233233))),
                                                    '\n');
                                        
                                        unsigned int shared_sizze_237489 =
                                                     (int64_t) 8 *
                                                     segred_group_sizze_212069;
                                        CUdeviceptr kernel_arg_237491 =
                                                    ext_mem_229264.mem;
                                        CUdeviceptr kernel_arg_237492 =
                                                    ext_mem_229265.mem;
                                        CUdeviceptr kernel_arg_237493 =
                                                    ext_mem_229362.mem;
                                        CUdeviceptr kernel_arg_237494 =
                                                    ext_mem_229363.mem;
                                        CUdeviceptr kernel_arg_237495 =
                                                    mem_229526.mem;
                                        CUdeviceptr kernel_arg_237496 =
                                                    mem_229531.mem;
                                        CUdeviceptr kernel_arg_237497 =
                                                    mem_229703.mem;
                                        CUdeviceptr kernel_arg_237498 =
                                                    mem_229708.mem;
                                        CUdeviceptr kernel_arg_237499 =
                                                    mem_229714.mem;
                                        unsigned int shared_offset_237490 = 0;
                                        
                                        if ((((((1 && num_groups_212070 != 0) &&
                                                1 != 0) && 1 != 0) &&
                                              segred_group_sizze_212069 != 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_212070;
                                            grid[perm[1]] = 1;
                                            grid[perm[2]] = 1;
                                            
                                            void *kernel_args_237486[] =
                                                 {&ctx->global_failure,
                                                  &shared_offset_237490,
                                                  &n_p_203492, &q_s_203493,
                                                  &partition_sizze_203577,
                                                  &defunc_0_f_res_203631,
                                                  &s_n_m_203636,
                                                  &num_groups_212070,
                                                  &segment_sizze_nonzzero_233233,
                                                  &kernel_arg_237491,
                                                  &kernel_arg_237492,
                                                  &kernel_arg_237493,
                                                  &kernel_arg_237494,
                                                  &kernel_arg_237495,
                                                  &kernel_arg_237496,
                                                  &kernel_arg_237497,
                                                  &kernel_arg_237498,
                                                  &kernel_arg_237499};
                                            int64_t time_start_237487 = 0,
                                                    time_end_237488 = 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_212077",
                                                        (long) num_groups_212070,
                                                        (long) 1, (long) 1,
                                                        (long) segred_group_sizze_212069,
                                                        (long) 1, (long) 1,
                                                        (int) (0 +
                                                               (shared_sizze_237489 +
                                                                (8 -
                                                                 shared_sizze_237489 %
                                                                 8) % 8)));
                                                time_start_237487 =
                                                    get_wall_time();
                                            }
                                            
                                            cudaEvent_t *pevents = NULL;
                                            
                                            if (ctx->profiling &&
                                                !ctx->profiling_paused) {
                                                pevents =
                                                    cuda_get_events(&ctx->cuda,
                                                                    &ctx->mainzisegred_small_212077_runs,
                                                                    &ctx->mainzisegred_small_212077_total_runtime);
                                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                                   0));
                                            }
                                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_small_212077,
                                                                                  grid[0],
                                                                                  grid[1],
                                                                                  grid[2],
                                                                                  segred_group_sizze_212069,
                                                                                  1,
                                                                                  1,
                                                                                  0 +
                                                                                  (shared_sizze_237489 +
                                                                                   (8 -
                                                                                    shared_sizze_237489 %
                                                                                    8) %
                                                                                   8),
                                                                                  NULL,
                                                                                  kernel_args_237486,
                                                                                  NULL));
                                            if (pevents != NULL)
                                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                                   0));
                                            if (ctx->debugging) {
                                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                                time_end_237488 =
                                                    get_wall_time();
                                                fprintf(ctx->log,
                                                        "Kernel %s runtime: %ldus\n",
                                                        "main.segred_small_212077",
                                                        time_end_237488 -
                                                        time_start_237487);
                                            }
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n", "");
                                    } else {
                                        int64_t groups_per_segment_233264 =
                                                sdiv_up64(num_groups_212070,
                                                          smax64((int64_t) 1,
                                                                 partition_sizze_203577 *
                                                                 n_p_203492 *
                                                                 s_n_m_203636));
                                        int64_t elements_per_thread_233265 =
                                                sdiv_up64(q_s_203493,
                                                          segred_group_sizze_212069 *
                                                          groups_per_segment_233264);
                                        int64_t virt_num_groups_233266 =
                                                groups_per_segment_233264 *
                                                (partition_sizze_203577 *
                                                 n_p_203492 * s_n_m_203636);
                                        int64_t num_threads_233267 =
                                                num_groups_212070 *
                                                segred_group_sizze_212069;
                                        int64_t threads_per_segment_233268 =
                                                groups_per_segment_233264 *
                                                segred_group_sizze_212069;
                                        
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n",
                                                    "\n# SegRed-large");
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "num_segments",
                                                    (long long) (partition_sizze_203577 *
                                                                 n_p_203492 *
                                                                 s_n_m_203636),
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "segment_size",
                                                    (long long) q_s_203493,
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "virt_num_groups",
                                                    (long long) virt_num_groups_233266,
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "num_groups",
                                                    (long long) num_groups_212070,
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "group_size",
                                                    (long long) segred_group_sizze_212069,
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "elems_per_thread",
                                                    (long long) elements_per_thread_233265,
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "groups_per_segment",
                                                    (long long) groups_per_segment_233264,
                                                    '\n');
                                        
                                        struct memblock_device
                                        segred_tmp_mem_233269;
                                        
                                        segred_tmp_mem_233269.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &segred_tmp_mem_233269,
                                                                  (int64_t) 8 *
                                                                  virt_num_groups_233266,
                                                                  "segred_tmp_mem_233269")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device
                                        mainzicounter_mem_233271 =
                                        ctx->mainzicounter_mem_233271;
                                        unsigned int shared_sizze_237504 = 1;
                                        unsigned int shared_sizze_237506 =
                                                     (int64_t) 8 *
                                                     segred_group_sizze_212069;
                                        CUdeviceptr kernel_arg_237508 =
                                                    ext_mem_229264.mem;
                                        CUdeviceptr kernel_arg_237509 =
                                                    ext_mem_229265.mem;
                                        CUdeviceptr kernel_arg_237510 =
                                                    ext_mem_229362.mem;
                                        CUdeviceptr kernel_arg_237511 =
                                                    ext_mem_229363.mem;
                                        CUdeviceptr kernel_arg_237512 =
                                                    mem_229526.mem;
                                        CUdeviceptr kernel_arg_237513 =
                                                    mem_229531.mem;
                                        CUdeviceptr kernel_arg_237514 =
                                                    mem_229703.mem;
                                        CUdeviceptr kernel_arg_237515 =
                                                    mem_229708.mem;
                                        CUdeviceptr kernel_arg_237516 =
                                                    mem_229714.mem;
                                        CUdeviceptr kernel_arg_237517 =
                                                    segred_tmp_mem_233269.mem;
                                        CUdeviceptr kernel_arg_237518 =
                                                    mainzicounter_mem_233271.mem;
                                        unsigned int shared_offset_237505 = 0;
                                        unsigned int shared_offset_237507 = 0 +
                                                     (shared_sizze_237504 + (8 -
                                                                             shared_sizze_237504 %
                                                                             8) %
                                                      8);
                                        
                                        if ((((((1 && num_groups_212070 != 0) &&
                                                1 != 0) && 1 != 0) &&
                                              segred_group_sizze_212069 != 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_212070;
                                            grid[perm[1]] = 1;
                                            grid[perm[2]] = 1;
                                            
                                            void *kernel_args_237501[] =
                                                 {&ctx->global_failure,
                                                  &shared_offset_237505,
                                                  &shared_offset_237507,
                                                  &n_p_203492, &q_s_203493,
                                                  &partition_sizze_203577,
                                                  &defunc_0_f_res_203631,
                                                  &s_n_m_203636,
                                                  &num_groups_212070,
                                                  &groups_per_segment_233264,
                                                  &elements_per_thread_233265,
                                                  &virt_num_groups_233266,
                                                  &threads_per_segment_233268,
                                                  &kernel_arg_237508,
                                                  &kernel_arg_237509,
                                                  &kernel_arg_237510,
                                                  &kernel_arg_237511,
                                                  &kernel_arg_237512,
                                                  &kernel_arg_237513,
                                                  &kernel_arg_237514,
                                                  &kernel_arg_237515,
                                                  &kernel_arg_237516,
                                                  &kernel_arg_237517,
                                                  &kernel_arg_237518};
                                            int64_t time_start_237502 = 0,
                                                    time_end_237503 = 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_212077",
                                                        (long) num_groups_212070,
                                                        (long) 1, (long) 1,
                                                        (long) segred_group_sizze_212069,
                                                        (long) 1, (long) 1,
                                                        (int) (0 +
                                                               (shared_sizze_237504 +
                                                                (8 -
                                                                 shared_sizze_237504 %
                                                                 8) % 8) +
                                                               (shared_sizze_237506 +
                                                                (8 -
                                                                 shared_sizze_237506 %
                                                                 8) % 8)));
                                                time_start_237502 =
                                                    get_wall_time();
                                            }
                                            
                                            cudaEvent_t *pevents = NULL;
                                            
                                            if (ctx->profiling &&
                                                !ctx->profiling_paused) {
                                                pevents =
                                                    cuda_get_events(&ctx->cuda,
                                                                    &ctx->mainzisegred_large_212077_runs,
                                                                    &ctx->mainzisegred_large_212077_total_runtime);
                                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                                   0));
                                            }
                                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_large_212077,
                                                                                  grid[0],
                                                                                  grid[1],
                                                                                  grid[2],
                                                                                  segred_group_sizze_212069,
                                                                                  1,
                                                                                  1,
                                                                                  0 +
                                                                                  (shared_sizze_237504 +
                                                                                   (8 -
                                                                                    shared_sizze_237504 %
                                                                                    8) %
                                                                                   8) +
                                                                                  (shared_sizze_237506 +
                                                                                   (8 -
                                                                                    shared_sizze_237506 %
                                                                                    8) %
                                                                                   8),
                                                                                  NULL,
                                                                                  kernel_args_237501,
                                                                                  NULL));
                                            if (pevents != NULL)
                                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                                   0));
                                            if (ctx->debugging) {
                                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                                time_end_237503 =
                                                    get_wall_time();
                                                fprintf(ctx->log,
                                                        "Kernel %s runtime: %ldus\n",
                                                        "main.segred_large_212077",
                                                        time_end_237503 -
                                                        time_start_237502);
                                            }
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n", "");
                                        if (memblock_unref_device(ctx,
                                                                  &segred_tmp_mem_233269,
                                                                  "segred_tmp_mem_233269") !=
                                            0)
                                            return 1;
                                    }
                                    if (memblock_unref_device(ctx, &mem_229703,
                                                              "mem_229703") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229708,
                                                              "mem_229708") !=
                                        0)
                                        return 1;
                                    if (memblock_set_device(ctx,
                                                            &ext_mem_229715,
                                                            &mem_229714,
                                                            "mem_229714") != 0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229714,
                                                              "mem_229714") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229708,
                                                              "mem_229708") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229703,
                                                              "mem_229703") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229697,
                                                              "mem_229697") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229691,
                                                              "mem_229691") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229687,
                                                              "mem_229687") !=
                                        0)
                                        return 1;
                                }
                                if (memblock_set_device(ctx, &ext_mem_229716,
                                                        &ext_mem_229715,
                                                        "ext_mem_229715") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229715,
                                                          "ext_mem_229715") !=
                                    0)
                                    return 1;
                            }
                            if (memblock_set_device(ctx, &ext_mem_229723,
                                                    &ext_mem_229716,
                                                    "ext_mem_229716") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229716,
                                                      "ext_mem_229716") != 0)
                                return 1;
                        }
                        if (memblock_set_device(ctx, &ext_mem_229730,
                                                &ext_mem_229723,
                                                "ext_mem_229723") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229723,
                                                  "ext_mem_229723") != 0)
                            return 1;
                    }
                    if (memblock_set_device(ctx, &ext_mem_230420,
                                            &ext_mem_229730,
                                            "ext_mem_229730") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_230419, &mem_229536,
                                            "mem_229536") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229730,
                                              "ext_mem_229730") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229536, "mem_229536") !=
                        0)
                        return 1;
                } else {
                    bool match_lit_204336 = (int64_t) 1 == d_s_203496;
                    struct memblock_device ext_mem_230418;
                    
                    ext_mem_230418.references = NULL;
                    
                    struct memblock_device ext_mem_230417;
                    
                    ext_mem_230417.references = NULL;
                    if (match_lit_204336) {
                        bool suff_outer_par_212129;
                        
                        suff_outer_par_212129 =
                            *ctx->tuning_params.mainzisuff_outer_par_11 <=
                            partition_sizze_203577;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_11",
                                    (long) partition_sizze_203577,
                                    suff_outer_par_212129 ? "true" : "false");
                        
                        int64_t segmap_group_sizze_212259;
                        
                        segmap_group_sizze_212259 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_212133;
                        
                        int64_t num_groups_212260;
                        int32_t max_num_groups_233313;
                        
                        max_num_groups_233313 =
                            *ctx->tuning_params.mainzisegmap_num_groups_212135;
                        num_groups_212260 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(partition_sizze_203577,
                                                                                 segmap_group_sizze_212259),
                                                                       sext_i32_i64(max_num_groups_233313))));
                        
                        int64_t segmap_group_sizze_213696;
                        
                        segmap_group_sizze_213696 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_212389;
                        
                        int64_t num_groups_213697;
                        int32_t max_num_groups_233314;
                        
                        max_num_groups_233314 =
                            *ctx->tuning_params.mainzisegmap_num_groups_212391;
                        num_groups_213697 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(binop_x_229202,
                                                                                 segmap_group_sizze_213696),
                                                                       sext_i32_i64(max_num_groups_233314))));
                        
                        bool suff_outer_par_213701;
                        
                        suff_outer_par_213701 =
                            *ctx->tuning_params.mainzisuff_outer_par_12 <=
                            binop_x_229202;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_12",
                                    (long) binop_x_229202,
                                    suff_outer_par_213701 ? "true" : "false");
                        
                        int64_t one_intra_par_min_213702 = q_s_203493 *
                                s_n_m_203636;
                        int64_t intra_avail_par_213704 = smin64(s_n_m_203636,
                                                                one_intra_par_min_213702);
                        int64_t computed_group_sizze_213705 =
                                smax64(s_n_m_203636, one_intra_par_min_213702);
                        bool fits_213709 = sle64(computed_group_sizze_213705,
                                                 max_group_sizze_206887);
                        bool suff_intra_par_213711;
                        
                        suff_intra_par_213711 =
                            *ctx->tuning_params.mainzisuff_intra_par_13 <=
                            intra_avail_par_213704;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_intra_par_13",
                                    (long) intra_avail_par_213704,
                                    suff_intra_par_213711 ? "true" : "false");
                        
                        bool intra_suff_and_fits_213712 = fits_213709 &&
                             suff_intra_par_213711;
                        int64_t segmap_group_sizze_213981;
                        
                        segmap_group_sizze_213981 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_212822;
                        
                        bool suff_outer_par_213986;
                        
                        suff_outer_par_213986 =
                            *ctx->tuning_params.mainzisuff_outer_par_14 <=
                            nest_sizze_208848;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_14",
                                    (long) nest_sizze_208848,
                                    suff_outer_par_213986 ? "true" : "false");
                        
                        int64_t segmap_group_sizze_214104;
                        
                        segmap_group_sizze_214104 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_213157;
                        
                        int64_t nest_sizze_214126 = q_s_203493 *
                                nest_sizze_208848;
                        int64_t segred_group_sizze_214127;
                        
                        segred_group_sizze_214127 =
                            *ctx->tuning_params.mainzisegred_group_sizze_213093;
                        
                        int64_t num_groups_214128;
                        int32_t max_num_groups_233315;
                        
                        max_num_groups_233315 =
                            *ctx->tuning_params.mainzisegred_num_groups_213095;
                        num_groups_214128 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(nest_sizze_214126,
                                                                                 segred_group_sizze_214127),
                                                                       sext_i32_i64(max_num_groups_233315))));
                        
                        int64_t segmap_group_sizze_214186;
                        
                        segmap_group_sizze_214186 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_213054;
                        
                        int64_t segred_group_sizze_214222;
                        
                        segred_group_sizze_214222 =
                            *ctx->tuning_params.mainzisegred_group_sizze_212960;
                        
                        int64_t num_groups_214223;
                        int32_t max_num_groups_233316;
                        
                        max_num_groups_233316 =
                            *ctx->tuning_params.mainzisegred_num_groups_212962;
                        num_groups_214223 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(nest_sizze_214126,
                                                                                 segred_group_sizze_214222),
                                                                       sext_i32_i64(max_num_groups_233316))));
                        
                        int64_t bytes_229733 = (int64_t) 8 * nest_sizze_208848;
                        int64_t bytes_229740 = (int64_t) 8 * nest_sizze_207163;
                        int64_t binop_x_229851 = partition_sizze_203577 *
                                s_n_m_203636;
                        int64_t binop_x_229852 = n_p_203492 * binop_x_229851;
                        int64_t bytes_229853 = (int64_t) 8 * binop_x_229852;
                        int64_t binop_x_229859 = partition_sizze_203577 *
                                defunc_0_f_res_203631;
                        int64_t binop_x_229860 = n_p_203492 * binop_x_229859;
                        int64_t bytes_229861 = (int64_t) 8 * binop_x_229860;
                        int64_t bytes_229915 = smax64((int64_t) 0,
                                                      s_n_m_203636);
                        int64_t bytes_229976 = smax64((int64_t) 0,
                                                      binop_x_229295);
                        int64_t num_threads_232119 = segmap_group_sizze_212259 *
                                num_groups_212260;
                        int64_t total_sizze_232120 = bytes_229288 *
                                num_threads_232119;
                        int64_t total_sizze_232121 = bytes_229288 *
                                num_threads_232119;
                        int64_t num_threads_232122 = segmap_group_sizze_213696 *
                                num_groups_213697;
                        int64_t total_sizze_232123 = bytes_229311 *
                                num_threads_232122;
                        int64_t total_sizze_232124 = bytes_229311 *
                                num_threads_232122;
                        struct memblock_device ext_mem_230057;
                        
                        ext_mem_230057.references = NULL;
                        
                        struct memblock_device ext_mem_230056;
                        
                        ext_mem_230056.references = NULL;
                        
                        int32_t local_memory_capacity_233687;
                        
                        local_memory_capacity_233687 =
                            ctx->cuda.max_shared_memory;
                        if (sle64((int64_t) 0,
                                  sext_i32_i64(local_memory_capacity_233687)) &&
                            suff_outer_par_212129) {
                            struct memblock_device mem_229734;
                            
                            mem_229734.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229734,
                                                      bytes_229733,
                                                      "mem_229734")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_229734,
                                                                      (int64_t) 0,
                                                                      ext_mem_229362,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_p_203492 *
                                                                      s_n_m_203636,
                                                                      partition_sizze_203577) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_229734,
                                                          "mem_229734") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230056,
                                                          "ext_mem_230056") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230057,
                                                          "ext_mem_230057") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230417,
                                                          "ext_mem_230417") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230418,
                                                          "ext_mem_230418") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230419,
                                                          "ext_mem_230419") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230420,
                                                          "ext_mem_230420") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_229737;
                            
                            mem_229737.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229737,
                                                      binop_y_229224,
                                                      "mem_229737")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_229737,
                                                                      (int64_t) 0,
                                                                      ext_mem_229264,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_p_203492,
                                                                      partition_sizze_203577) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_229737,
                                                          "mem_229737") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229734,
                                                          "mem_229734") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230056,
                                                          "ext_mem_230056") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230057,
                                                          "ext_mem_230057") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230417,
                                                          "ext_mem_230417") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230418,
                                                          "ext_mem_230418") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230419,
                                                          "ext_mem_230419") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230420,
                                                          "ext_mem_230420") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_229741;
                            
                            mem_229741.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229741,
                                                      bytes_229740,
                                                      "mem_229741")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_229741,
                                                                      (int64_t) 0,
                                                                      mem_229531,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_p_203492 *
                                                                      defunc_0_f_res_203631,
                                                                      partition_sizze_203577) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_229741,
                                                          "mem_229741") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229737,
                                                          "mem_229737") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229734,
                                                          "mem_229734") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230056,
                                                          "ext_mem_230056") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230057,
                                                          "ext_mem_230057") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230417,
                                                          "ext_mem_230417") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230418,
                                                          "ext_mem_230418") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230419,
                                                          "ext_mem_230419") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230420,
                                                          "ext_mem_230420") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_229745;
                            
                            mem_229745.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229745,
                                                      bytes_229733,
                                                      "mem_229745")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_229745,
                                                                      (int64_t) 0,
                                                                      ext_mem_229363,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_p_203492 *
                                                                      s_n_m_203636,
                                                                      partition_sizze_203577) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_229745,
                                                          "mem_229745") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229741,
                                                          "mem_229741") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229737,
                                                          "mem_229737") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229734,
                                                          "mem_229734") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230056,
                                                          "ext_mem_230056") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230057,
                                                          "ext_mem_230057") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230417,
                                                          "ext_mem_230417") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230418,
                                                          "ext_mem_230418") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230419,
                                                          "ext_mem_230419") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230420,
                                                          "ext_mem_230420") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_229749;
                            
                            mem_229749.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229749,
                                                      bytes_229740,
                                                      "mem_229749")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_229749,
                                                                      (int64_t) 0,
                                                                      mem_229526,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_p_203492 *
                                                                      defunc_0_f_res_203631,
                                                                      partition_sizze_203577) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_229749,
                                                          "mem_229749") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229745,
                                                          "mem_229745") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229741,
                                                          "mem_229741") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229737,
                                                          "mem_229737") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229734,
                                                          "mem_229734") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230056,
                                                          "ext_mem_230056") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230057,
                                                          "ext_mem_230057") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230417,
                                                          "ext_mem_230417") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230418,
                                                          "ext_mem_230418") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230419,
                                                          "ext_mem_230419") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230420,
                                                          "ext_mem_230420") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_229753;
                            
                            mem_229753.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229753,
                                                      bytes_229740,
                                                      "mem_229753")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_229753,
                                                                      (int64_t) 0,
                                                                      ext_mem_229265,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_p_203492 *
                                                                      defunc_0_f_res_203631,
                                                                      partition_sizze_203577) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_229753,
                                                          "mem_229753") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229749,
                                                          "mem_229749") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229745,
                                                          "mem_229745") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229741,
                                                          "mem_229741") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229737,
                                                          "mem_229737") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229734,
                                                          "mem_229734") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230056,
                                                          "ext_mem_230056") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230057,
                                                          "ext_mem_230057") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230417,
                                                          "ext_mem_230417") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230418,
                                                          "ext_mem_230418") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230419,
                                                          "ext_mem_230419") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230420,
                                                          "ext_mem_230420") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_229846;
                            
                            mem_229846.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229846,
                                                      bytes_229733,
                                                      "mem_229846")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_229850;
                            
                            mem_229850.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229850,
                                                      bytes_229733,
                                                      "mem_229850")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_231992;
                            
                            color_231992.references = NULL;
                            if (memblock_alloc_device(ctx, &color_231992,
                                                      total_sizze_232120,
                                                      "color_231992")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_231993;
                            
                            color_231993.references = NULL;
                            if (memblock_alloc_device(ctx, &color_231993,
                                                      total_sizze_232121,
                                                      "color_231993")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            
                            CUdeviceptr kernel_arg_237522 = mem_229734.mem;
                            CUdeviceptr kernel_arg_237523 = mem_229737.mem;
                            CUdeviceptr kernel_arg_237524 = mem_229741.mem;
                            CUdeviceptr kernel_arg_237525 = mem_229745.mem;
                            CUdeviceptr kernel_arg_237526 = mem_229749.mem;
                            CUdeviceptr kernel_arg_237527 = mem_229753.mem;
                            CUdeviceptr kernel_arg_237528 = mem_229846.mem;
                            CUdeviceptr kernel_arg_237529 = mem_229850.mem;
                            CUdeviceptr kernel_arg_237530 = color_231992.mem;
                            CUdeviceptr kernel_arg_237531 = color_231993.mem;
                            
                            if ((((((1 && num_groups_212260 != 0) && 1 != 0) &&
                                   1 != 0) && segmap_group_sizze_212259 != 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_212260;
                                grid[perm[1]] = 1;
                                grid[perm[2]] = 1;
                                
                                void *kernel_args_237519[] =
                                     {&ctx->global_failure, &n_p_203492,
                                      &q_s_203493, &jump_s_203499,
                                      &partition_sizze_203577,
                                      &defunc_0_f_res_203631,
                                      &pad_css_len_203632, &s_n_m_203636,
                                      &num_groups_212260, &num_threads_232119,
                                      &kernel_arg_237522, &kernel_arg_237523,
                                      &kernel_arg_237524, &kernel_arg_237525,
                                      &kernel_arg_237526, &kernel_arg_237527,
                                      &kernel_arg_237528, &kernel_arg_237529,
                                      &kernel_arg_237530, &kernel_arg_237531};
                                int64_t time_start_237520 = 0, time_end_237521 =
                                        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_212265",
                                            (long) num_groups_212260, (long) 1,
                                            (long) 1,
                                            (long) segmap_group_sizze_212259,
                                            (long) 1, (long) 1, (int) 0);
                                    time_start_237520 = get_wall_time();
                                }
                                
                                cudaEvent_t *pevents = NULL;
                                
                                if (ctx->profiling && !ctx->profiling_paused) {
                                    pevents = cuda_get_events(&ctx->cuda,
                                                              &ctx->mainzisegmap_212265_runs,
                                                              &ctx->mainzisegmap_212265_total_runtime);
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                       0));
                                }
                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_212265,
                                                                      grid[0],
                                                                      grid[1],
                                                                      grid[2],
                                                                      segmap_group_sizze_212259,
                                                                      1, 1, 0,
                                                                      NULL,
                                                                      kernel_args_237519,
                                                                      NULL));
                                if (pevents != NULL)
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                       0));
                                if (ctx->debugging) {
                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                    time_end_237521 = get_wall_time();
                                    fprintf(ctx->log,
                                            "Kernel %s runtime: %ldus\n",
                                            "main.segmap_212265",
                                            time_end_237521 -
                                            time_start_237520);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx, &mem_229734,
                                                      "mem_229734") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229737,
                                                      "mem_229737") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229741,
                                                      "mem_229741") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229745,
                                                      "mem_229745") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229749,
                                                      "mem_229749") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229753,
                                                      "mem_229753") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_231992,
                                                      "color_231992") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_231993,
                                                      "color_231993") != 0)
                                return 1;
                            
                            struct memblock_device mem_230048;
                            
                            mem_230048.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230048,
                                                      bytes_229297,
                                                      "mem_230048")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230048,
                                                                      (int64_t) 0,
                                                                      mem_229846,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      partition_sizze_203577,
                                                                      n_p_203492 *
                                                                      s_n_m_203636) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230048,
                                                          "mem_230048") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_231993,
                                                          "color_231993") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_231992,
                                                          "color_231992") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229850,
                                                          "mem_229850") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229846,
                                                          "mem_229846") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229753,
                                                          "mem_229753") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229749,
                                                          "mem_229749") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229745,
                                                          "mem_229745") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229741,
                                                          "mem_229741") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229737,
                                                          "mem_229737") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229734,
                                                          "mem_229734") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230056,
                                                          "ext_mem_230056") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230057,
                                                          "ext_mem_230057") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230417,
                                                          "ext_mem_230417") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230418,
                                                          "ext_mem_230418") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230419,
                                                          "ext_mem_230419") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230420,
                                                          "ext_mem_230420") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_229846,
                                                      "mem_229846") != 0)
                                return 1;
                            
                            struct memblock_device mem_230054;
                            
                            mem_230054.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230054,
                                                      bytes_229297,
                                                      "mem_230054")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230054,
                                                                      (int64_t) 0,
                                                                      mem_229850,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      partition_sizze_203577,
                                                                      n_p_203492 *
                                                                      s_n_m_203636) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230054,
                                                          "mem_230054") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230048,
                                                          "mem_230048") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_231993,
                                                          "color_231993") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_231992,
                                                          "color_231992") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229850,
                                                          "mem_229850") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229846,
                                                          "mem_229846") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229753,
                                                          "mem_229753") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229749,
                                                          "mem_229749") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229745,
                                                          "mem_229745") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229741,
                                                          "mem_229741") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229737,
                                                          "mem_229737") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229734,
                                                          "mem_229734") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230056,
                                                          "ext_mem_230056") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230057,
                                                          "ext_mem_230057") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230417,
                                                          "ext_mem_230417") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230418,
                                                          "ext_mem_230418") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230419,
                                                          "ext_mem_230419") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230420,
                                                          "ext_mem_230420") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_229850,
                                                      "mem_229850") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_230057,
                                                    &mem_230048,
                                                    "mem_230048") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_230056,
                                                    &mem_230054,
                                                    "mem_230054") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230054,
                                                      "mem_230054") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230048,
                                                      "mem_230048") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_231993,
                                                      "color_231993") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_231992,
                                                      "color_231992") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229850,
                                                      "mem_229850") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229846,
                                                      "mem_229846") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229753,
                                                      "mem_229753") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229749,
                                                      "mem_229749") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229745,
                                                      "mem_229745") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229741,
                                                      "mem_229741") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229737,
                                                      "mem_229737") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229734,
                                                      "mem_229734") != 0)
                                return 1;
                        } else {
                            struct memblock_device ext_mem_230043;
                            
                            ext_mem_230043.references = NULL;
                            
                            struct memblock_device ext_mem_230042;
                            
                            ext_mem_230042.references = NULL;
                            
                            int32_t local_memory_capacity_233686;
                            
                            local_memory_capacity_233686 =
                                ctx->cuda.max_shared_memory;
                            if (sle64((int64_t) 0,
                                      sext_i32_i64(local_memory_capacity_233686)) &&
                                suff_outer_par_213701) {
                                struct memblock_device mem_229854;
                                
                                mem_229854.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_229854,
                                                          bytes_229853,
                                                          "mem_229854")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                          mem_229854,
                                                                          (int64_t) 0,
                                                                          ext_mem_229363,
                                                                          (int64_t) 0,
                                                                          (int64_t) 1,
                                                                          s_n_m_203636,
                                                                          partition_sizze_203577 *
                                                                          n_p_203492) !=
                                    0) {
                                    if (memblock_unref_device(ctx, &mem_229854,
                                                              "mem_229854") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230042,
                                                              "ext_mem_230042") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230043,
                                                              "ext_mem_230043") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230056,
                                                              "ext_mem_230056") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230057,
                                                              "ext_mem_230057") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230417,
                                                              "ext_mem_230417") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230418,
                                                              "ext_mem_230418") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230419,
                                                              "ext_mem_230419") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230420,
                                                              "ext_mem_230420") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230486,
                                                              "ext_mem_230486") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230487,
                                                              "ext_mem_230487") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229515,
                                                              "mem_param_229515") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229507,
                                                              "mem_param_229507") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231517,
                                                              "ext_mem_231517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231518,
                                                              "ext_mem_231518") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229493,
                                                              "mem_param_229493") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229485,
                                                              "mem_param_229485") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229477,
                                                              "mem_param_229477") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231860,
                                                              "ext_mem_231860") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231861,
                                                              "ext_mem_231861") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231862,
                                                              "ext_mem_231862") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230551,
                                                              "mem_230551") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230534,
                                                              "mem_230534") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230517,
                                                              "mem_230517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230500,
                                                              "mem_230500") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229531,
                                                              "mem_229531") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229526,
                                                              "mem_229526") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229520,
                                                              "mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229469,
                                                              "mem_229469") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229465,
                                                              "mem_229465") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229460,
                                                              "ext_mem_229460") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229461,
                                                              "ext_mem_229461") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229411,
                                                              "ext_mem_229411") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229412,
                                                              "ext_mem_229412") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229362,
                                                              "ext_mem_229362") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229363,
                                                              "ext_mem_229363") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229264,
                                                              "ext_mem_229264") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229265,
                                                              "ext_mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229206,
                                                              "mem_229206") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229200,
                                                              "mem_229200") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229196,
                                                              "ext_mem_229196") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229197,
                                                              "ext_mem_229197") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229164,
                                                              "mem_229164") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229161,
                                                              "mem_229161") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229157,
                                                              "mem_229157") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229155,
                                                              "mem_229155") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229152,
                                                              "mem_229152") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229148,
                                                              "mem_229148") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232249,
                                                              "mem_out_232249") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232248,
                                                              "mem_out_232248") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232247,
                                                              "mem_out_232247") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_229858;
                                
                                mem_229858.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_229858,
                                                          bytes_229853,
                                                          "mem_229858")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                          mem_229858,
                                                                          (int64_t) 0,
                                                                          ext_mem_229362,
                                                                          (int64_t) 0,
                                                                          (int64_t) 1,
                                                                          s_n_m_203636,
                                                                          partition_sizze_203577 *
                                                                          n_p_203492) !=
                                    0) {
                                    if (memblock_unref_device(ctx, &mem_229858,
                                                              "mem_229858") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229854,
                                                              "mem_229854") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230042,
                                                              "ext_mem_230042") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230043,
                                                              "ext_mem_230043") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230056,
                                                              "ext_mem_230056") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230057,
                                                              "ext_mem_230057") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230417,
                                                              "ext_mem_230417") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230418,
                                                              "ext_mem_230418") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230419,
                                                              "ext_mem_230419") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230420,
                                                              "ext_mem_230420") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230486,
                                                              "ext_mem_230486") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230487,
                                                              "ext_mem_230487") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229515,
                                                              "mem_param_229515") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229507,
                                                              "mem_param_229507") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231517,
                                                              "ext_mem_231517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231518,
                                                              "ext_mem_231518") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229493,
                                                              "mem_param_229493") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229485,
                                                              "mem_param_229485") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229477,
                                                              "mem_param_229477") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231860,
                                                              "ext_mem_231860") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231861,
                                                              "ext_mem_231861") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231862,
                                                              "ext_mem_231862") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230551,
                                                              "mem_230551") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230534,
                                                              "mem_230534") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230517,
                                                              "mem_230517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230500,
                                                              "mem_230500") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229531,
                                                              "mem_229531") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229526,
                                                              "mem_229526") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229520,
                                                              "mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229469,
                                                              "mem_229469") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229465,
                                                              "mem_229465") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229460,
                                                              "ext_mem_229460") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229461,
                                                              "ext_mem_229461") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229411,
                                                              "ext_mem_229411") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229412,
                                                              "ext_mem_229412") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229362,
                                                              "ext_mem_229362") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229363,
                                                              "ext_mem_229363") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229264,
                                                              "ext_mem_229264") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229265,
                                                              "ext_mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229206,
                                                              "mem_229206") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229200,
                                                              "mem_229200") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229196,
                                                              "ext_mem_229196") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229197,
                                                              "ext_mem_229197") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229164,
                                                              "mem_229164") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229161,
                                                              "mem_229161") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229157,
                                                              "mem_229157") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229155,
                                                              "mem_229155") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229152,
                                                              "mem_229152") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229148,
                                                              "mem_229148") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232249,
                                                              "mem_out_232249") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232248,
                                                              "mem_out_232248") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232247,
                                                              "mem_out_232247") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_229862;
                                
                                mem_229862.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_229862,
                                                          bytes_229861,
                                                          "mem_229862")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                          mem_229862,
                                                                          (int64_t) 0,
                                                                          ext_mem_229265,
                                                                          (int64_t) 0,
                                                                          (int64_t) 1,
                                                                          defunc_0_f_res_203631,
                                                                          partition_sizze_203577 *
                                                                          n_p_203492) !=
                                    0) {
                                    if (memblock_unref_device(ctx, &mem_229862,
                                                              "mem_229862") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229858,
                                                              "mem_229858") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229854,
                                                              "mem_229854") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230042,
                                                              "ext_mem_230042") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230043,
                                                              "ext_mem_230043") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230056,
                                                              "ext_mem_230056") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230057,
                                                              "ext_mem_230057") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230417,
                                                              "ext_mem_230417") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230418,
                                                              "ext_mem_230418") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230419,
                                                              "ext_mem_230419") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230420,
                                                              "ext_mem_230420") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230486,
                                                              "ext_mem_230486") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230487,
                                                              "ext_mem_230487") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229515,
                                                              "mem_param_229515") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229507,
                                                              "mem_param_229507") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231517,
                                                              "ext_mem_231517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231518,
                                                              "ext_mem_231518") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229493,
                                                              "mem_param_229493") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229485,
                                                              "mem_param_229485") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229477,
                                                              "mem_param_229477") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231860,
                                                              "ext_mem_231860") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231861,
                                                              "ext_mem_231861") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231862,
                                                              "ext_mem_231862") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230551,
                                                              "mem_230551") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230534,
                                                              "mem_230534") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230517,
                                                              "mem_230517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230500,
                                                              "mem_230500") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229531,
                                                              "mem_229531") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229526,
                                                              "mem_229526") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229520,
                                                              "mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229469,
                                                              "mem_229469") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229465,
                                                              "mem_229465") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229460,
                                                              "ext_mem_229460") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229461,
                                                              "ext_mem_229461") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229411,
                                                              "ext_mem_229411") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229412,
                                                              "ext_mem_229412") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229362,
                                                              "ext_mem_229362") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229363,
                                                              "ext_mem_229363") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229264,
                                                              "ext_mem_229264") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229265,
                                                              "ext_mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229206,
                                                              "mem_229206") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229200,
                                                              "mem_229200") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229196,
                                                              "ext_mem_229196") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229197,
                                                              "ext_mem_229197") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229164,
                                                              "mem_229164") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229161,
                                                              "mem_229161") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229157,
                                                              "mem_229157") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229155,
                                                              "mem_229155") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229152,
                                                              "mem_229152") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229148,
                                                              "mem_229148") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232249,
                                                              "mem_out_232249") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232248,
                                                              "mem_out_232248") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232247,
                                                              "mem_out_232247") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_229866;
                                
                                mem_229866.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_229866,
                                                          bytes_229861,
                                                          "mem_229866")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                          mem_229866,
                                                                          (int64_t) 0,
                                                                          mem_229531,
                                                                          (int64_t) 0,
                                                                          (int64_t) 1,
                                                                          defunc_0_f_res_203631,
                                                                          partition_sizze_203577 *
                                                                          n_p_203492) !=
                                    0) {
                                    if (memblock_unref_device(ctx, &mem_229866,
                                                              "mem_229866") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229862,
                                                              "mem_229862") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229858,
                                                              "mem_229858") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229854,
                                                              "mem_229854") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230042,
                                                              "ext_mem_230042") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230043,
                                                              "ext_mem_230043") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230056,
                                                              "ext_mem_230056") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230057,
                                                              "ext_mem_230057") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230417,
                                                              "ext_mem_230417") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230418,
                                                              "ext_mem_230418") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230419,
                                                              "ext_mem_230419") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230420,
                                                              "ext_mem_230420") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230486,
                                                              "ext_mem_230486") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230487,
                                                              "ext_mem_230487") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229515,
                                                              "mem_param_229515") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229507,
                                                              "mem_param_229507") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231517,
                                                              "ext_mem_231517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231518,
                                                              "ext_mem_231518") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229493,
                                                              "mem_param_229493") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229485,
                                                              "mem_param_229485") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229477,
                                                              "mem_param_229477") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231860,
                                                              "ext_mem_231860") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231861,
                                                              "ext_mem_231861") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231862,
                                                              "ext_mem_231862") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230551,
                                                              "mem_230551") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230534,
                                                              "mem_230534") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230517,
                                                              "mem_230517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230500,
                                                              "mem_230500") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229531,
                                                              "mem_229531") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229526,
                                                              "mem_229526") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229520,
                                                              "mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229469,
                                                              "mem_229469") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229465,
                                                              "mem_229465") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229460,
                                                              "ext_mem_229460") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229461,
                                                              "ext_mem_229461") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229411,
                                                              "ext_mem_229411") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229412,
                                                              "ext_mem_229412") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229362,
                                                              "ext_mem_229362") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229363,
                                                              "ext_mem_229363") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229264,
                                                              "ext_mem_229264") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229265,
                                                              "ext_mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229206,
                                                              "mem_229206") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229200,
                                                              "mem_229200") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229196,
                                                              "ext_mem_229196") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229197,
                                                              "ext_mem_229197") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229164,
                                                              "mem_229164") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229161,
                                                              "mem_229161") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229157,
                                                              "mem_229157") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229155,
                                                              "mem_229155") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229152,
                                                              "mem_229152") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229148,
                                                              "mem_229148") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232249,
                                                              "mem_out_232249") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232248,
                                                              "mem_out_232248") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232247,
                                                              "mem_out_232247") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_229870;
                                
                                mem_229870.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_229870,
                                                          bytes_229861,
                                                          "mem_229870")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                          mem_229870,
                                                                          (int64_t) 0,
                                                                          mem_229526,
                                                                          (int64_t) 0,
                                                                          (int64_t) 1,
                                                                          defunc_0_f_res_203631,
                                                                          partition_sizze_203577 *
                                                                          n_p_203492) !=
                                    0) {
                                    if (memblock_unref_device(ctx, &mem_229870,
                                                              "mem_229870") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229866,
                                                              "mem_229866") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229862,
                                                              "mem_229862") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229858,
                                                              "mem_229858") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229854,
                                                              "mem_229854") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230042,
                                                              "ext_mem_230042") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230043,
                                                              "ext_mem_230043") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230056,
                                                              "ext_mem_230056") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230057,
                                                              "ext_mem_230057") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230417,
                                                              "ext_mem_230417") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230418,
                                                              "ext_mem_230418") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230419,
                                                              "ext_mem_230419") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230420,
                                                              "ext_mem_230420") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230486,
                                                              "ext_mem_230486") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230487,
                                                              "ext_mem_230487") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229515,
                                                              "mem_param_229515") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229507,
                                                              "mem_param_229507") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231517,
                                                              "ext_mem_231517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231518,
                                                              "ext_mem_231518") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229493,
                                                              "mem_param_229493") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229485,
                                                              "mem_param_229485") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229477,
                                                              "mem_param_229477") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231860,
                                                              "ext_mem_231860") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231861,
                                                              "ext_mem_231861") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231862,
                                                              "ext_mem_231862") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230551,
                                                              "mem_230551") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230534,
                                                              "mem_230534") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230517,
                                                              "mem_230517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230500,
                                                              "mem_230500") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229531,
                                                              "mem_229531") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229526,
                                                              "mem_229526") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229520,
                                                              "mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229469,
                                                              "mem_229469") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229465,
                                                              "mem_229465") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229460,
                                                              "ext_mem_229460") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229461,
                                                              "ext_mem_229461") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229411,
                                                              "ext_mem_229411") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229412,
                                                              "ext_mem_229412") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229362,
                                                              "ext_mem_229362") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229363,
                                                              "ext_mem_229363") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229264,
                                                              "ext_mem_229264") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229265,
                                                              "ext_mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229206,
                                                              "mem_229206") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229200,
                                                              "mem_229200") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229196,
                                                              "ext_mem_229196") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229197,
                                                              "ext_mem_229197") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229164,
                                                              "mem_229164") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229161,
                                                              "mem_229161") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229157,
                                                              "mem_229157") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229155,
                                                              "mem_229155") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229152,
                                                              "mem_229152") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229148,
                                                              "mem_229148") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232249,
                                                              "mem_out_232249") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232248,
                                                              "mem_out_232248") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232247,
                                                              "mem_out_232247") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_229905;
                                
                                mem_229905.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_229905,
                                                          bytes_229853,
                                                          "mem_229905")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_229909;
                                
                                mem_229909.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_229909,
                                                          bytes_229853,
                                                          "mem_229909")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device color_231994;
                                
                                color_231994.references = NULL;
                                if (memblock_alloc_device(ctx, &color_231994,
                                                          total_sizze_232123,
                                                          "color_231994")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device color_231995;
                                
                                color_231995.references = NULL;
                                if (memblock_alloc_device(ctx, &color_231995,
                                                          total_sizze_232124,
                                                          "color_231995")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                                
                                CUdeviceptr kernel_arg_237535 =
                                            ext_mem_229264.mem;
                                CUdeviceptr kernel_arg_237536 = mem_229854.mem;
                                CUdeviceptr kernel_arg_237537 = mem_229858.mem;
                                CUdeviceptr kernel_arg_237538 = mem_229862.mem;
                                CUdeviceptr kernel_arg_237539 = mem_229866.mem;
                                CUdeviceptr kernel_arg_237540 = mem_229870.mem;
                                CUdeviceptr kernel_arg_237541 = mem_229905.mem;
                                CUdeviceptr kernel_arg_237542 = mem_229909.mem;
                                CUdeviceptr kernel_arg_237543 =
                                            color_231994.mem;
                                CUdeviceptr kernel_arg_237544 =
                                            color_231995.mem;
                                
                                if ((((((1 && num_groups_213697 != 0) && 1 !=
                                        0) && 1 != 0) &&
                                      segmap_group_sizze_213696 != 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_213697;
                                    grid[perm[1]] = 1;
                                    grid[perm[2]] = 1;
                                    
                                    void *kernel_args_237532[] =
                                         {&ctx->global_failure, &n_p_203492,
                                          &q_s_203493, &jump_s_203499,
                                          &partition_sizze_203577,
                                          &defunc_0_f_res_203631,
                                          &pad_css_len_203632, &s_n_m_203636,
                                          &num_groups_213697,
                                          &num_threads_232122,
                                          &kernel_arg_237535,
                                          &kernel_arg_237536,
                                          &kernel_arg_237537,
                                          &kernel_arg_237538,
                                          &kernel_arg_237539,
                                          &kernel_arg_237540,
                                          &kernel_arg_237541,
                                          &kernel_arg_237542,
                                          &kernel_arg_237543,
                                          &kernel_arg_237544};
                                    int64_t time_start_237533 = 0,
                                            time_end_237534 = 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_213719",
                                                (long) num_groups_213697,
                                                (long) 1, (long) 1,
                                                (long) segmap_group_sizze_213696,
                                                (long) 1, (long) 1, (int) 0);
                                        time_start_237533 = get_wall_time();
                                    }
                                    
                                    cudaEvent_t *pevents = NULL;
                                    
                                    if (ctx->profiling &&
                                        !ctx->profiling_paused) {
                                        pevents = cuda_get_events(&ctx->cuda,
                                                                  &ctx->mainzisegmap_213719_runs,
                                                                  &ctx->mainzisegmap_213719_total_runtime);
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                           0));
                                    }
                                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_213719,
                                                                          grid[0],
                                                                          grid[1],
                                                                          grid[2],
                                                                          segmap_group_sizze_213696,
                                                                          1, 1,
                                                                          0,
                                                                          NULL,
                                                                          kernel_args_237532,
                                                                          NULL));
                                    if (pevents != NULL)
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                           0));
                                    if (ctx->debugging) {
                                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                        time_end_237534 = get_wall_time();
                                        fprintf(ctx->log,
                                                "Kernel %s runtime: %ldus\n",
                                                "main.segmap_213719",
                                                time_end_237534 -
                                                time_start_237533);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_unref_device(ctx, &mem_229854,
                                                          "mem_229854") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229858,
                                                          "mem_229858") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229862,
                                                          "mem_229862") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229866,
                                                          "mem_229866") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229870,
                                                          "mem_229870") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_231994,
                                                          "color_231994") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_231995,
                                                          "color_231995") != 0)
                                    return 1;
                                
                                struct memblock_device mem_230034;
                                
                                mem_230034.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230034,
                                                          bytes_229297,
                                                          "mem_230034")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                          mem_230034,
                                                                          (int64_t) 0,
                                                                          mem_229905,
                                                                          (int64_t) 0,
                                                                          (int64_t) 1,
                                                                          partition_sizze_203577 *
                                                                          n_p_203492,
                                                                          s_n_m_203636) !=
                                    0) {
                                    if (memblock_unref_device(ctx, &mem_230034,
                                                              "mem_230034") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_231995,
                                                              "color_231995") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_231994,
                                                              "color_231994") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229909,
                                                              "mem_229909") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229905,
                                                              "mem_229905") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229870,
                                                              "mem_229870") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229866,
                                                              "mem_229866") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229862,
                                                              "mem_229862") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229858,
                                                              "mem_229858") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229854,
                                                              "mem_229854") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230042,
                                                              "ext_mem_230042") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230043,
                                                              "ext_mem_230043") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230056,
                                                              "ext_mem_230056") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230057,
                                                              "ext_mem_230057") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230417,
                                                              "ext_mem_230417") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230418,
                                                              "ext_mem_230418") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230419,
                                                              "ext_mem_230419") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230420,
                                                              "ext_mem_230420") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230486,
                                                              "ext_mem_230486") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230487,
                                                              "ext_mem_230487") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229515,
                                                              "mem_param_229515") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229507,
                                                              "mem_param_229507") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231517,
                                                              "ext_mem_231517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231518,
                                                              "ext_mem_231518") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229493,
                                                              "mem_param_229493") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229485,
                                                              "mem_param_229485") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229477,
                                                              "mem_param_229477") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231860,
                                                              "ext_mem_231860") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231861,
                                                              "ext_mem_231861") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231862,
                                                              "ext_mem_231862") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230551,
                                                              "mem_230551") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230534,
                                                              "mem_230534") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230517,
                                                              "mem_230517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230500,
                                                              "mem_230500") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229531,
                                                              "mem_229531") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229526,
                                                              "mem_229526") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229520,
                                                              "mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229469,
                                                              "mem_229469") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229465,
                                                              "mem_229465") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229460,
                                                              "ext_mem_229460") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229461,
                                                              "ext_mem_229461") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229411,
                                                              "ext_mem_229411") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229412,
                                                              "ext_mem_229412") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229362,
                                                              "ext_mem_229362") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229363,
                                                              "ext_mem_229363") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229264,
                                                              "ext_mem_229264") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229265,
                                                              "ext_mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229206,
                                                              "mem_229206") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229200,
                                                              "mem_229200") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229196,
                                                              "ext_mem_229196") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229197,
                                                              "ext_mem_229197") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229164,
                                                              "mem_229164") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229161,
                                                              "mem_229161") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229157,
                                                              "mem_229157") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229155,
                                                              "mem_229155") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229152,
                                                              "mem_229152") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229148,
                                                              "mem_229148") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232249,
                                                              "mem_out_232249") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232248,
                                                              "mem_out_232248") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232247,
                                                              "mem_out_232247") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                if (memblock_unref_device(ctx, &mem_229905,
                                                          "mem_229905") != 0)
                                    return 1;
                                
                                struct memblock_device mem_230040;
                                
                                mem_230040.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230040,
                                                          bytes_229297,
                                                          "mem_230040")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                          mem_230040,
                                                                          (int64_t) 0,
                                                                          mem_229909,
                                                                          (int64_t) 0,
                                                                          (int64_t) 1,
                                                                          partition_sizze_203577 *
                                                                          n_p_203492,
                                                                          s_n_m_203636) !=
                                    0) {
                                    if (memblock_unref_device(ctx, &mem_230040,
                                                              "mem_230040") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230034,
                                                              "mem_230034") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_231995,
                                                              "color_231995") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_231994,
                                                              "color_231994") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229909,
                                                              "mem_229909") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229905,
                                                              "mem_229905") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229870,
                                                              "mem_229870") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229866,
                                                              "mem_229866") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229862,
                                                              "mem_229862") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229858,
                                                              "mem_229858") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229854,
                                                              "mem_229854") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230042,
                                                              "ext_mem_230042") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230043,
                                                              "ext_mem_230043") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230056,
                                                              "ext_mem_230056") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230057,
                                                              "ext_mem_230057") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230417,
                                                              "ext_mem_230417") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230418,
                                                              "ext_mem_230418") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230419,
                                                              "ext_mem_230419") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230420,
                                                              "ext_mem_230420") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230486,
                                                              "ext_mem_230486") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230487,
                                                              "ext_mem_230487") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229515,
                                                              "mem_param_229515") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229507,
                                                              "mem_param_229507") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231517,
                                                              "ext_mem_231517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231518,
                                                              "ext_mem_231518") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229493,
                                                              "mem_param_229493") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229485,
                                                              "mem_param_229485") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229477,
                                                              "mem_param_229477") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231860,
                                                              "ext_mem_231860") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231861,
                                                              "ext_mem_231861") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231862,
                                                              "ext_mem_231862") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230551,
                                                              "mem_230551") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230534,
                                                              "mem_230534") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230517,
                                                              "mem_230517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230500,
                                                              "mem_230500") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229531,
                                                              "mem_229531") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229526,
                                                              "mem_229526") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229520,
                                                              "mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229469,
                                                              "mem_229469") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229465,
                                                              "mem_229465") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229460,
                                                              "ext_mem_229460") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229461,
                                                              "ext_mem_229461") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229411,
                                                              "ext_mem_229411") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229412,
                                                              "ext_mem_229412") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229362,
                                                              "ext_mem_229362") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229363,
                                                              "ext_mem_229363") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229264,
                                                              "ext_mem_229264") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229265,
                                                              "ext_mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229206,
                                                              "mem_229206") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229200,
                                                              "mem_229200") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229196,
                                                              "ext_mem_229196") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229197,
                                                              "ext_mem_229197") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229164,
                                                              "mem_229164") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229161,
                                                              "mem_229161") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229157,
                                                              "mem_229157") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229155,
                                                              "mem_229155") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229152,
                                                              "mem_229152") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229148,
                                                              "mem_229148") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232249,
                                                              "mem_out_232249") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232248,
                                                              "mem_out_232248") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232247,
                                                              "mem_out_232247") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                if (memblock_unref_device(ctx, &mem_229909,
                                                          "mem_229909") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_230043,
                                                        &mem_230034,
                                                        "mem_230034") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_230042,
                                                        &mem_230040,
                                                        "mem_230040") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230040,
                                                          "mem_230040") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230034,
                                                          "mem_230034") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_231995,
                                                          "color_231995") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_231994,
                                                          "color_231994") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229909,
                                                          "mem_229909") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229905,
                                                          "mem_229905") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229870,
                                                          "mem_229870") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229866,
                                                          "mem_229866") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229862,
                                                          "mem_229862") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229858,
                                                          "mem_229858") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229854,
                                                          "mem_229854") != 0)
                                    return 1;
                            } else {
                                struct memblock_device ext_mem_230029;
                                
                                ext_mem_230029.references = NULL;
                                
                                struct memblock_device ext_mem_230028;
                                
                                ext_mem_230028.references = NULL;
                                
                                int32_t local_memory_capacity_233685;
                                
                                local_memory_capacity_233685 =
                                    ctx->cuda.max_shared_memory;
                                if (sle64(bytes_229311 + srem64((int64_t) 8 -
                                                                srem64(bytes_229311,
                                                                       (int64_t) 8),
                                                                (int64_t) 8) +
                                          (bytes_229311 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229311,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229311 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229311,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229311 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229311,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229311 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229311,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229311 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229311,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229311 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229311,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229915 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229915,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          ((int64_t) 8 * (s_n_m_203636 *
                                                          q_s_203493) +
                                           srem64((int64_t) 8 -
                                                  srem64((int64_t) 8 *
                                                         (s_n_m_203636 *
                                                          q_s_203493),
                                                         (int64_t) 8),
                                                  (int64_t) 8)) + ((int64_t) 8 *
                                                                   (s_n_m_203636 *
                                                                    q_s_203493) +
                                                                   srem64((int64_t) 8 -
                                                                          srem64((int64_t) 8 *
                                                                                 (s_n_m_203636 *
                                                                                  q_s_203493),
                                                                                 (int64_t) 8),
                                                                          (int64_t) 8)) +
                                          ((int64_t) 8 * (s_n_m_203636 *
                                                          q_s_203493) +
                                           srem64((int64_t) 8 -
                                                  srem64((int64_t) 8 *
                                                         (s_n_m_203636 *
                                                          q_s_203493),
                                                         (int64_t) 8),
                                                  (int64_t) 8)) + ((int64_t) 8 *
                                                                   (s_n_m_203636 *
                                                                    q_s_203493) +
                                                                   srem64((int64_t) 8 -
                                                                          srem64((int64_t) 8 *
                                                                                 (s_n_m_203636 *
                                                                                  q_s_203493),
                                                                                 (int64_t) 8),
                                                                          (int64_t) 8)) +
                                          ((int64_t) 8 * (s_n_m_203636 *
                                                          q_s_203493) +
                                           srem64((int64_t) 8 -
                                                  srem64((int64_t) 8 *
                                                         (s_n_m_203636 *
                                                          q_s_203493),
                                                         (int64_t) 8),
                                                  (int64_t) 8)),
                                          sext_i32_i64(local_memory_capacity_233685)) &&
                                    intra_suff_and_fits_213712) {
                                    struct memblock_device mem_229951;
                                    
                                    mem_229951.references = NULL;
                                    if (memblock_alloc_device(ctx, &mem_229951,
                                                              bytes_229297,
                                                              "mem_229951")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device mem_229956;
                                    
                                    mem_229956.references = NULL;
                                    if (memblock_alloc_device(ctx, &mem_229956,
                                                              bytes_229297,
                                                              "mem_229956")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                                    
                                    unsigned int shared_sizze_237548 =
                                                 (int64_t) 8 * (s_n_m_203636 *
                                                                q_s_203493);
                                    unsigned int shared_sizze_237550 =
                                                 (int64_t) 8 * (s_n_m_203636 *
                                                                q_s_203493);
                                    unsigned int shared_sizze_237552 =
                                                 (int64_t) 8 * (s_n_m_203636 *
                                                                q_s_203493);
                                    unsigned int shared_sizze_237554 =
                                                 (int64_t) 8 * (s_n_m_203636 *
                                                                q_s_203493);
                                    unsigned int shared_sizze_237556 =
                                                 (int64_t) 8 * (s_n_m_203636 *
                                                                q_s_203493);
                                    unsigned int shared_sizze_237558 =
                                                 bytes_229915;
                                    unsigned int shared_sizze_237560 =
                                                 bytes_229311;
                                    unsigned int shared_sizze_237562 =
                                                 bytes_229311;
                                    unsigned int shared_sizze_237564 =
                                                 bytes_229311;
                                    unsigned int shared_sizze_237566 =
                                                 bytes_229311;
                                    unsigned int shared_sizze_237568 =
                                                 bytes_229311;
                                    unsigned int shared_sizze_237570 =
                                                 bytes_229311;
                                    unsigned int shared_sizze_237572 =
                                                 bytes_229311;
                                    CUdeviceptr kernel_arg_237574 =
                                                ext_mem_229264.mem;
                                    CUdeviceptr kernel_arg_237575 =
                                                ext_mem_229265.mem;
                                    CUdeviceptr kernel_arg_237576 =
                                                ext_mem_229362.mem;
                                    CUdeviceptr kernel_arg_237577 =
                                                ext_mem_229363.mem;
                                    CUdeviceptr kernel_arg_237578 =
                                                mem_229526.mem;
                                    CUdeviceptr kernel_arg_237579 =
                                                mem_229531.mem;
                                    CUdeviceptr kernel_arg_237580 =
                                                mem_229951.mem;
                                    CUdeviceptr kernel_arg_237581 =
                                                mem_229956.mem;
                                    unsigned int shared_offset_237549 = 0;
                                    unsigned int shared_offset_237551 = 0 +
                                                 (shared_sizze_237548 + (8 -
                                                                         shared_sizze_237548 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_237553 = 0 +
                                                 (shared_sizze_237548 + (8 -
                                                                         shared_sizze_237548 %
                                                                         8) %
                                                  8) + (shared_sizze_237550 +
                                                        (8 -
                                                         shared_sizze_237550 %
                                                         8) % 8);
                                    unsigned int shared_offset_237555 = 0 +
                                                 (shared_sizze_237548 + (8 -
                                                                         shared_sizze_237548 %
                                                                         8) %
                                                  8) + (shared_sizze_237550 +
                                                        (8 -
                                                         shared_sizze_237550 %
                                                         8) % 8) +
                                                 (shared_sizze_237552 + (8 -
                                                                         shared_sizze_237552 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_237557 = 0 +
                                                 (shared_sizze_237548 + (8 -
                                                                         shared_sizze_237548 %
                                                                         8) %
                                                  8) + (shared_sizze_237550 +
                                                        (8 -
                                                         shared_sizze_237550 %
                                                         8) % 8) +
                                                 (shared_sizze_237552 + (8 -
                                                                         shared_sizze_237552 %
                                                                         8) %
                                                  8) + (shared_sizze_237554 +
                                                        (8 -
                                                         shared_sizze_237554 %
                                                         8) % 8);
                                    unsigned int shared_offset_237559 = 0 +
                                                 (shared_sizze_237548 + (8 -
                                                                         shared_sizze_237548 %
                                                                         8) %
                                                  8) + (shared_sizze_237550 +
                                                        (8 -
                                                         shared_sizze_237550 %
                                                         8) % 8) +
                                                 (shared_sizze_237552 + (8 -
                                                                         shared_sizze_237552 %
                                                                         8) %
                                                  8) + (shared_sizze_237554 +
                                                        (8 -
                                                         shared_sizze_237554 %
                                                         8) % 8) +
                                                 (shared_sizze_237556 + (8 -
                                                                         shared_sizze_237556 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_237561 = 0 +
                                                 (shared_sizze_237548 + (8 -
                                                                         shared_sizze_237548 %
                                                                         8) %
                                                  8) + (shared_sizze_237550 +
                                                        (8 -
                                                         shared_sizze_237550 %
                                                         8) % 8) +
                                                 (shared_sizze_237552 + (8 -
                                                                         shared_sizze_237552 %
                                                                         8) %
                                                  8) + (shared_sizze_237554 +
                                                        (8 -
                                                         shared_sizze_237554 %
                                                         8) % 8) +
                                                 (shared_sizze_237556 + (8 -
                                                                         shared_sizze_237556 %
                                                                         8) %
                                                  8) + (shared_sizze_237558 +
                                                        (8 -
                                                         shared_sizze_237558 %
                                                         8) % 8);
                                    unsigned int shared_offset_237563 = 0 +
                                                 (shared_sizze_237548 + (8 -
                                                                         shared_sizze_237548 %
                                                                         8) %
                                                  8) + (shared_sizze_237550 +
                                                        (8 -
                                                         shared_sizze_237550 %
                                                         8) % 8) +
                                                 (shared_sizze_237552 + (8 -
                                                                         shared_sizze_237552 %
                                                                         8) %
                                                  8) + (shared_sizze_237554 +
                                                        (8 -
                                                         shared_sizze_237554 %
                                                         8) % 8) +
                                                 (shared_sizze_237556 + (8 -
                                                                         shared_sizze_237556 %
                                                                         8) %
                                                  8) + (shared_sizze_237558 +
                                                        (8 -
                                                         shared_sizze_237558 %
                                                         8) % 8) +
                                                 (shared_sizze_237560 + (8 -
                                                                         shared_sizze_237560 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_237565 = 0 +
                                                 (shared_sizze_237548 + (8 -
                                                                         shared_sizze_237548 %
                                                                         8) %
                                                  8) + (shared_sizze_237550 +
                                                        (8 -
                                                         shared_sizze_237550 %
                                                         8) % 8) +
                                                 (shared_sizze_237552 + (8 -
                                                                         shared_sizze_237552 %
                                                                         8) %
                                                  8) + (shared_sizze_237554 +
                                                        (8 -
                                                         shared_sizze_237554 %
                                                         8) % 8) +
                                                 (shared_sizze_237556 + (8 -
                                                                         shared_sizze_237556 %
                                                                         8) %
                                                  8) + (shared_sizze_237558 +
                                                        (8 -
                                                         shared_sizze_237558 %
                                                         8) % 8) +
                                                 (shared_sizze_237560 + (8 -
                                                                         shared_sizze_237560 %
                                                                         8) %
                                                  8) + (shared_sizze_237562 +
                                                        (8 -
                                                         shared_sizze_237562 %
                                                         8) % 8);
                                    unsigned int shared_offset_237567 = 0 +
                                                 (shared_sizze_237548 + (8 -
                                                                         shared_sizze_237548 %
                                                                         8) %
                                                  8) + (shared_sizze_237550 +
                                                        (8 -
                                                         shared_sizze_237550 %
                                                         8) % 8) +
                                                 (shared_sizze_237552 + (8 -
                                                                         shared_sizze_237552 %
                                                                         8) %
                                                  8) + (shared_sizze_237554 +
                                                        (8 -
                                                         shared_sizze_237554 %
                                                         8) % 8) +
                                                 (shared_sizze_237556 + (8 -
                                                                         shared_sizze_237556 %
                                                                         8) %
                                                  8) + (shared_sizze_237558 +
                                                        (8 -
                                                         shared_sizze_237558 %
                                                         8) % 8) +
                                                 (shared_sizze_237560 + (8 -
                                                                         shared_sizze_237560 %
                                                                         8) %
                                                  8) + (shared_sizze_237562 +
                                                        (8 -
                                                         shared_sizze_237562 %
                                                         8) % 8) +
                                                 (shared_sizze_237564 + (8 -
                                                                         shared_sizze_237564 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_237569 = 0 +
                                                 (shared_sizze_237548 + (8 -
                                                                         shared_sizze_237548 %
                                                                         8) %
                                                  8) + (shared_sizze_237550 +
                                                        (8 -
                                                         shared_sizze_237550 %
                                                         8) % 8) +
                                                 (shared_sizze_237552 + (8 -
                                                                         shared_sizze_237552 %
                                                                         8) %
                                                  8) + (shared_sizze_237554 +
                                                        (8 -
                                                         shared_sizze_237554 %
                                                         8) % 8) +
                                                 (shared_sizze_237556 + (8 -
                                                                         shared_sizze_237556 %
                                                                         8) %
                                                  8) + (shared_sizze_237558 +
                                                        (8 -
                                                         shared_sizze_237558 %
                                                         8) % 8) +
                                                 (shared_sizze_237560 + (8 -
                                                                         shared_sizze_237560 %
                                                                         8) %
                                                  8) + (shared_sizze_237562 +
                                                        (8 -
                                                         shared_sizze_237562 %
                                                         8) % 8) +
                                                 (shared_sizze_237564 + (8 -
                                                                         shared_sizze_237564 %
                                                                         8) %
                                                  8) + (shared_sizze_237566 +
                                                        (8 -
                                                         shared_sizze_237566 %
                                                         8) % 8);
                                    unsigned int shared_offset_237571 = 0 +
                                                 (shared_sizze_237548 + (8 -
                                                                         shared_sizze_237548 %
                                                                         8) %
                                                  8) + (shared_sizze_237550 +
                                                        (8 -
                                                         shared_sizze_237550 %
                                                         8) % 8) +
                                                 (shared_sizze_237552 + (8 -
                                                                         shared_sizze_237552 %
                                                                         8) %
                                                  8) + (shared_sizze_237554 +
                                                        (8 -
                                                         shared_sizze_237554 %
                                                         8) % 8) +
                                                 (shared_sizze_237556 + (8 -
                                                                         shared_sizze_237556 %
                                                                         8) %
                                                  8) + (shared_sizze_237558 +
                                                        (8 -
                                                         shared_sizze_237558 %
                                                         8) % 8) +
                                                 (shared_sizze_237560 + (8 -
                                                                         shared_sizze_237560 %
                                                                         8) %
                                                  8) + (shared_sizze_237562 +
                                                        (8 -
                                                         shared_sizze_237562 %
                                                         8) % 8) +
                                                 (shared_sizze_237564 + (8 -
                                                                         shared_sizze_237564 %
                                                                         8) %
                                                  8) + (shared_sizze_237566 +
                                                        (8 -
                                                         shared_sizze_237566 %
                                                         8) % 8) +
                                                 (shared_sizze_237568 + (8 -
                                                                         shared_sizze_237568 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_237573 = 0 +
                                                 (shared_sizze_237548 + (8 -
                                                                         shared_sizze_237548 %
                                                                         8) %
                                                  8) + (shared_sizze_237550 +
                                                        (8 -
                                                         shared_sizze_237550 %
                                                         8) % 8) +
                                                 (shared_sizze_237552 + (8 -
                                                                         shared_sizze_237552 %
                                                                         8) %
                                                  8) + (shared_sizze_237554 +
                                                        (8 -
                                                         shared_sizze_237554 %
                                                         8) % 8) +
                                                 (shared_sizze_237556 + (8 -
                                                                         shared_sizze_237556 %
                                                                         8) %
                                                  8) + (shared_sizze_237558 +
                                                        (8 -
                                                         shared_sizze_237558 %
                                                         8) % 8) +
                                                 (shared_sizze_237560 + (8 -
                                                                         shared_sizze_237560 %
                                                                         8) %
                                                  8) + (shared_sizze_237562 +
                                                        (8 -
                                                         shared_sizze_237562 %
                                                         8) % 8) +
                                                 (shared_sizze_237564 + (8 -
                                                                         shared_sizze_237564 %
                                                                         8) %
                                                  8) + (shared_sizze_237566 +
                                                        (8 -
                                                         shared_sizze_237566 %
                                                         8) % 8) +
                                                 (shared_sizze_237568 + (8 -
                                                                         shared_sizze_237568 %
                                                                         8) %
                                                  8) + (shared_sizze_237570 +
                                                        (8 -
                                                         shared_sizze_237570 %
                                                         8) % 8);
                                    
                                    if ((((((1 && binop_x_229202 != 0) && 1 !=
                                            0) && 1 != 0) &&
                                          computed_group_sizze_213705 != 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_229202;
                                        grid[perm[1]] = 1;
                                        grid[perm[2]] = 1;
                                        
                                        void *kernel_args_237545[] =
                                             {&ctx->global_failure,
                                              &shared_offset_237549,
                                              &shared_offset_237551,
                                              &shared_offset_237553,
                                              &shared_offset_237555,
                                              &shared_offset_237557,
                                              &shared_offset_237559,
                                              &shared_offset_237561,
                                              &shared_offset_237563,
                                              &shared_offset_237565,
                                              &shared_offset_237567,
                                              &shared_offset_237569,
                                              &shared_offset_237571,
                                              &shared_offset_237573,
                                              &n_p_203492, &q_s_203493,
                                              &jump_s_203499,
                                              &partition_sizze_203577,
                                              &defunc_0_f_res_203631,
                                              &pad_css_len_203632,
                                              &s_n_m_203636,
                                              &computed_group_sizze_213705,
                                              &kernel_arg_237574,
                                              &kernel_arg_237575,
                                              &kernel_arg_237576,
                                              &kernel_arg_237577,
                                              &kernel_arg_237578,
                                              &kernel_arg_237579,
                                              &kernel_arg_237580,
                                              &kernel_arg_237581};
                                        int64_t time_start_237546 = 0,
                                                time_end_237547 = 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_213836",
                                                    (long) binop_x_229202,
                                                    (long) 1, (long) 1,
                                                    (long) computed_group_sizze_213705,
                                                    (long) 1, (long) 1,
                                                    (int) (0 +
                                                           (shared_sizze_237548 +
                                                            (8 -
                                                             shared_sizze_237548 %
                                                             8) % 8) +
                                                           (shared_sizze_237550 +
                                                            (8 -
                                                             shared_sizze_237550 %
                                                             8) % 8) +
                                                           (shared_sizze_237552 +
                                                            (8 -
                                                             shared_sizze_237552 %
                                                             8) % 8) +
                                                           (shared_sizze_237554 +
                                                            (8 -
                                                             shared_sizze_237554 %
                                                             8) % 8) +
                                                           (shared_sizze_237556 +
                                                            (8 -
                                                             shared_sizze_237556 %
                                                             8) % 8) +
                                                           (shared_sizze_237558 +
                                                            (8 -
                                                             shared_sizze_237558 %
                                                             8) % 8) +
                                                           (shared_sizze_237560 +
                                                            (8 -
                                                             shared_sizze_237560 %
                                                             8) % 8) +
                                                           (shared_sizze_237562 +
                                                            (8 -
                                                             shared_sizze_237562 %
                                                             8) % 8) +
                                                           (shared_sizze_237564 +
                                                            (8 -
                                                             shared_sizze_237564 %
                                                             8) % 8) +
                                                           (shared_sizze_237566 +
                                                            (8 -
                                                             shared_sizze_237566 %
                                                             8) % 8) +
                                                           (shared_sizze_237568 +
                                                            (8 -
                                                             shared_sizze_237568 %
                                                             8) % 8) +
                                                           (shared_sizze_237570 +
                                                            (8 -
                                                             shared_sizze_237570 %
                                                             8) % 8) +
                                                           (shared_sizze_237572 +
                                                            (8 -
                                                             shared_sizze_237572 %
                                                             8) % 8)));
                                            time_start_237546 = get_wall_time();
                                        }
                                        
                                        cudaEvent_t *pevents = NULL;
                                        
                                        if (ctx->profiling &&
                                            !ctx->profiling_paused) {
                                            pevents =
                                                cuda_get_events(&ctx->cuda,
                                                                &ctx->mainzisegmap_intragroup_213836_runs,
                                                                &ctx->mainzisegmap_intragroup_213836_total_runtime);
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                               0));
                                        }
                                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_intragroup_213836,
                                                                              grid[0],
                                                                              grid[1],
                                                                              grid[2],
                                                                              computed_group_sizze_213705,
                                                                              1,
                                                                              1,
                                                                              0 +
                                                                              (shared_sizze_237548 +
                                                                               (8 -
                                                                                shared_sizze_237548 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_237550 +
                                                                               (8 -
                                                                                shared_sizze_237550 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_237552 +
                                                                               (8 -
                                                                                shared_sizze_237552 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_237554 +
                                                                               (8 -
                                                                                shared_sizze_237554 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_237556 +
                                                                               (8 -
                                                                                shared_sizze_237556 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_237558 +
                                                                               (8 -
                                                                                shared_sizze_237558 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_237560 +
                                                                               (8 -
                                                                                shared_sizze_237560 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_237562 +
                                                                               (8 -
                                                                                shared_sizze_237562 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_237564 +
                                                                               (8 -
                                                                                shared_sizze_237564 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_237566 +
                                                                               (8 -
                                                                                shared_sizze_237566 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_237568 +
                                                                               (8 -
                                                                                shared_sizze_237568 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_237570 +
                                                                               (8 -
                                                                                shared_sizze_237570 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_237572 +
                                                                               (8 -
                                                                                shared_sizze_237572 %
                                                                                8) %
                                                                               8),
                                                                              NULL,
                                                                              kernel_args_237545,
                                                                              NULL));
                                        if (pevents != NULL)
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                               0));
                                        if (ctx->debugging) {
                                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                            time_end_237547 = get_wall_time();
                                            fprintf(ctx->log,
                                                    "Kernel %s runtime: %ldus\n",
                                                    "main.segmap_intragroup_213836",
                                                    time_end_237547 -
                                                    time_start_237546);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_set_device(ctx,
                                                            &ext_mem_230029,
                                                            &mem_229951,
                                                            "mem_229951") != 0)
                                        return 1;
                                    if (memblock_set_device(ctx,
                                                            &ext_mem_230028,
                                                            &mem_229956,
                                                            "mem_229956") != 0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229956,
                                                              "mem_229956") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229951,
                                                              "mem_229951") !=
                                        0)
                                        return 1;
                                } else {
                                    int64_t segmap_usable_groups_213982 =
                                            sdiv_up64(nest_sizze_208848,
                                                      segmap_group_sizze_213981);
                                    struct memblock_device ext_mem_230027;
                                    
                                    ext_mem_230027.references = NULL;
                                    
                                    struct memblock_device ext_mem_230026;
                                    
                                    ext_mem_230026.references = NULL;
                                    
                                    int32_t local_memory_capacity_233684;
                                    
                                    local_memory_capacity_233684 =
                                        ctx->cuda.max_shared_memory;
                                    if (sle64((int64_t) 0,
                                              sext_i32_i64(local_memory_capacity_233684)) &&
                                        suff_outer_par_213986) {
                                        struct memblock_device mem_229962;
                                        
                                        mem_229962.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_229962,
                                                                  bytes_229297,
                                                                  "mem_229962")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_229967;
                                        
                                        mem_229967.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_229967,
                                                                  bytes_229297,
                                                                  "mem_229967")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n",
                                                    "\n# SegMap");
                                        
                                        CUdeviceptr kernel_arg_237585 =
                                                    ext_mem_229264.mem;
                                        CUdeviceptr kernel_arg_237586 =
                                                    ext_mem_229265.mem;
                                        CUdeviceptr kernel_arg_237587 =
                                                    ext_mem_229362.mem;
                                        CUdeviceptr kernel_arg_237588 =
                                                    ext_mem_229363.mem;
                                        CUdeviceptr kernel_arg_237589 =
                                                    mem_229526.mem;
                                        CUdeviceptr kernel_arg_237590 =
                                                    mem_229531.mem;
                                        CUdeviceptr kernel_arg_237591 =
                                                    mem_229962.mem;
                                        CUdeviceptr kernel_arg_237592 =
                                                    mem_229967.mem;
                                        
                                        if ((((((1 &&
                                                 segmap_usable_groups_213982 !=
                                                 0) && 1 != 0) && 1 != 0) &&
                                              segmap_group_sizze_213981 != 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_213982;
                                            grid[perm[1]] = 1;
                                            grid[perm[2]] = 1;
                                            
                                            void *kernel_args_237582[] =
                                                 {&ctx->global_failure,
                                                  &n_p_203492, &q_s_203493,
                                                  &jump_s_203499,
                                                  &partition_sizze_203577,
                                                  &defunc_0_f_res_203631,
                                                  &pad_css_len_203632,
                                                  &s_n_m_203636,
                                                  &kernel_arg_237585,
                                                  &kernel_arg_237586,
                                                  &kernel_arg_237587,
                                                  &kernel_arg_237588,
                                                  &kernel_arg_237589,
                                                  &kernel_arg_237590,
                                                  &kernel_arg_237591,
                                                  &kernel_arg_237592};
                                            int64_t time_start_237583 = 0,
                                                    time_end_237584 = 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_213994",
                                                        (long) segmap_usable_groups_213982,
                                                        (long) 1, (long) 1,
                                                        (long) segmap_group_sizze_213981,
                                                        (long) 1, (long) 1,
                                                        (int) 0);
                                                time_start_237583 =
                                                    get_wall_time();
                                            }
                                            
                                            cudaEvent_t *pevents = NULL;
                                            
                                            if (ctx->profiling &&
                                                !ctx->profiling_paused) {
                                                pevents =
                                                    cuda_get_events(&ctx->cuda,
                                                                    &ctx->mainzisegmap_213994_runs,
                                                                    &ctx->mainzisegmap_213994_total_runtime);
                                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                                   0));
                                            }
                                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_213994,
                                                                                  grid[0],
                                                                                  grid[1],
                                                                                  grid[2],
                                                                                  segmap_group_sizze_213981,
                                                                                  1,
                                                                                  1,
                                                                                  0,
                                                                                  NULL,
                                                                                  kernel_args_237582,
                                                                                  NULL));
                                            if (pevents != NULL)
                                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                                   0));
                                            if (ctx->debugging) {
                                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                                time_end_237584 =
                                                    get_wall_time();
                                                fprintf(ctx->log,
                                                        "Kernel %s runtime: %ldus\n",
                                                        "main.segmap_213994",
                                                        time_end_237584 -
                                                        time_start_237583);
                                            }
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n", "");
                                        if (memblock_set_device(ctx,
                                                                &ext_mem_230027,
                                                                &mem_229962,
                                                                "mem_229962") !=
                                            0)
                                            return 1;
                                        if (memblock_set_device(ctx,
                                                                &ext_mem_230026,
                                                                &mem_229967,
                                                                "mem_229967") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_229967,
                                                                  "mem_229967") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_229962,
                                                                  "mem_229962") !=
                                            0)
                                            return 1;
                                    } else {
                                        int64_t segmap_usable_groups_214105 =
                                                sdiv_up64(nest_sizze_208848,
                                                          segmap_group_sizze_214104);
                                        struct memblock_device mem_229973;
                                        
                                        mem_229973.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_229973,
                                                                  bytes_229297,
                                                                  "mem_229973")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_229977;
                                        
                                        mem_229977.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_229977,
                                                                  bytes_229976,
                                                                  "mem_229977")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n",
                                                    "\n# SegMap");
                                        
                                        CUdeviceptr kernel_arg_237596 =
                                                    mem_229973.mem;
                                        CUdeviceptr kernel_arg_237597 =
                                                    mem_229977.mem;
                                        
                                        if ((((((1 &&
                                                 segmap_usable_groups_214105 !=
                                                 0) && 1 != 0) && 1 != 0) &&
                                              segmap_group_sizze_214104 != 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_214105;
                                            grid[perm[1]] = 1;
                                            grid[perm[2]] = 1;
                                            
                                            void *kernel_args_237593[] =
                                                 {&ctx->global_failure,
                                                  &n_p_203492, &jump_s_203499,
                                                  &partition_sizze_203577,
                                                  &defunc_0_f_res_203631,
                                                  &pad_css_len_203632,
                                                  &s_n_m_203636,
                                                  &kernel_arg_237596,
                                                  &kernel_arg_237597};
                                            int64_t time_start_237594 = 0,
                                                    time_end_237595 = 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_214111",
                                                        (long) segmap_usable_groups_214105,
                                                        (long) 1, (long) 1,
                                                        (long) segmap_group_sizze_214104,
                                                        (long) 1, (long) 1,
                                                        (int) 0);
                                                time_start_237594 =
                                                    get_wall_time();
                                            }
                                            
                                            cudaEvent_t *pevents = NULL;
                                            
                                            if (ctx->profiling &&
                                                !ctx->profiling_paused) {
                                                pevents =
                                                    cuda_get_events(&ctx->cuda,
                                                                    &ctx->mainzisegmap_214111_runs,
                                                                    &ctx->mainzisegmap_214111_total_runtime);
                                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                                   0));
                                            }
                                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_214111,
                                                                                  grid[0],
                                                                                  grid[1],
                                                                                  grid[2],
                                                                                  segmap_group_sizze_214104,
                                                                                  1,
                                                                                  1,
                                                                                  0,
                                                                                  NULL,
                                                                                  kernel_args_237593,
                                                                                  NULL));
                                            if (pevents != NULL)
                                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                                   0));
                                            if (ctx->debugging) {
                                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                                time_end_237595 =
                                                    get_wall_time();
                                                fprintf(ctx->log,
                                                        "Kernel %s runtime: %ldus\n",
                                                        "main.segmap_214111",
                                                        time_end_237595 -
                                                        time_start_237594);
                                            }
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n", "");
                                        if (memblock_unref_device(ctx,
                                                                  &mem_229977,
                                                                  "mem_229977") !=
                                            0)
                                            return 1;
                                        
                                        struct memblock_device mem_229983;
                                        
                                        mem_229983.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_229983,
                                                                  bytes_229297,
                                                                  "mem_229983")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_229988;
                                        
                                        mem_229988.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_229988,
                                                                  bytes_229297,
                                                                  "mem_229988")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_229993;
                                        
                                        mem_229993.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_229993,
                                                                  bytes_229297,
                                                                  "mem_229993")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        if (slt64(q_s_203493 * (int64_t) 2,
                                                  segred_group_sizze_214127)) {
                                            int64_t
                                            segment_sizze_nonzzero_233478 =
                                            smax64((int64_t) 1, q_s_203493);
                                            int64_t num_threads_233479 =
                                                    num_groups_214128 *
                                                    segred_group_sizze_214127;
                                            
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s\n",
                                                        "\n# SegRed-small");
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "num_segments",
                                                        (long long) (partition_sizze_203577 *
                                                                     n_p_203492 *
                                                                     s_n_m_203636),
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "segment_size",
                                                        (long long) q_s_203493,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "segments_per_group",
                                                        (long long) squot64(segred_group_sizze_214127,
                                                                            segment_sizze_nonzzero_233478),
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "required_groups",
                                                        (long long) sext_i64_i32(sdiv_up64(partition_sizze_203577 *
                                                                                           n_p_203492 *
                                                                                           s_n_m_203636,
                                                                                           squot64(segred_group_sizze_214127,
                                                                                                   segment_sizze_nonzzero_233478))),
                                                        '\n');
                                            
                                            unsigned int shared_sizze_237601 =
                                                         (int64_t) 8 *
                                                         segred_group_sizze_214127;
                                            unsigned int shared_sizze_237603 =
                                                         (int64_t) 8 *
                                                         segred_group_sizze_214127;
                                            unsigned int shared_sizze_237605 =
                                                         (int64_t) 8 *
                                                         segred_group_sizze_214127;
                                            CUdeviceptr kernel_arg_237607 =
                                                        ext_mem_229264.mem;
                                            CUdeviceptr kernel_arg_237608 =
                                                        ext_mem_229265.mem;
                                            CUdeviceptr kernel_arg_237609 =
                                                        ext_mem_229362.mem;
                                            CUdeviceptr kernel_arg_237610 =
                                                        ext_mem_229363.mem;
                                            CUdeviceptr kernel_arg_237611 =
                                                        mem_229531.mem;
                                            CUdeviceptr kernel_arg_237612 =
                                                        mem_229973.mem;
                                            CUdeviceptr kernel_arg_237613 =
                                                        mem_229983.mem;
                                            CUdeviceptr kernel_arg_237614 =
                                                        mem_229988.mem;
                                            CUdeviceptr kernel_arg_237615 =
                                                        mem_229993.mem;
                                            unsigned int shared_offset_237602 =
                                                         0;
                                            unsigned int shared_offset_237604 =
                                                         0 +
                                                         (shared_sizze_237601 +
                                                          (8 -
                                                           shared_sizze_237601 %
                                                           8) % 8);
                                            unsigned int shared_offset_237606 =
                                                         0 +
                                                         (shared_sizze_237601 +
                                                          (8 -
                                                           shared_sizze_237601 %
                                                           8) % 8) +
                                                         (shared_sizze_237603 +
                                                          (8 -
                                                           shared_sizze_237603 %
                                                           8) % 8);
                                            
                                            if ((((((1 && num_groups_214128 !=
                                                     0) && 1 != 0) && 1 != 0) &&
                                                  segred_group_sizze_214127 !=
                                                  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_214128;
                                                grid[perm[1]] = 1;
                                                grid[perm[2]] = 1;
                                                
                                                void *kernel_args_237598[] =
                                                     {&ctx->global_failure,
                                                      &shared_offset_237602,
                                                      &shared_offset_237604,
                                                      &shared_offset_237606,
                                                      &n_p_203492, &q_s_203493,
                                                      &partition_sizze_203577,
                                                      &defunc_0_f_res_203631,
                                                      &s_n_m_203636,
                                                      &num_groups_214128,
                                                      &segment_sizze_nonzzero_233478,
                                                      &kernel_arg_237607,
                                                      &kernel_arg_237608,
                                                      &kernel_arg_237609,
                                                      &kernel_arg_237610,
                                                      &kernel_arg_237611,
                                                      &kernel_arg_237612,
                                                      &kernel_arg_237613,
                                                      &kernel_arg_237614,
                                                      &kernel_arg_237615};
                                                int64_t time_start_237599 = 0,
                                                        time_end_237600 = 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_214137",
                                                            (long) num_groups_214128,
                                                            (long) 1, (long) 1,
                                                            (long) segred_group_sizze_214127,
                                                            (long) 1, (long) 1,
                                                            (int) (0 +
                                                                   (shared_sizze_237601 +
                                                                    (8 -
                                                                     shared_sizze_237601 %
                                                                     8) % 8) +
                                                                   (shared_sizze_237603 +
                                                                    (8 -
                                                                     shared_sizze_237603 %
                                                                     8) % 8) +
                                                                   (shared_sizze_237605 +
                                                                    (8 -
                                                                     shared_sizze_237605 %
                                                                     8) % 8)));
                                                    time_start_237599 =
                                                        get_wall_time();
                                                }
                                                
                                                cudaEvent_t *pevents = NULL;
                                                
                                                if (ctx->profiling &&
                                                    !ctx->profiling_paused) {
                                                    pevents =
                                                        cuda_get_events(&ctx->cuda,
                                                                        &ctx->mainzisegred_small_214137_runs,
                                                                        &ctx->mainzisegred_small_214137_total_runtime);
                                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                                       0));
                                                }
                                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_small_214137,
                                                                                      grid[0],
                                                                                      grid[1],
                                                                                      grid[2],
                                                                                      segred_group_sizze_214127,
                                                                                      1,
                                                                                      1,
                                                                                      0 +
                                                                                      (shared_sizze_237601 +
                                                                                       (8 -
                                                                                        shared_sizze_237601 %
                                                                                        8) %
                                                                                       8) +
                                                                                      (shared_sizze_237603 +
                                                                                       (8 -
                                                                                        shared_sizze_237603 %
                                                                                        8) %
                                                                                       8) +
                                                                                      (shared_sizze_237605 +
                                                                                       (8 -
                                                                                        shared_sizze_237605 %
                                                                                        8) %
                                                                                       8),
                                                                                      NULL,
                                                                                      kernel_args_237598,
                                                                                      NULL));
                                                if (pevents != NULL)
                                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                                       0));
                                                if (ctx->debugging) {
                                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                                    time_end_237600 =
                                                        get_wall_time();
                                                    fprintf(ctx->log,
                                                            "Kernel %s runtime: %ldus\n",
                                                            "main.segred_small_214137",
                                                            time_end_237600 -
                                                            time_start_237599);
                                                }
                                            }
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s\n", "");
                                        } else {
                                            int64_t groups_per_segment_233521 =
                                                    sdiv_up64(num_groups_214128,
                                                              smax64((int64_t) 1,
                                                                     partition_sizze_203577 *
                                                                     n_p_203492 *
                                                                     s_n_m_203636));
                                            int64_t elements_per_thread_233522 =
                                                    sdiv_up64(q_s_203493,
                                                              segred_group_sizze_214127 *
                                                              groups_per_segment_233521);
                                            int64_t virt_num_groups_233523 =
                                                    groups_per_segment_233521 *
                                                    (partition_sizze_203577 *
                                                     n_p_203492 * s_n_m_203636);
                                            int64_t num_threads_233524 =
                                                    num_groups_214128 *
                                                    segred_group_sizze_214127;
                                            int64_t threads_per_segment_233525 =
                                                    groups_per_segment_233521 *
                                                    segred_group_sizze_214127;
                                            
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s\n",
                                                        "\n# SegRed-large");
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "num_segments",
                                                        (long long) (partition_sizze_203577 *
                                                                     n_p_203492 *
                                                                     s_n_m_203636),
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "segment_size",
                                                        (long long) q_s_203493,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "virt_num_groups",
                                                        (long long) virt_num_groups_233523,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "num_groups",
                                                        (long long) num_groups_214128,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "group_size",
                                                        (long long) segred_group_sizze_214127,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "elems_per_thread",
                                                        (long long) elements_per_thread_233522,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "groups_per_segment",
                                                        (long long) groups_per_segment_233521,
                                                        '\n');
                                            
                                            struct memblock_device
                                            segred_tmp_mem_233526;
                                            
                                            segred_tmp_mem_233526.references =
                                                NULL;
                                            if (memblock_alloc_device(ctx,
                                                                      &segred_tmp_mem_233526,
                                                                      (int64_t) 8 *
                                                                      virt_num_groups_233523,
                                                                      "segred_tmp_mem_233526")) {
                                                err = 1;
                                                goto cleanup;
                                            }
                                            
                                            struct memblock_device
                                            segred_tmp_mem_233528;
                                            
                                            segred_tmp_mem_233528.references =
                                                NULL;
                                            if (memblock_alloc_device(ctx,
                                                                      &segred_tmp_mem_233528,
                                                                      (int64_t) 8 *
                                                                      virt_num_groups_233523,
                                                                      "segred_tmp_mem_233528")) {
                                                err = 1;
                                                goto cleanup;
                                            }
                                            
                                            struct memblock_device
                                            segred_tmp_mem_233530;
                                            
                                            segred_tmp_mem_233530.references =
                                                NULL;
                                            if (memblock_alloc_device(ctx,
                                                                      &segred_tmp_mem_233530,
                                                                      (int64_t) 8 *
                                                                      virt_num_groups_233523,
                                                                      "segred_tmp_mem_233530")) {
                                                err = 1;
                                                goto cleanup;
                                            }
                                            
                                            struct memblock_device
                                            mainzicounter_mem_233532 =
                                            ctx->mainzicounter_mem_233532;
                                            unsigned int shared_sizze_237620 =
                                                         1;
                                            unsigned int shared_sizze_237622 =
                                                         (int64_t) 8 *
                                                         segred_group_sizze_214127;
                                            unsigned int shared_sizze_237624 =
                                                         (int64_t) 8 *
                                                         segred_group_sizze_214127;
                                            unsigned int shared_sizze_237626 =
                                                         (int64_t) 8 *
                                                         segred_group_sizze_214127;
                                            CUdeviceptr kernel_arg_237628 =
                                                        ext_mem_229264.mem;
                                            CUdeviceptr kernel_arg_237629 =
                                                        ext_mem_229265.mem;
                                            CUdeviceptr kernel_arg_237630 =
                                                        ext_mem_229362.mem;
                                            CUdeviceptr kernel_arg_237631 =
                                                        ext_mem_229363.mem;
                                            CUdeviceptr kernel_arg_237632 =
                                                        mem_229531.mem;
                                            CUdeviceptr kernel_arg_237633 =
                                                        mem_229973.mem;
                                            CUdeviceptr kernel_arg_237634 =
                                                        mem_229983.mem;
                                            CUdeviceptr kernel_arg_237635 =
                                                        mem_229988.mem;
                                            CUdeviceptr kernel_arg_237636 =
                                                        mem_229993.mem;
                                            CUdeviceptr kernel_arg_237637 =
                                                        segred_tmp_mem_233526.mem;
                                            CUdeviceptr kernel_arg_237638 =
                                                        segred_tmp_mem_233528.mem;
                                            CUdeviceptr kernel_arg_237639 =
                                                        segred_tmp_mem_233530.mem;
                                            CUdeviceptr kernel_arg_237640 =
                                                        mainzicounter_mem_233532.mem;
                                            unsigned int shared_offset_237621 =
                                                         0;
                                            unsigned int shared_offset_237623 =
                                                         0 +
                                                         (shared_sizze_237620 +
                                                          (8 -
                                                           shared_sizze_237620 %
                                                           8) % 8);
                                            unsigned int shared_offset_237625 =
                                                         0 +
                                                         (shared_sizze_237620 +
                                                          (8 -
                                                           shared_sizze_237620 %
                                                           8) % 8) +
                                                         (shared_sizze_237622 +
                                                          (8 -
                                                           shared_sizze_237622 %
                                                           8) % 8);
                                            unsigned int shared_offset_237627 =
                                                         0 +
                                                         (shared_sizze_237620 +
                                                          (8 -
                                                           shared_sizze_237620 %
                                                           8) % 8) +
                                                         (shared_sizze_237622 +
                                                          (8 -
                                                           shared_sizze_237622 %
                                                           8) % 8) +
                                                         (shared_sizze_237624 +
                                                          (8 -
                                                           shared_sizze_237624 %
                                                           8) % 8);
                                            
                                            if ((((((1 && num_groups_214128 !=
                                                     0) && 1 != 0) && 1 != 0) &&
                                                  segred_group_sizze_214127 !=
                                                  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_214128;
                                                grid[perm[1]] = 1;
                                                grid[perm[2]] = 1;
                                                
                                                void *kernel_args_237617[] =
                                                     {&ctx->global_failure,
                                                      &shared_offset_237621,
                                                      &shared_offset_237623,
                                                      &shared_offset_237625,
                                                      &shared_offset_237627,
                                                      &n_p_203492, &q_s_203493,
                                                      &partition_sizze_203577,
                                                      &defunc_0_f_res_203631,
                                                      &s_n_m_203636,
                                                      &num_groups_214128,
                                                      &groups_per_segment_233521,
                                                      &elements_per_thread_233522,
                                                      &virt_num_groups_233523,
                                                      &threads_per_segment_233525,
                                                      &kernel_arg_237628,
                                                      &kernel_arg_237629,
                                                      &kernel_arg_237630,
                                                      &kernel_arg_237631,
                                                      &kernel_arg_237632,
                                                      &kernel_arg_237633,
                                                      &kernel_arg_237634,
                                                      &kernel_arg_237635,
                                                      &kernel_arg_237636,
                                                      &kernel_arg_237637,
                                                      &kernel_arg_237638,
                                                      &kernel_arg_237639,
                                                      &kernel_arg_237640};
                                                int64_t time_start_237618 = 0,
                                                        time_end_237619 = 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_214137",
                                                            (long) num_groups_214128,
                                                            (long) 1, (long) 1,
                                                            (long) segred_group_sizze_214127,
                                                            (long) 1, (long) 1,
                                                            (int) (0 +
                                                                   (shared_sizze_237620 +
                                                                    (8 -
                                                                     shared_sizze_237620 %
                                                                     8) % 8) +
                                                                   (shared_sizze_237622 +
                                                                    (8 -
                                                                     shared_sizze_237622 %
                                                                     8) % 8) +
                                                                   (shared_sizze_237624 +
                                                                    (8 -
                                                                     shared_sizze_237624 %
                                                                     8) % 8) +
                                                                   (shared_sizze_237626 +
                                                                    (8 -
                                                                     shared_sizze_237626 %
                                                                     8) % 8)));
                                                    time_start_237618 =
                                                        get_wall_time();
                                                }
                                                
                                                cudaEvent_t *pevents = NULL;
                                                
                                                if (ctx->profiling &&
                                                    !ctx->profiling_paused) {
                                                    pevents =
                                                        cuda_get_events(&ctx->cuda,
                                                                        &ctx->mainzisegred_large_214137_runs,
                                                                        &ctx->mainzisegred_large_214137_total_runtime);
                                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                                       0));
                                                }
                                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_large_214137,
                                                                                      grid[0],
                                                                                      grid[1],
                                                                                      grid[2],
                                                                                      segred_group_sizze_214127,
                                                                                      1,
                                                                                      1,
                                                                                      0 +
                                                                                      (shared_sizze_237620 +
                                                                                       (8 -
                                                                                        shared_sizze_237620 %
                                                                                        8) %
                                                                                       8) +
                                                                                      (shared_sizze_237622 +
                                                                                       (8 -
                                                                                        shared_sizze_237622 %
                                                                                        8) %
                                                                                       8) +
                                                                                      (shared_sizze_237624 +
                                                                                       (8 -
                                                                                        shared_sizze_237624 %
                                                                                        8) %
                                                                                       8) +
                                                                                      (shared_sizze_237626 +
                                                                                       (8 -
                                                                                        shared_sizze_237626 %
                                                                                        8) %
                                                                                       8),
                                                                                      NULL,
                                                                                      kernel_args_237617,
                                                                                      NULL));
                                                if (pevents != NULL)
                                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                                       0));
                                                if (ctx->debugging) {
                                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                                    time_end_237619 =
                                                        get_wall_time();
                                                    fprintf(ctx->log,
                                                            "Kernel %s runtime: %ldus\n",
                                                            "main.segred_large_214137",
                                                            time_end_237619 -
                                                            time_start_237618);
                                                }
                                            }
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s\n", "");
                                            if (memblock_unref_device(ctx,
                                                                      &segred_tmp_mem_233530,
                                                                      "segred_tmp_mem_233530") !=
                                                0)
                                                return 1;
                                            if (memblock_unref_device(ctx,
                                                                      &segred_tmp_mem_233528,
                                                                      "segred_tmp_mem_233528") !=
                                                0)
                                                return 1;
                                            if (memblock_unref_device(ctx,
                                                                      &segred_tmp_mem_233526,
                                                                      "segred_tmp_mem_233526") !=
                                                0)
                                                return 1;
                                        }
                                        if (memblock_unref_device(ctx,
                                                                  &mem_229973,
                                                                  "mem_229973") !=
                                            0)
                                            return 1;
                                        
                                        int64_t segmap_usable_groups_214187 =
                                                sdiv_up64(nest_sizze_208848,
                                                          segmap_group_sizze_214186);
                                        struct memblock_device mem_229999;
                                        
                                        mem_229999.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_229999,
                                                                  bytes_229297,
                                                                  "mem_229999")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230004;
                                        
                                        mem_230004.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230004,
                                                                  bytes_229297,
                                                                  "mem_230004")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230009;
                                        
                                        mem_230009.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230009,
                                                                  bytes_229297,
                                                                  "mem_230009")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230014;
                                        
                                        mem_230014.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230014,
                                                                  bytes_229297,
                                                                  "mem_230014")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n",
                                                    "\n# SegMap");
                                        
                                        CUdeviceptr kernel_arg_237644 =
                                                    mem_229983.mem;
                                        CUdeviceptr kernel_arg_237645 =
                                                    mem_229988.mem;
                                        CUdeviceptr kernel_arg_237646 =
                                                    mem_229993.mem;
                                        CUdeviceptr kernel_arg_237647 =
                                                    mem_229999.mem;
                                        CUdeviceptr kernel_arg_237648 =
                                                    mem_230004.mem;
                                        CUdeviceptr kernel_arg_237649 =
                                                    mem_230009.mem;
                                        CUdeviceptr kernel_arg_237650 =
                                                    mem_230014.mem;
                                        
                                        if ((((((1 &&
                                                 segmap_usable_groups_214187 !=
                                                 0) && 1 != 0) && 1 != 0) &&
                                              segmap_group_sizze_214186 != 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_214187;
                                            grid[perm[1]] = 1;
                                            grid[perm[2]] = 1;
                                            
                                            void *kernel_args_237641[] =
                                                 {&ctx->global_failure,
                                                  &n_p_203492, &jump_s_203499,
                                                  &partition_sizze_203577,
                                                  &defunc_0_f_res_203631,
                                                  &pad_css_len_203632,
                                                  &s_n_m_203636,
                                                  &kernel_arg_237644,
                                                  &kernel_arg_237645,
                                                  &kernel_arg_237646,
                                                  &kernel_arg_237647,
                                                  &kernel_arg_237648,
                                                  &kernel_arg_237649,
                                                  &kernel_arg_237650};
                                            int64_t time_start_237642 = 0,
                                                    time_end_237643 = 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_214195",
                                                        (long) segmap_usable_groups_214187,
                                                        (long) 1, (long) 1,
                                                        (long) segmap_group_sizze_214186,
                                                        (long) 1, (long) 1,
                                                        (int) 0);
                                                time_start_237642 =
                                                    get_wall_time();
                                            }
                                            
                                            cudaEvent_t *pevents = NULL;
                                            
                                            if (ctx->profiling &&
                                                !ctx->profiling_paused) {
                                                pevents =
                                                    cuda_get_events(&ctx->cuda,
                                                                    &ctx->mainzisegmap_214195_runs,
                                                                    &ctx->mainzisegmap_214195_total_runtime);
                                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                                   0));
                                            }
                                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_214195,
                                                                                  grid[0],
                                                                                  grid[1],
                                                                                  grid[2],
                                                                                  segmap_group_sizze_214186,
                                                                                  1,
                                                                                  1,
                                                                                  0,
                                                                                  NULL,
                                                                                  kernel_args_237641,
                                                                                  NULL));
                                            if (pevents != NULL)
                                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                                   0));
                                            if (ctx->debugging) {
                                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                                time_end_237643 =
                                                    get_wall_time();
                                                fprintf(ctx->log,
                                                        "Kernel %s runtime: %ldus\n",
                                                        "main.segmap_214195",
                                                        time_end_237643 -
                                                        time_start_237642);
                                            }
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n", "");
                                        if (memblock_unref_device(ctx,
                                                                  &mem_229983,
                                                                  "mem_229983") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_229988,
                                                                  "mem_229988") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_229993,
                                                                  "mem_229993") !=
                                            0)
                                            return 1;
                                        
                                        struct memblock_device mem_230020;
                                        
                                        mem_230020.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230020,
                                                                  bytes_229297,
                                                                  "mem_230020")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230025;
                                        
                                        mem_230025.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230025,
                                                                  bytes_229297,
                                                                  "mem_230025")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        if (slt64(q_s_203493 * (int64_t) 2,
                                                  segred_group_sizze_214222)) {
                                            int64_t
                                            segment_sizze_nonzzero_233594 =
                                            smax64((int64_t) 1, q_s_203493);
                                            int64_t num_threads_233595 =
                                                    num_groups_214223 *
                                                    segred_group_sizze_214222;
                                            
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s\n",
                                                        "\n# SegRed-small");
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "num_segments",
                                                        (long long) (partition_sizze_203577 *
                                                                     n_p_203492 *
                                                                     s_n_m_203636),
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "segment_size",
                                                        (long long) q_s_203493,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "segments_per_group",
                                                        (long long) squot64(segred_group_sizze_214222,
                                                                            segment_sizze_nonzzero_233594),
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "required_groups",
                                                        (long long) sext_i64_i32(sdiv_up64(partition_sizze_203577 *
                                                                                           n_p_203492 *
                                                                                           s_n_m_203636,
                                                                                           squot64(segred_group_sizze_214222,
                                                                                                   segment_sizze_nonzzero_233594))),
                                                        '\n');
                                            
                                            unsigned int shared_sizze_237654 =
                                                         (int64_t) 8 *
                                                         segred_group_sizze_214222;
                                            unsigned int shared_sizze_237656 =
                                                         (int64_t) 8 *
                                                         segred_group_sizze_214222;
                                            CUdeviceptr kernel_arg_237658 =
                                                        ext_mem_229264.mem;
                                            CUdeviceptr kernel_arg_237659 =
                                                        ext_mem_229265.mem;
                                            CUdeviceptr kernel_arg_237660 =
                                                        ext_mem_229362.mem;
                                            CUdeviceptr kernel_arg_237661 =
                                                        ext_mem_229363.mem;
                                            CUdeviceptr kernel_arg_237662 =
                                                        mem_229526.mem;
                                            CUdeviceptr kernel_arg_237663 =
                                                        mem_229531.mem;
                                            CUdeviceptr kernel_arg_237664 =
                                                        mem_229999.mem;
                                            CUdeviceptr kernel_arg_237665 =
                                                        mem_230004.mem;
                                            CUdeviceptr kernel_arg_237666 =
                                                        mem_230009.mem;
                                            CUdeviceptr kernel_arg_237667 =
                                                        mem_230014.mem;
                                            CUdeviceptr kernel_arg_237668 =
                                                        mem_230020.mem;
                                            CUdeviceptr kernel_arg_237669 =
                                                        mem_230025.mem;
                                            unsigned int shared_offset_237655 =
                                                         0;
                                            unsigned int shared_offset_237657 =
                                                         0 +
                                                         (shared_sizze_237654 +
                                                          (8 -
                                                           shared_sizze_237654 %
                                                           8) % 8);
                                            
                                            if ((((((1 && num_groups_214223 !=
                                                     0) && 1 != 0) && 1 != 0) &&
                                                  segred_group_sizze_214222 !=
                                                  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_214223;
                                                grid[perm[1]] = 1;
                                                grid[perm[2]] = 1;
                                                
                                                void *kernel_args_237651[] =
                                                     {&ctx->global_failure,
                                                      &shared_offset_237655,
                                                      &shared_offset_237657,
                                                      &n_p_203492, &q_s_203493,
                                                      &partition_sizze_203577,
                                                      &defunc_0_f_res_203631,
                                                      &s_n_m_203636,
                                                      &num_groups_214223,
                                                      &segment_sizze_nonzzero_233594,
                                                      &kernel_arg_237658,
                                                      &kernel_arg_237659,
                                                      &kernel_arg_237660,
                                                      &kernel_arg_237661,
                                                      &kernel_arg_237662,
                                                      &kernel_arg_237663,
                                                      &kernel_arg_237664,
                                                      &kernel_arg_237665,
                                                      &kernel_arg_237666,
                                                      &kernel_arg_237667,
                                                      &kernel_arg_237668,
                                                      &kernel_arg_237669};
                                                int64_t time_start_237652 = 0,
                                                        time_end_237653 = 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_214231",
                                                            (long) num_groups_214223,
                                                            (long) 1, (long) 1,
                                                            (long) segred_group_sizze_214222,
                                                            (long) 1, (long) 1,
                                                            (int) (0 +
                                                                   (shared_sizze_237654 +
                                                                    (8 -
                                                                     shared_sizze_237654 %
                                                                     8) % 8) +
                                                                   (shared_sizze_237656 +
                                                                    (8 -
                                                                     shared_sizze_237656 %
                                                                     8) % 8)));
                                                    time_start_237652 =
                                                        get_wall_time();
                                                }
                                                
                                                cudaEvent_t *pevents = NULL;
                                                
                                                if (ctx->profiling &&
                                                    !ctx->profiling_paused) {
                                                    pevents =
                                                        cuda_get_events(&ctx->cuda,
                                                                        &ctx->mainzisegred_small_214231_runs,
                                                                        &ctx->mainzisegred_small_214231_total_runtime);
                                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                                       0));
                                                }
                                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_small_214231,
                                                                                      grid[0],
                                                                                      grid[1],
                                                                                      grid[2],
                                                                                      segred_group_sizze_214222,
                                                                                      1,
                                                                                      1,
                                                                                      0 +
                                                                                      (shared_sizze_237654 +
                                                                                       (8 -
                                                                                        shared_sizze_237654 %
                                                                                        8) %
                                                                                       8) +
                                                                                      (shared_sizze_237656 +
                                                                                       (8 -
                                                                                        shared_sizze_237656 %
                                                                                        8) %
                                                                                       8),
                                                                                      NULL,
                                                                                      kernel_args_237651,
                                                                                      NULL));
                                                if (pevents != NULL)
                                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                                       0));
                                                if (ctx->debugging) {
                                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                                    time_end_237653 =
                                                        get_wall_time();
                                                    fprintf(ctx->log,
                                                            "Kernel %s runtime: %ldus\n",
                                                            "main.segred_small_214231",
                                                            time_end_237653 -
                                                            time_start_237652);
                                                }
                                            }
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s\n", "");
                                        } else {
                                            int64_t groups_per_segment_233631 =
                                                    sdiv_up64(num_groups_214223,
                                                              smax64((int64_t) 1,
                                                                     partition_sizze_203577 *
                                                                     n_p_203492 *
                                                                     s_n_m_203636));
                                            int64_t elements_per_thread_233632 =
                                                    sdiv_up64(q_s_203493,
                                                              segred_group_sizze_214222 *
                                                              groups_per_segment_233631);
                                            int64_t virt_num_groups_233633 =
                                                    groups_per_segment_233631 *
                                                    (partition_sizze_203577 *
                                                     n_p_203492 * s_n_m_203636);
                                            int64_t num_threads_233634 =
                                                    num_groups_214223 *
                                                    segred_group_sizze_214222;
                                            int64_t threads_per_segment_233635 =
                                                    groups_per_segment_233631 *
                                                    segred_group_sizze_214222;
                                            
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s\n",
                                                        "\n# SegRed-large");
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "num_segments",
                                                        (long long) (partition_sizze_203577 *
                                                                     n_p_203492 *
                                                                     s_n_m_203636),
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "segment_size",
                                                        (long long) q_s_203493,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "virt_num_groups",
                                                        (long long) virt_num_groups_233633,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "num_groups",
                                                        (long long) num_groups_214223,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "group_size",
                                                        (long long) segred_group_sizze_214222,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "elems_per_thread",
                                                        (long long) elements_per_thread_233632,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "groups_per_segment",
                                                        (long long) groups_per_segment_233631,
                                                        '\n');
                                            
                                            struct memblock_device
                                            segred_tmp_mem_233636;
                                            
                                            segred_tmp_mem_233636.references =
                                                NULL;
                                            if (memblock_alloc_device(ctx,
                                                                      &segred_tmp_mem_233636,
                                                                      (int64_t) 8 *
                                                                      virt_num_groups_233633,
                                                                      "segred_tmp_mem_233636")) {
                                                err = 1;
                                                goto cleanup;
                                            }
                                            
                                            struct memblock_device
                                            segred_tmp_mem_233638;
                                            
                                            segred_tmp_mem_233638.references =
                                                NULL;
                                            if (memblock_alloc_device(ctx,
                                                                      &segred_tmp_mem_233638,
                                                                      (int64_t) 8 *
                                                                      virt_num_groups_233633,
                                                                      "segred_tmp_mem_233638")) {
                                                err = 1;
                                                goto cleanup;
                                            }
                                            
                                            struct memblock_device
                                            mainzicounter_mem_233640 =
                                            ctx->mainzicounter_mem_233640;
                                            unsigned int shared_sizze_237674 =
                                                         1;
                                            unsigned int shared_sizze_237676 =
                                                         (int64_t) 8 *
                                                         segred_group_sizze_214222;
                                            unsigned int shared_sizze_237678 =
                                                         (int64_t) 8 *
                                                         segred_group_sizze_214222;
                                            CUdeviceptr kernel_arg_237680 =
                                                        ext_mem_229264.mem;
                                            CUdeviceptr kernel_arg_237681 =
                                                        ext_mem_229265.mem;
                                            CUdeviceptr kernel_arg_237682 =
                                                        ext_mem_229362.mem;
                                            CUdeviceptr kernel_arg_237683 =
                                                        ext_mem_229363.mem;
                                            CUdeviceptr kernel_arg_237684 =
                                                        mem_229526.mem;
                                            CUdeviceptr kernel_arg_237685 =
                                                        mem_229531.mem;
                                            CUdeviceptr kernel_arg_237686 =
                                                        mem_229999.mem;
                                            CUdeviceptr kernel_arg_237687 =
                                                        mem_230004.mem;
                                            CUdeviceptr kernel_arg_237688 =
                                                        mem_230009.mem;
                                            CUdeviceptr kernel_arg_237689 =
                                                        mem_230014.mem;
                                            CUdeviceptr kernel_arg_237690 =
                                                        mem_230020.mem;
                                            CUdeviceptr kernel_arg_237691 =
                                                        mem_230025.mem;
                                            CUdeviceptr kernel_arg_237692 =
                                                        segred_tmp_mem_233636.mem;
                                            CUdeviceptr kernel_arg_237693 =
                                                        segred_tmp_mem_233638.mem;
                                            CUdeviceptr kernel_arg_237694 =
                                                        mainzicounter_mem_233640.mem;
                                            unsigned int shared_offset_237675 =
                                                         0;
                                            unsigned int shared_offset_237677 =
                                                         0 +
                                                         (shared_sizze_237674 +
                                                          (8 -
                                                           shared_sizze_237674 %
                                                           8) % 8);
                                            unsigned int shared_offset_237679 =
                                                         0 +
                                                         (shared_sizze_237674 +
                                                          (8 -
                                                           shared_sizze_237674 %
                                                           8) % 8) +
                                                         (shared_sizze_237676 +
                                                          (8 -
                                                           shared_sizze_237676 %
                                                           8) % 8);
                                            
                                            if ((((((1 && num_groups_214223 !=
                                                     0) && 1 != 0) && 1 != 0) &&
                                                  segred_group_sizze_214222 !=
                                                  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_214223;
                                                grid[perm[1]] = 1;
                                                grid[perm[2]] = 1;
                                                
                                                void *kernel_args_237671[] =
                                                     {&ctx->global_failure,
                                                      &shared_offset_237675,
                                                      &shared_offset_237677,
                                                      &shared_offset_237679,
                                                      &n_p_203492, &q_s_203493,
                                                      &partition_sizze_203577,
                                                      &defunc_0_f_res_203631,
                                                      &s_n_m_203636,
                                                      &num_groups_214223,
                                                      &groups_per_segment_233631,
                                                      &elements_per_thread_233632,
                                                      &virt_num_groups_233633,
                                                      &threads_per_segment_233635,
                                                      &kernel_arg_237680,
                                                      &kernel_arg_237681,
                                                      &kernel_arg_237682,
                                                      &kernel_arg_237683,
                                                      &kernel_arg_237684,
                                                      &kernel_arg_237685,
                                                      &kernel_arg_237686,
                                                      &kernel_arg_237687,
                                                      &kernel_arg_237688,
                                                      &kernel_arg_237689,
                                                      &kernel_arg_237690,
                                                      &kernel_arg_237691,
                                                      &kernel_arg_237692,
                                                      &kernel_arg_237693,
                                                      &kernel_arg_237694};
                                                int64_t time_start_237672 = 0,
                                                        time_end_237673 = 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_214231",
                                                            (long) num_groups_214223,
                                                            (long) 1, (long) 1,
                                                            (long) segred_group_sizze_214222,
                                                            (long) 1, (long) 1,
                                                            (int) (0 +
                                                                   (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)));
                                                    time_start_237672 =
                                                        get_wall_time();
                                                }
                                                
                                                cudaEvent_t *pevents = NULL;
                                                
                                                if (ctx->profiling &&
                                                    !ctx->profiling_paused) {
                                                    pevents =
                                                        cuda_get_events(&ctx->cuda,
                                                                        &ctx->mainzisegred_large_214231_runs,
                                                                        &ctx->mainzisegred_large_214231_total_runtime);
                                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                                       0));
                                                }
                                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_large_214231,
                                                                                      grid[0],
                                                                                      grid[1],
                                                                                      grid[2],
                                                                                      segred_group_sizze_214222,
                                                                                      1,
                                                                                      1,
                                                                                      0 +
                                                                                      (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),
                                                                                      NULL,
                                                                                      kernel_args_237671,
                                                                                      NULL));
                                                if (pevents != NULL)
                                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                                       0));
                                                if (ctx->debugging) {
                                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                                    time_end_237673 =
                                                        get_wall_time();
                                                    fprintf(ctx->log,
                                                            "Kernel %s runtime: %ldus\n",
                                                            "main.segred_large_214231",
                                                            time_end_237673 -
                                                            time_start_237672);
                                                }
                                            }
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s\n", "");
                                            if (memblock_unref_device(ctx,
                                                                      &segred_tmp_mem_233638,
                                                                      "segred_tmp_mem_233638") !=
                                                0)
                                                return 1;
                                            if (memblock_unref_device(ctx,
                                                                      &segred_tmp_mem_233636,
                                                                      "segred_tmp_mem_233636") !=
                                                0)
                                                return 1;
                                        }
                                        if (memblock_unref_device(ctx,
                                                                  &mem_229999,
                                                                  "mem_229999") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230004,
                                                                  "mem_230004") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230009,
                                                                  "mem_230009") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230014,
                                                                  "mem_230014") !=
                                            0)
                                            return 1;
                                        if (memblock_set_device(ctx,
                                                                &ext_mem_230027,
                                                                &mem_230020,
                                                                "mem_230020") !=
                                            0)
                                            return 1;
                                        if (memblock_set_device(ctx,
                                                                &ext_mem_230026,
                                                                &mem_230025,
                                                                "mem_230025") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230025,
                                                                  "mem_230025") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230020,
                                                                  "mem_230020") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230014,
                                                                  "mem_230014") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230009,
                                                                  "mem_230009") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230004,
                                                                  "mem_230004") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_229999,
                                                                  "mem_229999") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_229993,
                                                                  "mem_229993") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_229988,
                                                                  "mem_229988") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_229983,
                                                                  "mem_229983") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_229977,
                                                                  "mem_229977") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_229973,
                                                                  "mem_229973") !=
                                            0)
                                            return 1;
                                    }
                                    if (memblock_set_device(ctx,
                                                            &ext_mem_230029,
                                                            &ext_mem_230027,
                                                            "ext_mem_230027") !=
                                        0)
                                        return 1;
                                    if (memblock_set_device(ctx,
                                                            &ext_mem_230028,
                                                            &ext_mem_230026,
                                                            "ext_mem_230026") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230026,
                                                              "ext_mem_230026") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230027,
                                                              "ext_mem_230027") !=
                                        0)
                                        return 1;
                                }
                                if (memblock_set_device(ctx, &ext_mem_230043,
                                                        &ext_mem_230029,
                                                        "ext_mem_230029") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_230042,
                                                        &ext_mem_230028,
                                                        "ext_mem_230028") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230028,
                                                          "ext_mem_230028") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230029,
                                                          "ext_mem_230029") !=
                                    0)
                                    return 1;
                            }
                            if (memblock_set_device(ctx, &ext_mem_230057,
                                                    &ext_mem_230043,
                                                    "ext_mem_230043") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_230056,
                                                    &ext_mem_230042,
                                                    "ext_mem_230042") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230042,
                                                      "ext_mem_230042") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230043,
                                                      "ext_mem_230043") != 0)
                                return 1;
                        }
                        if (memblock_set_device(ctx, &ext_mem_230418,
                                                &ext_mem_230057,
                                                "ext_mem_230057") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_230417,
                                                &ext_mem_230056,
                                                "ext_mem_230056") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230056,
                                                  "ext_mem_230056") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230057,
                                                  "ext_mem_230057") != 0)
                            return 1;
                    } else {
                        bool suff_outer_par_214302;
                        
                        suff_outer_par_214302 =
                            *ctx->tuning_params.mainzisuff_outer_par_15 <=
                            partition_sizze_203577;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_15",
                                    (long) partition_sizze_203577,
                                    suff_outer_par_214302 ? "true" : "false");
                        
                        int64_t segmap_group_sizze_214464;
                        
                        segmap_group_sizze_214464 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_214306;
                        
                        int64_t num_groups_214465;
                        int32_t max_num_groups_233688;
                        
                        max_num_groups_233688 =
                            *ctx->tuning_params.mainzisegmap_num_groups_214308;
                        num_groups_214465 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(partition_sizze_203577,
                                                                                 segmap_group_sizze_214464),
                                                                       sext_i32_i64(max_num_groups_233688))));
                        
                        int64_t segmap_group_sizze_216239;
                        
                        segmap_group_sizze_216239 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_214626;
                        
                        int64_t num_groups_216240;
                        int32_t max_num_groups_233689;
                        
                        max_num_groups_233689 =
                            *ctx->tuning_params.mainzisegmap_num_groups_214628;
                        num_groups_216240 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(binop_x_229202,
                                                                                 segmap_group_sizze_216239),
                                                                       sext_i32_i64(max_num_groups_233689))));
                        
                        bool suff_outer_par_216244;
                        
                        suff_outer_par_216244 =
                            *ctx->tuning_params.mainzisuff_outer_par_16 <=
                            binop_x_229202;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_16",
                                    (long) binop_x_229202,
                                    suff_outer_par_216244 ? "true" : "false");
                        
                        int64_t one_intra_par_min_216245 = q_s_203493 *
                                s_n_m_203636;
                        int64_t intra_avail_par_216247 = smin64(s_n_m_203636,
                                                                one_intra_par_min_216245);
                        int64_t computed_group_sizze_216248 =
                                smax64(s_n_m_203636, one_intra_par_min_216245);
                        bool fits_216252 = sle64(computed_group_sizze_216248,
                                                 max_group_sizze_206887);
                        bool suff_intra_par_216254;
                        
                        suff_intra_par_216254 =
                            *ctx->tuning_params.mainzisuff_intra_par_17 <=
                            intra_avail_par_216247;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_intra_par_17",
                                    (long) intra_avail_par_216247,
                                    suff_intra_par_216254 ? "true" : "false");
                        
                        bool intra_suff_and_fits_216255 = fits_216252 &&
                             suff_intra_par_216254;
                        int64_t segmap_group_sizze_216594;
                        
                        segmap_group_sizze_216594 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_215167;
                        
                        bool suff_outer_par_216599;
                        
                        suff_outer_par_216599 =
                            *ctx->tuning_params.mainzisuff_outer_par_18 <=
                            nest_sizze_208848;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_18",
                                    (long) nest_sizze_208848,
                                    suff_outer_par_216599 ? "true" : "false");
                        
                        int64_t segmap_group_sizze_216749;
                        
                        segmap_group_sizze_216749 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_215584;
                        
                        int64_t nest_sizze_216771 = q_s_203493 *
                                nest_sizze_208848;
                        int64_t segred_group_sizze_216772;
                        
                        segred_group_sizze_216772 =
                            *ctx->tuning_params.mainzisegred_group_sizze_215512;
                        
                        int64_t num_groups_216773;
                        int32_t max_num_groups_233690;
                        
                        max_num_groups_233690 =
                            *ctx->tuning_params.mainzisegred_num_groups_215514;
                        num_groups_216773 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(nest_sizze_216771,
                                                                                 segred_group_sizze_216772),
                                                                       sext_i32_i64(max_num_groups_233690))));
                        
                        int64_t segmap_group_sizze_216841;
                        
                        segmap_group_sizze_216841 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_215454;
                        
                        int64_t segred_group_sizze_216898;
                        
                        segred_group_sizze_216898 =
                            *ctx->tuning_params.mainzisegred_group_sizze_215343;
                        
                        int64_t num_groups_216899;
                        int32_t max_num_groups_233691;
                        
                        max_num_groups_233691 =
                            *ctx->tuning_params.mainzisegred_num_groups_215345;
                        num_groups_216899 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(nest_sizze_216771,
                                                                                 segred_group_sizze_216898),
                                                                       sext_i32_i64(max_num_groups_233691))));
                        
                        int64_t bytes_230060 = (int64_t) 8 * nest_sizze_208848;
                        int64_t bytes_230067 = (int64_t) 8 * nest_sizze_207163;
                        int64_t binop_x_230178 = partition_sizze_203577 *
                                s_n_m_203636;
                        int64_t binop_x_230179 = n_p_203492 * binop_x_230178;
                        int64_t bytes_230180 = (int64_t) 8 * binop_x_230179;
                        int64_t binop_x_230186 = partition_sizze_203577 *
                                defunc_0_f_res_203631;
                        int64_t binop_x_230187 = n_p_203492 * binop_x_230186;
                        int64_t bytes_230188 = (int64_t) 8 * binop_x_230187;
                        int64_t bytes_230242 = smax64((int64_t) 0,
                                                      s_n_m_203636);
                        int64_t bytes_230315 = smax64((int64_t) 0,
                                                      binop_x_229295);
                        int64_t num_threads_232131 = segmap_group_sizze_214464 *
                                num_groups_214465;
                        int64_t total_sizze_232132 = bytes_229288 *
                                num_threads_232131;
                        int64_t total_sizze_232133 = bytes_229288 *
                                num_threads_232131;
                        int64_t num_threads_232134 = segmap_group_sizze_216239 *
                                num_groups_216240;
                        int64_t total_sizze_232135 = bytes_229311 *
                                num_threads_232134;
                        int64_t total_sizze_232136 = bytes_229311 *
                                num_threads_232134;
                        struct memblock_device ext_mem_230416;
                        
                        ext_mem_230416.references = NULL;
                        
                        struct memblock_device ext_mem_230415;
                        
                        ext_mem_230415.references = NULL;
                        
                        int32_t local_memory_capacity_234112;
                        
                        local_memory_capacity_234112 =
                            ctx->cuda.max_shared_memory;
                        if (sle64((int64_t) 0,
                                  sext_i32_i64(local_memory_capacity_234112)) &&
                            suff_outer_par_214302) {
                            struct memblock_device mem_230061;
                            
                            mem_230061.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230061,
                                                      bytes_230060,
                                                      "mem_230061")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230061,
                                                                      (int64_t) 0,
                                                                      ext_mem_229362,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_p_203492 *
                                                                      s_n_m_203636,
                                                                      partition_sizze_203577) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230061,
                                                          "mem_230061") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230415,
                                                          "ext_mem_230415") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230416,
                                                          "ext_mem_230416") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230417,
                                                          "ext_mem_230417") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230418,
                                                          "ext_mem_230418") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230419,
                                                          "ext_mem_230419") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230420,
                                                          "ext_mem_230420") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230064;
                            
                            mem_230064.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230064,
                                                      binop_y_229224,
                                                      "mem_230064")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_230064,
                                                                      (int64_t) 0,
                                                                      ext_mem_229264,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_p_203492,
                                                                      partition_sizze_203577) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230064,
                                                          "mem_230064") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230061,
                                                          "mem_230061") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230415,
                                                          "ext_mem_230415") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230416,
                                                          "ext_mem_230416") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230417,
                                                          "ext_mem_230417") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230418,
                                                          "ext_mem_230418") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230419,
                                                          "ext_mem_230419") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230420,
                                                          "ext_mem_230420") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230068;
                            
                            mem_230068.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230068,
                                                      bytes_230067,
                                                      "mem_230068")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230068,
                                                                      (int64_t) 0,
                                                                      mem_229531,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_p_203492 *
                                                                      defunc_0_f_res_203631,
                                                                      partition_sizze_203577) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230068,
                                                          "mem_230068") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230064,
                                                          "mem_230064") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230061,
                                                          "mem_230061") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230415,
                                                          "ext_mem_230415") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230416,
                                                          "ext_mem_230416") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230417,
                                                          "ext_mem_230417") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230418,
                                                          "ext_mem_230418") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230419,
                                                          "ext_mem_230419") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230420,
                                                          "ext_mem_230420") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230072;
                            
                            mem_230072.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230072,
                                                      bytes_230060,
                                                      "mem_230072")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_230072,
                                                                      (int64_t) 0,
                                                                      ext_mem_229363,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_p_203492 *
                                                                      s_n_m_203636,
                                                                      partition_sizze_203577) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230072,
                                                          "mem_230072") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230068,
                                                          "mem_230068") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230064,
                                                          "mem_230064") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230061,
                                                          "mem_230061") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230415,
                                                          "ext_mem_230415") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230416,
                                                          "ext_mem_230416") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230417,
                                                          "ext_mem_230417") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230418,
                                                          "ext_mem_230418") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230419,
                                                          "ext_mem_230419") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230420,
                                                          "ext_mem_230420") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230076;
                            
                            mem_230076.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230076,
                                                      bytes_230067,
                                                      "mem_230076")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230076,
                                                                      (int64_t) 0,
                                                                      mem_229526,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_p_203492 *
                                                                      defunc_0_f_res_203631,
                                                                      partition_sizze_203577) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230076,
                                                          "mem_230076") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230072,
                                                          "mem_230072") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230068,
                                                          "mem_230068") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230064,
                                                          "mem_230064") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230061,
                                                          "mem_230061") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230415,
                                                          "ext_mem_230415") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230416,
                                                          "ext_mem_230416") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230417,
                                                          "ext_mem_230417") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230418,
                                                          "ext_mem_230418") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230419,
                                                          "ext_mem_230419") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230420,
                                                          "ext_mem_230420") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230080;
                            
                            mem_230080.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230080,
                                                      bytes_230067,
                                                      "mem_230080")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_230080,
                                                                      (int64_t) 0,
                                                                      ext_mem_229265,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_p_203492 *
                                                                      defunc_0_f_res_203631,
                                                                      partition_sizze_203577) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230080,
                                                          "mem_230080") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230076,
                                                          "mem_230076") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230072,
                                                          "mem_230072") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230068,
                                                          "mem_230068") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230064,
                                                          "mem_230064") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230061,
                                                          "mem_230061") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230415,
                                                          "ext_mem_230415") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230416,
                                                          "ext_mem_230416") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230417,
                                                          "ext_mem_230417") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230418,
                                                          "ext_mem_230418") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230419,
                                                          "ext_mem_230419") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230420,
                                                          "ext_mem_230420") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230173;
                            
                            mem_230173.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230173,
                                                      bytes_230060,
                                                      "mem_230173")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230177;
                            
                            mem_230177.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230177,
                                                      bytes_230060,
                                                      "mem_230177")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232004;
                            
                            color_232004.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232004,
                                                      total_sizze_232132,
                                                      "color_232004")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232005;
                            
                            color_232005.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232005,
                                                      total_sizze_232133,
                                                      "color_232005")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            
                            CUdeviceptr kernel_arg_237698 = mem_230061.mem;
                            CUdeviceptr kernel_arg_237699 = mem_230064.mem;
                            CUdeviceptr kernel_arg_237700 = mem_230068.mem;
                            CUdeviceptr kernel_arg_237701 = mem_230072.mem;
                            CUdeviceptr kernel_arg_237702 = mem_230076.mem;
                            CUdeviceptr kernel_arg_237703 = mem_230080.mem;
                            CUdeviceptr kernel_arg_237704 = mem_230173.mem;
                            CUdeviceptr kernel_arg_237705 = mem_230177.mem;
                            CUdeviceptr kernel_arg_237706 = color_232004.mem;
                            CUdeviceptr kernel_arg_237707 = color_232005.mem;
                            
                            if ((((((1 && num_groups_214465 != 0) && 1 != 0) &&
                                   1 != 0) && segmap_group_sizze_214464 != 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_214465;
                                grid[perm[1]] = 1;
                                grid[perm[2]] = 1;
                                
                                void *kernel_args_237695[] =
                                     {&ctx->global_failure, &n_p_203492,
                                      &q_s_203493, &jump_s_203499,
                                      &partition_sizze_203577,
                                      &defunc_0_f_res_203631,
                                      &pad_css_len_203632, &s_n_m_203636,
                                      &num_groups_214465, &num_threads_232131,
                                      &kernel_arg_237698, &kernel_arg_237699,
                                      &kernel_arg_237700, &kernel_arg_237701,
                                      &kernel_arg_237702, &kernel_arg_237703,
                                      &kernel_arg_237704, &kernel_arg_237705,
                                      &kernel_arg_237706, &kernel_arg_237707};
                                int64_t time_start_237696 = 0, time_end_237697 =
                                        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_214470",
                                            (long) num_groups_214465, (long) 1,
                                            (long) 1,
                                            (long) segmap_group_sizze_214464,
                                            (long) 1, (long) 1, (int) 0);
                                    time_start_237696 = get_wall_time();
                                }
                                
                                cudaEvent_t *pevents = NULL;
                                
                                if (ctx->profiling && !ctx->profiling_paused) {
                                    pevents = cuda_get_events(&ctx->cuda,
                                                              &ctx->mainzisegmap_214470_runs,
                                                              &ctx->mainzisegmap_214470_total_runtime);
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                       0));
                                }
                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_214470,
                                                                      grid[0],
                                                                      grid[1],
                                                                      grid[2],
                                                                      segmap_group_sizze_214464,
                                                                      1, 1, 0,
                                                                      NULL,
                                                                      kernel_args_237695,
                                                                      NULL));
                                if (pevents != NULL)
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                       0));
                                if (ctx->debugging) {
                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                    time_end_237697 = get_wall_time();
                                    fprintf(ctx->log,
                                            "Kernel %s runtime: %ldus\n",
                                            "main.segmap_214470",
                                            time_end_237697 -
                                            time_start_237696);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx, &mem_230061,
                                                      "mem_230061") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230064,
                                                      "mem_230064") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230068,
                                                      "mem_230068") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230072,
                                                      "mem_230072") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230076,
                                                      "mem_230076") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230080,
                                                      "mem_230080") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232004,
                                                      "color_232004") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232005,
                                                      "color_232005") != 0)
                                return 1;
                            
                            struct memblock_device mem_230407;
                            
                            mem_230407.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230407,
                                                      bytes_229297,
                                                      "mem_230407")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230407,
                                                                      (int64_t) 0,
                                                                      mem_230173,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      partition_sizze_203577,
                                                                      n_p_203492 *
                                                                      s_n_m_203636) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230407,
                                                          "mem_230407") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232005,
                                                          "color_232005") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232004,
                                                          "color_232004") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230177,
                                                          "mem_230177") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230173,
                                                          "mem_230173") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230080,
                                                          "mem_230080") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230076,
                                                          "mem_230076") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230072,
                                                          "mem_230072") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230068,
                                                          "mem_230068") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230064,
                                                          "mem_230064") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230061,
                                                          "mem_230061") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230415,
                                                          "ext_mem_230415") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230416,
                                                          "ext_mem_230416") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230417,
                                                          "ext_mem_230417") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230418,
                                                          "ext_mem_230418") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230419,
                                                          "ext_mem_230419") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230420,
                                                          "ext_mem_230420") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_230173,
                                                      "mem_230173") != 0)
                                return 1;
                            
                            struct memblock_device mem_230413;
                            
                            mem_230413.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230413,
                                                      bytes_229297,
                                                      "mem_230413")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230413,
                                                                      (int64_t) 0,
                                                                      mem_230177,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      partition_sizze_203577,
                                                                      n_p_203492 *
                                                                      s_n_m_203636) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230413,
                                                          "mem_230413") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230407,
                                                          "mem_230407") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232005,
                                                          "color_232005") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232004,
                                                          "color_232004") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230177,
                                                          "mem_230177") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230173,
                                                          "mem_230173") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230080,
                                                          "mem_230080") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230076,
                                                          "mem_230076") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230072,
                                                          "mem_230072") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230068,
                                                          "mem_230068") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230064,
                                                          "mem_230064") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230061,
                                                          "mem_230061") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230415,
                                                          "ext_mem_230415") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230416,
                                                          "ext_mem_230416") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230417,
                                                          "ext_mem_230417") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230418,
                                                          "ext_mem_230418") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230419,
                                                          "ext_mem_230419") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230420,
                                                          "ext_mem_230420") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_230177,
                                                      "mem_230177") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_230416,
                                                    &mem_230407,
                                                    "mem_230407") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_230415,
                                                    &mem_230413,
                                                    "mem_230413") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230413,
                                                      "mem_230413") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230407,
                                                      "mem_230407") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232005,
                                                      "color_232005") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232004,
                                                      "color_232004") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230177,
                                                      "mem_230177") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230173,
                                                      "mem_230173") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230080,
                                                      "mem_230080") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230076,
                                                      "mem_230076") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230072,
                                                      "mem_230072") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230068,
                                                      "mem_230068") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230064,
                                                      "mem_230064") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230061,
                                                      "mem_230061") != 0)
                                return 1;
                        } else {
                            struct memblock_device ext_mem_230402;
                            
                            ext_mem_230402.references = NULL;
                            
                            struct memblock_device ext_mem_230401;
                            
                            ext_mem_230401.references = NULL;
                            
                            int32_t local_memory_capacity_234111;
                            
                            local_memory_capacity_234111 =
                                ctx->cuda.max_shared_memory;
                            if (sle64((int64_t) 0,
                                      sext_i32_i64(local_memory_capacity_234111)) &&
                                suff_outer_par_216244) {
                                struct memblock_device mem_230181;
                                
                                mem_230181.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230181,
                                                          bytes_230180,
                                                          "mem_230181")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                          mem_230181,
                                                                          (int64_t) 0,
                                                                          ext_mem_229363,
                                                                          (int64_t) 0,
                                                                          (int64_t) 1,
                                                                          s_n_m_203636,
                                                                          partition_sizze_203577 *
                                                                          n_p_203492) !=
                                    0) {
                                    if (memblock_unref_device(ctx, &mem_230181,
                                                              "mem_230181") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230401,
                                                              "ext_mem_230401") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230402,
                                                              "ext_mem_230402") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230415,
                                                              "ext_mem_230415") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230416,
                                                              "ext_mem_230416") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230417,
                                                              "ext_mem_230417") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230418,
                                                              "ext_mem_230418") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230419,
                                                              "ext_mem_230419") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230420,
                                                              "ext_mem_230420") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230486,
                                                              "ext_mem_230486") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230487,
                                                              "ext_mem_230487") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229515,
                                                              "mem_param_229515") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229507,
                                                              "mem_param_229507") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231517,
                                                              "ext_mem_231517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231518,
                                                              "ext_mem_231518") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229493,
                                                              "mem_param_229493") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229485,
                                                              "mem_param_229485") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229477,
                                                              "mem_param_229477") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231860,
                                                              "ext_mem_231860") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231861,
                                                              "ext_mem_231861") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231862,
                                                              "ext_mem_231862") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230551,
                                                              "mem_230551") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230534,
                                                              "mem_230534") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230517,
                                                              "mem_230517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230500,
                                                              "mem_230500") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229531,
                                                              "mem_229531") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229526,
                                                              "mem_229526") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229520,
                                                              "mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229469,
                                                              "mem_229469") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229465,
                                                              "mem_229465") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229460,
                                                              "ext_mem_229460") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229461,
                                                              "ext_mem_229461") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229411,
                                                              "ext_mem_229411") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229412,
                                                              "ext_mem_229412") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229362,
                                                              "ext_mem_229362") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229363,
                                                              "ext_mem_229363") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229264,
                                                              "ext_mem_229264") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229265,
                                                              "ext_mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229206,
                                                              "mem_229206") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229200,
                                                              "mem_229200") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229196,
                                                              "ext_mem_229196") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229197,
                                                              "ext_mem_229197") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229164,
                                                              "mem_229164") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229161,
                                                              "mem_229161") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229157,
                                                              "mem_229157") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229155,
                                                              "mem_229155") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229152,
                                                              "mem_229152") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229148,
                                                              "mem_229148") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232249,
                                                              "mem_out_232249") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232248,
                                                              "mem_out_232248") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232247,
                                                              "mem_out_232247") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230185;
                                
                                mem_230185.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230185,
                                                          bytes_230180,
                                                          "mem_230185")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                          mem_230185,
                                                                          (int64_t) 0,
                                                                          ext_mem_229362,
                                                                          (int64_t) 0,
                                                                          (int64_t) 1,
                                                                          s_n_m_203636,
                                                                          partition_sizze_203577 *
                                                                          n_p_203492) !=
                                    0) {
                                    if (memblock_unref_device(ctx, &mem_230185,
                                                              "mem_230185") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230181,
                                                              "mem_230181") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230401,
                                                              "ext_mem_230401") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230402,
                                                              "ext_mem_230402") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230415,
                                                              "ext_mem_230415") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230416,
                                                              "ext_mem_230416") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230417,
                                                              "ext_mem_230417") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230418,
                                                              "ext_mem_230418") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230419,
                                                              "ext_mem_230419") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230420,
                                                              "ext_mem_230420") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230486,
                                                              "ext_mem_230486") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230487,
                                                              "ext_mem_230487") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229515,
                                                              "mem_param_229515") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229507,
                                                              "mem_param_229507") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231517,
                                                              "ext_mem_231517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231518,
                                                              "ext_mem_231518") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229493,
                                                              "mem_param_229493") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229485,
                                                              "mem_param_229485") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229477,
                                                              "mem_param_229477") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231860,
                                                              "ext_mem_231860") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231861,
                                                              "ext_mem_231861") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231862,
                                                              "ext_mem_231862") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230551,
                                                              "mem_230551") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230534,
                                                              "mem_230534") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230517,
                                                              "mem_230517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230500,
                                                              "mem_230500") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229531,
                                                              "mem_229531") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229526,
                                                              "mem_229526") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229520,
                                                              "mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229469,
                                                              "mem_229469") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229465,
                                                              "mem_229465") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229460,
                                                              "ext_mem_229460") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229461,
                                                              "ext_mem_229461") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229411,
                                                              "ext_mem_229411") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229412,
                                                              "ext_mem_229412") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229362,
                                                              "ext_mem_229362") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229363,
                                                              "ext_mem_229363") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229264,
                                                              "ext_mem_229264") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229265,
                                                              "ext_mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229206,
                                                              "mem_229206") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229200,
                                                              "mem_229200") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229196,
                                                              "ext_mem_229196") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229197,
                                                              "ext_mem_229197") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229164,
                                                              "mem_229164") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229161,
                                                              "mem_229161") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229157,
                                                              "mem_229157") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229155,
                                                              "mem_229155") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229152,
                                                              "mem_229152") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229148,
                                                              "mem_229148") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232249,
                                                              "mem_out_232249") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232248,
                                                              "mem_out_232248") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232247,
                                                              "mem_out_232247") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230189;
                                
                                mem_230189.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230189,
                                                          bytes_230188,
                                                          "mem_230189")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                          mem_230189,
                                                                          (int64_t) 0,
                                                                          ext_mem_229265,
                                                                          (int64_t) 0,
                                                                          (int64_t) 1,
                                                                          defunc_0_f_res_203631,
                                                                          partition_sizze_203577 *
                                                                          n_p_203492) !=
                                    0) {
                                    if (memblock_unref_device(ctx, &mem_230189,
                                                              "mem_230189") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230185,
                                                              "mem_230185") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230181,
                                                              "mem_230181") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230401,
                                                              "ext_mem_230401") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230402,
                                                              "ext_mem_230402") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230415,
                                                              "ext_mem_230415") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230416,
                                                              "ext_mem_230416") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230417,
                                                              "ext_mem_230417") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230418,
                                                              "ext_mem_230418") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230419,
                                                              "ext_mem_230419") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230420,
                                                              "ext_mem_230420") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230486,
                                                              "ext_mem_230486") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230487,
                                                              "ext_mem_230487") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229515,
                                                              "mem_param_229515") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229507,
                                                              "mem_param_229507") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231517,
                                                              "ext_mem_231517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231518,
                                                              "ext_mem_231518") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229493,
                                                              "mem_param_229493") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229485,
                                                              "mem_param_229485") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229477,
                                                              "mem_param_229477") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231860,
                                                              "ext_mem_231860") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231861,
                                                              "ext_mem_231861") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231862,
                                                              "ext_mem_231862") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230551,
                                                              "mem_230551") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230534,
                                                              "mem_230534") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230517,
                                                              "mem_230517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230500,
                                                              "mem_230500") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229531,
                                                              "mem_229531") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229526,
                                                              "mem_229526") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229520,
                                                              "mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229469,
                                                              "mem_229469") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229465,
                                                              "mem_229465") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229460,
                                                              "ext_mem_229460") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229461,
                                                              "ext_mem_229461") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229411,
                                                              "ext_mem_229411") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229412,
                                                              "ext_mem_229412") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229362,
                                                              "ext_mem_229362") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229363,
                                                              "ext_mem_229363") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229264,
                                                              "ext_mem_229264") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229265,
                                                              "ext_mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229206,
                                                              "mem_229206") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229200,
                                                              "mem_229200") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229196,
                                                              "ext_mem_229196") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229197,
                                                              "ext_mem_229197") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229164,
                                                              "mem_229164") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229161,
                                                              "mem_229161") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229157,
                                                              "mem_229157") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229155,
                                                              "mem_229155") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229152,
                                                              "mem_229152") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229148,
                                                              "mem_229148") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232249,
                                                              "mem_out_232249") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232248,
                                                              "mem_out_232248") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232247,
                                                              "mem_out_232247") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230193;
                                
                                mem_230193.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230193,
                                                          bytes_230188,
                                                          "mem_230193")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                          mem_230193,
                                                                          (int64_t) 0,
                                                                          mem_229531,
                                                                          (int64_t) 0,
                                                                          (int64_t) 1,
                                                                          defunc_0_f_res_203631,
                                                                          partition_sizze_203577 *
                                                                          n_p_203492) !=
                                    0) {
                                    if (memblock_unref_device(ctx, &mem_230193,
                                                              "mem_230193") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230189,
                                                              "mem_230189") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230185,
                                                              "mem_230185") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230181,
                                                              "mem_230181") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230401,
                                                              "ext_mem_230401") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230402,
                                                              "ext_mem_230402") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230415,
                                                              "ext_mem_230415") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230416,
                                                              "ext_mem_230416") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230417,
                                                              "ext_mem_230417") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230418,
                                                              "ext_mem_230418") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230419,
                                                              "ext_mem_230419") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230420,
                                                              "ext_mem_230420") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230486,
                                                              "ext_mem_230486") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230487,
                                                              "ext_mem_230487") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229515,
                                                              "mem_param_229515") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229507,
                                                              "mem_param_229507") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231517,
                                                              "ext_mem_231517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231518,
                                                              "ext_mem_231518") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229493,
                                                              "mem_param_229493") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229485,
                                                              "mem_param_229485") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229477,
                                                              "mem_param_229477") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231860,
                                                              "ext_mem_231860") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231861,
                                                              "ext_mem_231861") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231862,
                                                              "ext_mem_231862") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230551,
                                                              "mem_230551") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230534,
                                                              "mem_230534") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230517,
                                                              "mem_230517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230500,
                                                              "mem_230500") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229531,
                                                              "mem_229531") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229526,
                                                              "mem_229526") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229520,
                                                              "mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229469,
                                                              "mem_229469") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229465,
                                                              "mem_229465") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229460,
                                                              "ext_mem_229460") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229461,
                                                              "ext_mem_229461") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229411,
                                                              "ext_mem_229411") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229412,
                                                              "ext_mem_229412") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229362,
                                                              "ext_mem_229362") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229363,
                                                              "ext_mem_229363") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229264,
                                                              "ext_mem_229264") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229265,
                                                              "ext_mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229206,
                                                              "mem_229206") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229200,
                                                              "mem_229200") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229196,
                                                              "ext_mem_229196") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229197,
                                                              "ext_mem_229197") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229164,
                                                              "mem_229164") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229161,
                                                              "mem_229161") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229157,
                                                              "mem_229157") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229155,
                                                              "mem_229155") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229152,
                                                              "mem_229152") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229148,
                                                              "mem_229148") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232249,
                                                              "mem_out_232249") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232248,
                                                              "mem_out_232248") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232247,
                                                              "mem_out_232247") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230197;
                                
                                mem_230197.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230197,
                                                          bytes_230188,
                                                          "mem_230197")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                          mem_230197,
                                                                          (int64_t) 0,
                                                                          mem_229526,
                                                                          (int64_t) 0,
                                                                          (int64_t) 1,
                                                                          defunc_0_f_res_203631,
                                                                          partition_sizze_203577 *
                                                                          n_p_203492) !=
                                    0) {
                                    if (memblock_unref_device(ctx, &mem_230197,
                                                              "mem_230197") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230193,
                                                              "mem_230193") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230189,
                                                              "mem_230189") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230185,
                                                              "mem_230185") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230181,
                                                              "mem_230181") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230401,
                                                              "ext_mem_230401") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230402,
                                                              "ext_mem_230402") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230415,
                                                              "ext_mem_230415") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230416,
                                                              "ext_mem_230416") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230417,
                                                              "ext_mem_230417") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230418,
                                                              "ext_mem_230418") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230419,
                                                              "ext_mem_230419") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230420,
                                                              "ext_mem_230420") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230486,
                                                              "ext_mem_230486") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230487,
                                                              "ext_mem_230487") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229515,
                                                              "mem_param_229515") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229507,
                                                              "mem_param_229507") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231517,
                                                              "ext_mem_231517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231518,
                                                              "ext_mem_231518") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229493,
                                                              "mem_param_229493") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229485,
                                                              "mem_param_229485") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229477,
                                                              "mem_param_229477") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231860,
                                                              "ext_mem_231860") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231861,
                                                              "ext_mem_231861") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231862,
                                                              "ext_mem_231862") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230551,
                                                              "mem_230551") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230534,
                                                              "mem_230534") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230517,
                                                              "mem_230517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230500,
                                                              "mem_230500") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229531,
                                                              "mem_229531") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229526,
                                                              "mem_229526") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229520,
                                                              "mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229469,
                                                              "mem_229469") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229465,
                                                              "mem_229465") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229460,
                                                              "ext_mem_229460") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229461,
                                                              "ext_mem_229461") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229411,
                                                              "ext_mem_229411") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229412,
                                                              "ext_mem_229412") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229362,
                                                              "ext_mem_229362") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229363,
                                                              "ext_mem_229363") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229264,
                                                              "ext_mem_229264") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229265,
                                                              "ext_mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229206,
                                                              "mem_229206") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229200,
                                                              "mem_229200") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229196,
                                                              "ext_mem_229196") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229197,
                                                              "ext_mem_229197") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229164,
                                                              "mem_229164") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229161,
                                                              "mem_229161") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229157,
                                                              "mem_229157") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229155,
                                                              "mem_229155") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229152,
                                                              "mem_229152") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229148,
                                                              "mem_229148") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232249,
                                                              "mem_out_232249") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232248,
                                                              "mem_out_232248") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232247,
                                                              "mem_out_232247") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230232;
                                
                                mem_230232.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230232,
                                                          bytes_230180,
                                                          "mem_230232")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230236;
                                
                                mem_230236.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230236,
                                                          bytes_230180,
                                                          "mem_230236")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device color_232006;
                                
                                color_232006.references = NULL;
                                if (memblock_alloc_device(ctx, &color_232006,
                                                          total_sizze_232135,
                                                          "color_232006")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device color_232007;
                                
                                color_232007.references = NULL;
                                if (memblock_alloc_device(ctx, &color_232007,
                                                          total_sizze_232136,
                                                          "color_232007")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                                
                                CUdeviceptr kernel_arg_237711 =
                                            ext_mem_229264.mem;
                                CUdeviceptr kernel_arg_237712 = mem_230181.mem;
                                CUdeviceptr kernel_arg_237713 = mem_230185.mem;
                                CUdeviceptr kernel_arg_237714 = mem_230189.mem;
                                CUdeviceptr kernel_arg_237715 = mem_230193.mem;
                                CUdeviceptr kernel_arg_237716 = mem_230197.mem;
                                CUdeviceptr kernel_arg_237717 = mem_230232.mem;
                                CUdeviceptr kernel_arg_237718 = mem_230236.mem;
                                CUdeviceptr kernel_arg_237719 =
                                            color_232006.mem;
                                CUdeviceptr kernel_arg_237720 =
                                            color_232007.mem;
                                
                                if ((((((1 && num_groups_216240 != 0) && 1 !=
                                        0) && 1 != 0) &&
                                      segmap_group_sizze_216239 != 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_216240;
                                    grid[perm[1]] = 1;
                                    grid[perm[2]] = 1;
                                    
                                    void *kernel_args_237708[] =
                                         {&ctx->global_failure, &n_p_203492,
                                          &q_s_203493, &jump_s_203499,
                                          &partition_sizze_203577,
                                          &defunc_0_f_res_203631,
                                          &pad_css_len_203632, &s_n_m_203636,
                                          &num_groups_216240,
                                          &num_threads_232134,
                                          &kernel_arg_237711,
                                          &kernel_arg_237712,
                                          &kernel_arg_237713,
                                          &kernel_arg_237714,
                                          &kernel_arg_237715,
                                          &kernel_arg_237716,
                                          &kernel_arg_237717,
                                          &kernel_arg_237718,
                                          &kernel_arg_237719,
                                          &kernel_arg_237720};
                                    int64_t time_start_237709 = 0,
                                            time_end_237710 = 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_216262",
                                                (long) num_groups_216240,
                                                (long) 1, (long) 1,
                                                (long) segmap_group_sizze_216239,
                                                (long) 1, (long) 1, (int) 0);
                                        time_start_237709 = get_wall_time();
                                    }
                                    
                                    cudaEvent_t *pevents = NULL;
                                    
                                    if (ctx->profiling &&
                                        !ctx->profiling_paused) {
                                        pevents = cuda_get_events(&ctx->cuda,
                                                                  &ctx->mainzisegmap_216262_runs,
                                                                  &ctx->mainzisegmap_216262_total_runtime);
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                           0));
                                    }
                                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_216262,
                                                                          grid[0],
                                                                          grid[1],
                                                                          grid[2],
                                                                          segmap_group_sizze_216239,
                                                                          1, 1,
                                                                          0,
                                                                          NULL,
                                                                          kernel_args_237708,
                                                                          NULL));
                                    if (pevents != NULL)
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                           0));
                                    if (ctx->debugging) {
                                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                        time_end_237710 = get_wall_time();
                                        fprintf(ctx->log,
                                                "Kernel %s runtime: %ldus\n",
                                                "main.segmap_216262",
                                                time_end_237710 -
                                                time_start_237709);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_unref_device(ctx, &mem_230181,
                                                          "mem_230181") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230185,
                                                          "mem_230185") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230189,
                                                          "mem_230189") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230193,
                                                          "mem_230193") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230197,
                                                          "mem_230197") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232006,
                                                          "color_232006") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232007,
                                                          "color_232007") != 0)
                                    return 1;
                                
                                struct memblock_device mem_230393;
                                
                                mem_230393.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230393,
                                                          bytes_229297,
                                                          "mem_230393")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                          mem_230393,
                                                                          (int64_t) 0,
                                                                          mem_230232,
                                                                          (int64_t) 0,
                                                                          (int64_t) 1,
                                                                          partition_sizze_203577 *
                                                                          n_p_203492,
                                                                          s_n_m_203636) !=
                                    0) {
                                    if (memblock_unref_device(ctx, &mem_230393,
                                                              "mem_230393") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_232007,
                                                              "color_232007") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_232006,
                                                              "color_232006") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230236,
                                                              "mem_230236") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230232,
                                                              "mem_230232") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230197,
                                                              "mem_230197") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230193,
                                                              "mem_230193") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230189,
                                                              "mem_230189") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230185,
                                                              "mem_230185") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230181,
                                                              "mem_230181") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230401,
                                                              "ext_mem_230401") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230402,
                                                              "ext_mem_230402") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230415,
                                                              "ext_mem_230415") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230416,
                                                              "ext_mem_230416") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230417,
                                                              "ext_mem_230417") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230418,
                                                              "ext_mem_230418") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230419,
                                                              "ext_mem_230419") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230420,
                                                              "ext_mem_230420") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230486,
                                                              "ext_mem_230486") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230487,
                                                              "ext_mem_230487") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229515,
                                                              "mem_param_229515") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229507,
                                                              "mem_param_229507") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231517,
                                                              "ext_mem_231517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231518,
                                                              "ext_mem_231518") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229493,
                                                              "mem_param_229493") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229485,
                                                              "mem_param_229485") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229477,
                                                              "mem_param_229477") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231860,
                                                              "ext_mem_231860") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231861,
                                                              "ext_mem_231861") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231862,
                                                              "ext_mem_231862") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230551,
                                                              "mem_230551") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230534,
                                                              "mem_230534") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230517,
                                                              "mem_230517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230500,
                                                              "mem_230500") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229531,
                                                              "mem_229531") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229526,
                                                              "mem_229526") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229520,
                                                              "mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229469,
                                                              "mem_229469") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229465,
                                                              "mem_229465") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229460,
                                                              "ext_mem_229460") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229461,
                                                              "ext_mem_229461") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229411,
                                                              "ext_mem_229411") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229412,
                                                              "ext_mem_229412") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229362,
                                                              "ext_mem_229362") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229363,
                                                              "ext_mem_229363") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229264,
                                                              "ext_mem_229264") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229265,
                                                              "ext_mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229206,
                                                              "mem_229206") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229200,
                                                              "mem_229200") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229196,
                                                              "ext_mem_229196") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229197,
                                                              "ext_mem_229197") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229164,
                                                              "mem_229164") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229161,
                                                              "mem_229161") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229157,
                                                              "mem_229157") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229155,
                                                              "mem_229155") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229152,
                                                              "mem_229152") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229148,
                                                              "mem_229148") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232249,
                                                              "mem_out_232249") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232248,
                                                              "mem_out_232248") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232247,
                                                              "mem_out_232247") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                if (memblock_unref_device(ctx, &mem_230232,
                                                          "mem_230232") != 0)
                                    return 1;
                                
                                struct memblock_device mem_230399;
                                
                                mem_230399.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230399,
                                                          bytes_229297,
                                                          "mem_230399")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                          mem_230399,
                                                                          (int64_t) 0,
                                                                          mem_230236,
                                                                          (int64_t) 0,
                                                                          (int64_t) 1,
                                                                          partition_sizze_203577 *
                                                                          n_p_203492,
                                                                          s_n_m_203636) !=
                                    0) {
                                    if (memblock_unref_device(ctx, &mem_230399,
                                                              "mem_230399") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230393,
                                                              "mem_230393") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_232007,
                                                              "color_232007") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_232006,
                                                              "color_232006") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230236,
                                                              "mem_230236") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230232,
                                                              "mem_230232") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230197,
                                                              "mem_230197") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230193,
                                                              "mem_230193") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230189,
                                                              "mem_230189") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230185,
                                                              "mem_230185") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230181,
                                                              "mem_230181") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230401,
                                                              "ext_mem_230401") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230402,
                                                              "ext_mem_230402") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230415,
                                                              "ext_mem_230415") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230416,
                                                              "ext_mem_230416") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230417,
                                                              "ext_mem_230417") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230418,
                                                              "ext_mem_230418") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230419,
                                                              "ext_mem_230419") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230420,
                                                              "ext_mem_230420") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230486,
                                                              "ext_mem_230486") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230487,
                                                              "ext_mem_230487") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229515,
                                                              "mem_param_229515") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229507,
                                                              "mem_param_229507") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231517,
                                                              "ext_mem_231517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231518,
                                                              "ext_mem_231518") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229493,
                                                              "mem_param_229493") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229485,
                                                              "mem_param_229485") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229477,
                                                              "mem_param_229477") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231860,
                                                              "ext_mem_231860") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231861,
                                                              "ext_mem_231861") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231862,
                                                              "ext_mem_231862") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230551,
                                                              "mem_230551") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230534,
                                                              "mem_230534") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230517,
                                                              "mem_230517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230500,
                                                              "mem_230500") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229531,
                                                              "mem_229531") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229526,
                                                              "mem_229526") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229520,
                                                              "mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229469,
                                                              "mem_229469") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229465,
                                                              "mem_229465") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229460,
                                                              "ext_mem_229460") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229461,
                                                              "ext_mem_229461") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229411,
                                                              "ext_mem_229411") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229412,
                                                              "ext_mem_229412") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229362,
                                                              "ext_mem_229362") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229363,
                                                              "ext_mem_229363") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229264,
                                                              "ext_mem_229264") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229265,
                                                              "ext_mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229206,
                                                              "mem_229206") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229200,
                                                              "mem_229200") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229196,
                                                              "ext_mem_229196") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229197,
                                                              "ext_mem_229197") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229164,
                                                              "mem_229164") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229161,
                                                              "mem_229161") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229157,
                                                              "mem_229157") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229155,
                                                              "mem_229155") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229152,
                                                              "mem_229152") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229148,
                                                              "mem_229148") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232249,
                                                              "mem_out_232249") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232248,
                                                              "mem_out_232248") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232247,
                                                              "mem_out_232247") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                if (memblock_unref_device(ctx, &mem_230236,
                                                          "mem_230236") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_230402,
                                                        &mem_230393,
                                                        "mem_230393") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_230401,
                                                        &mem_230399,
                                                        "mem_230399") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230399,
                                                          "mem_230399") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230393,
                                                          "mem_230393") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232007,
                                                          "color_232007") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232006,
                                                          "color_232006") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230236,
                                                          "mem_230236") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230232,
                                                          "mem_230232") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230197,
                                                          "mem_230197") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230193,
                                                          "mem_230193") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230189,
                                                          "mem_230189") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230185,
                                                          "mem_230185") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230181,
                                                          "mem_230181") != 0)
                                    return 1;
                            } else {
                                struct memblock_device ext_mem_230388;
                                
                                ext_mem_230388.references = NULL;
                                
                                struct memblock_device ext_mem_230387;
                                
                                ext_mem_230387.references = NULL;
                                
                                int32_t local_memory_capacity_234110;
                                
                                local_memory_capacity_234110 =
                                    ctx->cuda.max_shared_memory;
                                if (sle64(bytes_229311 + srem64((int64_t) 8 -
                                                                srem64(bytes_229311,
                                                                       (int64_t) 8),
                                                                (int64_t) 8) +
                                          (bytes_229311 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229311,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229311 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229311,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229311 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229311,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229311 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229311,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229311 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229311,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229311 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229311,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229311 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229311,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229311 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229311,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229311 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229311,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229311 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229311,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_230242 + srem64((int64_t) 8 -
                                                                 srem64(bytes_230242,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          ((int64_t) 8 * (s_n_m_203636 *
                                                          q_s_203493) +
                                           srem64((int64_t) 8 -
                                                  srem64((int64_t) 8 *
                                                         (s_n_m_203636 *
                                                          q_s_203493),
                                                         (int64_t) 8),
                                                  (int64_t) 8)) + ((int64_t) 8 *
                                                                   (s_n_m_203636 *
                                                                    q_s_203493) +
                                                                   srem64((int64_t) 8 -
                                                                          srem64((int64_t) 8 *
                                                                                 (s_n_m_203636 *
                                                                                  q_s_203493),
                                                                                 (int64_t) 8),
                                                                          (int64_t) 8)) +
                                          ((int64_t) 8 * (s_n_m_203636 *
                                                          q_s_203493) +
                                           srem64((int64_t) 8 -
                                                  srem64((int64_t) 8 *
                                                         (s_n_m_203636 *
                                                          q_s_203493),
                                                         (int64_t) 8),
                                                  (int64_t) 8)) + ((int64_t) 8 *
                                                                   (s_n_m_203636 *
                                                                    q_s_203493) +
                                                                   srem64((int64_t) 8 -
                                                                          srem64((int64_t) 8 *
                                                                                 (s_n_m_203636 *
                                                                                  q_s_203493),
                                                                                 (int64_t) 8),
                                                                          (int64_t) 8)) +
                                          ((int64_t) 8 * (s_n_m_203636 *
                                                          q_s_203493) +
                                           srem64((int64_t) 8 -
                                                  srem64((int64_t) 8 *
                                                         (s_n_m_203636 *
                                                          q_s_203493),
                                                         (int64_t) 8),
                                                  (int64_t) 8)) + ((int64_t) 8 *
                                                                   (s_n_m_203636 *
                                                                    q_s_203493) +
                                                                   srem64((int64_t) 8 -
                                                                          srem64((int64_t) 8 *
                                                                                 (s_n_m_203636 *
                                                                                  q_s_203493),
                                                                                 (int64_t) 8),
                                                                          (int64_t) 8)) +
                                          ((int64_t) 8 * (s_n_m_203636 *
                                                          q_s_203493) +
                                           srem64((int64_t) 8 -
                                                  srem64((int64_t) 8 *
                                                         (s_n_m_203636 *
                                                          q_s_203493),
                                                         (int64_t) 8),
                                                  (int64_t) 8)),
                                          sext_i32_i64(local_memory_capacity_234110)) &&
                                    intra_suff_and_fits_216255) {
                                    struct memblock_device mem_230290;
                                    
                                    mem_230290.references = NULL;
                                    if (memblock_alloc_device(ctx, &mem_230290,
                                                              bytes_229297,
                                                              "mem_230290")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device mem_230295;
                                    
                                    mem_230295.references = NULL;
                                    if (memblock_alloc_device(ctx, &mem_230295,
                                                              bytes_229297,
                                                              "mem_230295")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                                    
                                    unsigned int shared_sizze_237724 =
                                                 (int64_t) 8 * (s_n_m_203636 *
                                                                q_s_203493);
                                    unsigned int shared_sizze_237726 =
                                                 (int64_t) 8 * (s_n_m_203636 *
                                                                q_s_203493);
                                    unsigned int shared_sizze_237728 =
                                                 (int64_t) 8 * (s_n_m_203636 *
                                                                q_s_203493);
                                    unsigned int shared_sizze_237730 =
                                                 (int64_t) 8 * (s_n_m_203636 *
                                                                q_s_203493);
                                    unsigned int shared_sizze_237732 =
                                                 (int64_t) 8 * (s_n_m_203636 *
                                                                q_s_203493);
                                    unsigned int shared_sizze_237734 =
                                                 (int64_t) 8 * (s_n_m_203636 *
                                                                q_s_203493);
                                    unsigned int shared_sizze_237736 =
                                                 (int64_t) 8 * (s_n_m_203636 *
                                                                q_s_203493);
                                    unsigned int shared_sizze_237738 =
                                                 bytes_230242;
                                    unsigned int shared_sizze_237740 =
                                                 bytes_229311;
                                    unsigned int shared_sizze_237742 =
                                                 bytes_229311;
                                    unsigned int shared_sizze_237744 =
                                                 bytes_229311;
                                    unsigned int shared_sizze_237746 =
                                                 bytes_229311;
                                    unsigned int shared_sizze_237748 =
                                                 bytes_229311;
                                    unsigned int shared_sizze_237750 =
                                                 bytes_229311;
                                    unsigned int shared_sizze_237752 =
                                                 bytes_229311;
                                    unsigned int shared_sizze_237754 =
                                                 bytes_229311;
                                    unsigned int shared_sizze_237756 =
                                                 bytes_229311;
                                    unsigned int shared_sizze_237758 =
                                                 bytes_229311;
                                    unsigned int shared_sizze_237760 =
                                                 bytes_229311;
                                    CUdeviceptr kernel_arg_237762 =
                                                ext_mem_229264.mem;
                                    CUdeviceptr kernel_arg_237763 =
                                                ext_mem_229265.mem;
                                    CUdeviceptr kernel_arg_237764 =
                                                ext_mem_229362.mem;
                                    CUdeviceptr kernel_arg_237765 =
                                                ext_mem_229363.mem;
                                    CUdeviceptr kernel_arg_237766 =
                                                mem_229526.mem;
                                    CUdeviceptr kernel_arg_237767 =
                                                mem_229531.mem;
                                    CUdeviceptr kernel_arg_237768 =
                                                mem_230290.mem;
                                    CUdeviceptr kernel_arg_237769 =
                                                mem_230295.mem;
                                    unsigned int shared_offset_237725 = 0;
                                    unsigned int shared_offset_237727 = 0 +
                                                 (shared_sizze_237724 + (8 -
                                                                         shared_sizze_237724 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_237729 = 0 +
                                                 (shared_sizze_237724 + (8 -
                                                                         shared_sizze_237724 %
                                                                         8) %
                                                  8) + (shared_sizze_237726 +
                                                        (8 -
                                                         shared_sizze_237726 %
                                                         8) % 8);
                                    unsigned int shared_offset_237731 = 0 +
                                                 (shared_sizze_237724 + (8 -
                                                                         shared_sizze_237724 %
                                                                         8) %
                                                  8) + (shared_sizze_237726 +
                                                        (8 -
                                                         shared_sizze_237726 %
                                                         8) % 8) +
                                                 (shared_sizze_237728 + (8 -
                                                                         shared_sizze_237728 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_237733 = 0 +
                                                 (shared_sizze_237724 + (8 -
                                                                         shared_sizze_237724 %
                                                                         8) %
                                                  8) + (shared_sizze_237726 +
                                                        (8 -
                                                         shared_sizze_237726 %
                                                         8) % 8) +
                                                 (shared_sizze_237728 + (8 -
                                                                         shared_sizze_237728 %
                                                                         8) %
                                                  8) + (shared_sizze_237730 +
                                                        (8 -
                                                         shared_sizze_237730 %
                                                         8) % 8);
                                    unsigned int shared_offset_237735 = 0 +
                                                 (shared_sizze_237724 + (8 -
                                                                         shared_sizze_237724 %
                                                                         8) %
                                                  8) + (shared_sizze_237726 +
                                                        (8 -
                                                         shared_sizze_237726 %
                                                         8) % 8) +
                                                 (shared_sizze_237728 + (8 -
                                                                         shared_sizze_237728 %
                                                                         8) %
                                                  8) + (shared_sizze_237730 +
                                                        (8 -
                                                         shared_sizze_237730 %
                                                         8) % 8) +
                                                 (shared_sizze_237732 + (8 -
                                                                         shared_sizze_237732 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_237737 = 0 +
                                                 (shared_sizze_237724 + (8 -
                                                                         shared_sizze_237724 %
                                                                         8) %
                                                  8) + (shared_sizze_237726 +
                                                        (8 -
                                                         shared_sizze_237726 %
                                                         8) % 8) +
                                                 (shared_sizze_237728 + (8 -
                                                                         shared_sizze_237728 %
                                                                         8) %
                                                  8) + (shared_sizze_237730 +
                                                        (8 -
                                                         shared_sizze_237730 %
                                                         8) % 8) +
                                                 (shared_sizze_237732 + (8 -
                                                                         shared_sizze_237732 %
                                                                         8) %
                                                  8) + (shared_sizze_237734 +
                                                        (8 -
                                                         shared_sizze_237734 %
                                                         8) % 8);
                                    unsigned int shared_offset_237739 = 0 +
                                                 (shared_sizze_237724 + (8 -
                                                                         shared_sizze_237724 %
                                                                         8) %
                                                  8) + (shared_sizze_237726 +
                                                        (8 -
                                                         shared_sizze_237726 %
                                                         8) % 8) +
                                                 (shared_sizze_237728 + (8 -
                                                                         shared_sizze_237728 %
                                                                         8) %
                                                  8) + (shared_sizze_237730 +
                                                        (8 -
                                                         shared_sizze_237730 %
                                                         8) % 8) +
                                                 (shared_sizze_237732 + (8 -
                                                                         shared_sizze_237732 %
                                                                         8) %
                                                  8) + (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_237724 + (8 -
                                                                         shared_sizze_237724 %
                                                                         8) %
                                                  8) + (shared_sizze_237726 +
                                                        (8 -
                                                         shared_sizze_237726 %
                                                         8) % 8) +
                                                 (shared_sizze_237728 + (8 -
                                                                         shared_sizze_237728 %
                                                                         8) %
                                                  8) + (shared_sizze_237730 +
                                                        (8 -
                                                         shared_sizze_237730 %
                                                         8) % 8) +
                                                 (shared_sizze_237732 + (8 -
                                                                         shared_sizze_237732 %
                                                                         8) %
                                                  8) + (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);
                                    unsigned int shared_offset_237743 = 0 +
                                                 (shared_sizze_237724 + (8 -
                                                                         shared_sizze_237724 %
                                                                         8) %
                                                  8) + (shared_sizze_237726 +
                                                        (8 -
                                                         shared_sizze_237726 %
                                                         8) % 8) +
                                                 (shared_sizze_237728 + (8 -
                                                                         shared_sizze_237728 %
                                                                         8) %
                                                  8) + (shared_sizze_237730 +
                                                        (8 -
                                                         shared_sizze_237730 %
                                                         8) % 8) +
                                                 (shared_sizze_237732 + (8 -
                                                                         shared_sizze_237732 %
                                                                         8) %
                                                  8) + (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);
                                    unsigned int shared_offset_237745 = 0 +
                                                 (shared_sizze_237724 + (8 -
                                                                         shared_sizze_237724 %
                                                                         8) %
                                                  8) + (shared_sizze_237726 +
                                                        (8 -
                                                         shared_sizze_237726 %
                                                         8) % 8) +
                                                 (shared_sizze_237728 + (8 -
                                                                         shared_sizze_237728 %
                                                                         8) %
                                                  8) + (shared_sizze_237730 +
                                                        (8 -
                                                         shared_sizze_237730 %
                                                         8) % 8) +
                                                 (shared_sizze_237732 + (8 -
                                                                         shared_sizze_237732 %
                                                                         8) %
                                                  8) + (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) + (shared_sizze_237742 +
                                                        (8 -
                                                         shared_sizze_237742 %
                                                         8) % 8);
                                    unsigned int shared_offset_237747 = 0 +
                                                 (shared_sizze_237724 + (8 -
                                                                         shared_sizze_237724 %
                                                                         8) %
                                                  8) + (shared_sizze_237726 +
                                                        (8 -
                                                         shared_sizze_237726 %
                                                         8) % 8) +
                                                 (shared_sizze_237728 + (8 -
                                                                         shared_sizze_237728 %
                                                                         8) %
                                                  8) + (shared_sizze_237730 +
                                                        (8 -
                                                         shared_sizze_237730 %
                                                         8) % 8) +
                                                 (shared_sizze_237732 + (8 -
                                                                         shared_sizze_237732 %
                                                                         8) %
                                                  8) + (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) + (shared_sizze_237742 +
                                                        (8 -
                                                         shared_sizze_237742 %
                                                         8) % 8) +
                                                 (shared_sizze_237744 + (8 -
                                                                         shared_sizze_237744 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_237749 = 0 +
                                                 (shared_sizze_237724 + (8 -
                                                                         shared_sizze_237724 %
                                                                         8) %
                                                  8) + (shared_sizze_237726 +
                                                        (8 -
                                                         shared_sizze_237726 %
                                                         8) % 8) +
                                                 (shared_sizze_237728 + (8 -
                                                                         shared_sizze_237728 %
                                                                         8) %
                                                  8) + (shared_sizze_237730 +
                                                        (8 -
                                                         shared_sizze_237730 %
                                                         8) % 8) +
                                                 (shared_sizze_237732 + (8 -
                                                                         shared_sizze_237732 %
                                                                         8) %
                                                  8) + (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) + (shared_sizze_237742 +
                                                        (8 -
                                                         shared_sizze_237742 %
                                                         8) % 8) +
                                                 (shared_sizze_237744 + (8 -
                                                                         shared_sizze_237744 %
                                                                         8) %
                                                  8) + (shared_sizze_237746 +
                                                        (8 -
                                                         shared_sizze_237746 %
                                                         8) % 8);
                                    unsigned int shared_offset_237751 = 0 +
                                                 (shared_sizze_237724 + (8 -
                                                                         shared_sizze_237724 %
                                                                         8) %
                                                  8) + (shared_sizze_237726 +
                                                        (8 -
                                                         shared_sizze_237726 %
                                                         8) % 8) +
                                                 (shared_sizze_237728 + (8 -
                                                                         shared_sizze_237728 %
                                                                         8) %
                                                  8) + (shared_sizze_237730 +
                                                        (8 -
                                                         shared_sizze_237730 %
                                                         8) % 8) +
                                                 (shared_sizze_237732 + (8 -
                                                                         shared_sizze_237732 %
                                                                         8) %
                                                  8) + (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) + (shared_sizze_237742 +
                                                        (8 -
                                                         shared_sizze_237742 %
                                                         8) % 8) +
                                                 (shared_sizze_237744 + (8 -
                                                                         shared_sizze_237744 %
                                                                         8) %
                                                  8) + (shared_sizze_237746 +
                                                        (8 -
                                                         shared_sizze_237746 %
                                                         8) % 8) +
                                                 (shared_sizze_237748 + (8 -
                                                                         shared_sizze_237748 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_237753 = 0 +
                                                 (shared_sizze_237724 + (8 -
                                                                         shared_sizze_237724 %
                                                                         8) %
                                                  8) + (shared_sizze_237726 +
                                                        (8 -
                                                         shared_sizze_237726 %
                                                         8) % 8) +
                                                 (shared_sizze_237728 + (8 -
                                                                         shared_sizze_237728 %
                                                                         8) %
                                                  8) + (shared_sizze_237730 +
                                                        (8 -
                                                         shared_sizze_237730 %
                                                         8) % 8) +
                                                 (shared_sizze_237732 + (8 -
                                                                         shared_sizze_237732 %
                                                                         8) %
                                                  8) + (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) + (shared_sizze_237742 +
                                                        (8 -
                                                         shared_sizze_237742 %
                                                         8) % 8) +
                                                 (shared_sizze_237744 + (8 -
                                                                         shared_sizze_237744 %
                                                                         8) %
                                                  8) + (shared_sizze_237746 +
                                                        (8 -
                                                         shared_sizze_237746 %
                                                         8) % 8) +
                                                 (shared_sizze_237748 + (8 -
                                                                         shared_sizze_237748 %
                                                                         8) %
                                                  8) + (shared_sizze_237750 +
                                                        (8 -
                                                         shared_sizze_237750 %
                                                         8) % 8);
                                    unsigned int shared_offset_237755 = 0 +
                                                 (shared_sizze_237724 + (8 -
                                                                         shared_sizze_237724 %
                                                                         8) %
                                                  8) + (shared_sizze_237726 +
                                                        (8 -
                                                         shared_sizze_237726 %
                                                         8) % 8) +
                                                 (shared_sizze_237728 + (8 -
                                                                         shared_sizze_237728 %
                                                                         8) %
                                                  8) + (shared_sizze_237730 +
                                                        (8 -
                                                         shared_sizze_237730 %
                                                         8) % 8) +
                                                 (shared_sizze_237732 + (8 -
                                                                         shared_sizze_237732 %
                                                                         8) %
                                                  8) + (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) + (shared_sizze_237742 +
                                                        (8 -
                                                         shared_sizze_237742 %
                                                         8) % 8) +
                                                 (shared_sizze_237744 + (8 -
                                                                         shared_sizze_237744 %
                                                                         8) %
                                                  8) + (shared_sizze_237746 +
                                                        (8 -
                                                         shared_sizze_237746 %
                                                         8) % 8) +
                                                 (shared_sizze_237748 + (8 -
                                                                         shared_sizze_237748 %
                                                                         8) %
                                                  8) + (shared_sizze_237750 +
                                                        (8 -
                                                         shared_sizze_237750 %
                                                         8) % 8) +
                                                 (shared_sizze_237752 + (8 -
                                                                         shared_sizze_237752 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_237757 = 0 +
                                                 (shared_sizze_237724 + (8 -
                                                                         shared_sizze_237724 %
                                                                         8) %
                                                  8) + (shared_sizze_237726 +
                                                        (8 -
                                                         shared_sizze_237726 %
                                                         8) % 8) +
                                                 (shared_sizze_237728 + (8 -
                                                                         shared_sizze_237728 %
                                                                         8) %
                                                  8) + (shared_sizze_237730 +
                                                        (8 -
                                                         shared_sizze_237730 %
                                                         8) % 8) +
                                                 (shared_sizze_237732 + (8 -
                                                                         shared_sizze_237732 %
                                                                         8) %
                                                  8) + (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) + (shared_sizze_237742 +
                                                        (8 -
                                                         shared_sizze_237742 %
                                                         8) % 8) +
                                                 (shared_sizze_237744 + (8 -
                                                                         shared_sizze_237744 %
                                                                         8) %
                                                  8) + (shared_sizze_237746 +
                                                        (8 -
                                                         shared_sizze_237746 %
                                                         8) % 8) +
                                                 (shared_sizze_237748 + (8 -
                                                                         shared_sizze_237748 %
                                                                         8) %
                                                  8) + (shared_sizze_237750 +
                                                        (8 -
                                                         shared_sizze_237750 %
                                                         8) % 8) +
                                                 (shared_sizze_237752 + (8 -
                                                                         shared_sizze_237752 %
                                                                         8) %
                                                  8) + (shared_sizze_237754 +
                                                        (8 -
                                                         shared_sizze_237754 %
                                                         8) % 8);
                                    unsigned int shared_offset_237759 = 0 +
                                                 (shared_sizze_237724 + (8 -
                                                                         shared_sizze_237724 %
                                                                         8) %
                                                  8) + (shared_sizze_237726 +
                                                        (8 -
                                                         shared_sizze_237726 %
                                                         8) % 8) +
                                                 (shared_sizze_237728 + (8 -
                                                                         shared_sizze_237728 %
                                                                         8) %
                                                  8) + (shared_sizze_237730 +
                                                        (8 -
                                                         shared_sizze_237730 %
                                                         8) % 8) +
                                                 (shared_sizze_237732 + (8 -
                                                                         shared_sizze_237732 %
                                                                         8) %
                                                  8) + (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) + (shared_sizze_237742 +
                                                        (8 -
                                                         shared_sizze_237742 %
                                                         8) % 8) +
                                                 (shared_sizze_237744 + (8 -
                                                                         shared_sizze_237744 %
                                                                         8) %
                                                  8) + (shared_sizze_237746 +
                                                        (8 -
                                                         shared_sizze_237746 %
                                                         8) % 8) +
                                                 (shared_sizze_237748 + (8 -
                                                                         shared_sizze_237748 %
                                                                         8) %
                                                  8) + (shared_sizze_237750 +
                                                        (8 -
                                                         shared_sizze_237750 %
                                                         8) % 8) +
                                                 (shared_sizze_237752 + (8 -
                                                                         shared_sizze_237752 %
                                                                         8) %
                                                  8) + (shared_sizze_237754 +
                                                        (8 -
                                                         shared_sizze_237754 %
                                                         8) % 8) +
                                                 (shared_sizze_237756 + (8 -
                                                                         shared_sizze_237756 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_237761 = 0 +
                                                 (shared_sizze_237724 + (8 -
                                                                         shared_sizze_237724 %
                                                                         8) %
                                                  8) + (shared_sizze_237726 +
                                                        (8 -
                                                         shared_sizze_237726 %
                                                         8) % 8) +
                                                 (shared_sizze_237728 + (8 -
                                                                         shared_sizze_237728 %
                                                                         8) %
                                                  8) + (shared_sizze_237730 +
                                                        (8 -
                                                         shared_sizze_237730 %
                                                         8) % 8) +
                                                 (shared_sizze_237732 + (8 -
                                                                         shared_sizze_237732 %
                                                                         8) %
                                                  8) + (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) + (shared_sizze_237742 +
                                                        (8 -
                                                         shared_sizze_237742 %
                                                         8) % 8) +
                                                 (shared_sizze_237744 + (8 -
                                                                         shared_sizze_237744 %
                                                                         8) %
                                                  8) + (shared_sizze_237746 +
                                                        (8 -
                                                         shared_sizze_237746 %
                                                         8) % 8) +
                                                 (shared_sizze_237748 + (8 -
                                                                         shared_sizze_237748 %
                                                                         8) %
                                                  8) + (shared_sizze_237750 +
                                                        (8 -
                                                         shared_sizze_237750 %
                                                         8) % 8) +
                                                 (shared_sizze_237752 + (8 -
                                                                         shared_sizze_237752 %
                                                                         8) %
                                                  8) + (shared_sizze_237754 +
                                                        (8 -
                                                         shared_sizze_237754 %
                                                         8) % 8) +
                                                 (shared_sizze_237756 + (8 -
                                                                         shared_sizze_237756 %
                                                                         8) %
                                                  8) + (shared_sizze_237758 +
                                                        (8 -
                                                         shared_sizze_237758 %
                                                         8) % 8);
                                    
                                    if ((((((1 && binop_x_229202 != 0) && 1 !=
                                            0) && 1 != 0) &&
                                          computed_group_sizze_216248 != 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_229202;
                                        grid[perm[1]] = 1;
                                        grid[perm[2]] = 1;
                                        
                                        void *kernel_args_237721[] =
                                             {&ctx->global_failure,
                                              &shared_offset_237725,
                                              &shared_offset_237727,
                                              &shared_offset_237729,
                                              &shared_offset_237731,
                                              &shared_offset_237733,
                                              &shared_offset_237735,
                                              &shared_offset_237737,
                                              &shared_offset_237739,
                                              &shared_offset_237741,
                                              &shared_offset_237743,
                                              &shared_offset_237745,
                                              &shared_offset_237747,
                                              &shared_offset_237749,
                                              &shared_offset_237751,
                                              &shared_offset_237753,
                                              &shared_offset_237755,
                                              &shared_offset_237757,
                                              &shared_offset_237759,
                                              &shared_offset_237761,
                                              &n_p_203492, &q_s_203493,
                                              &jump_s_203499,
                                              &partition_sizze_203577,
                                              &defunc_0_f_res_203631,
                                              &pad_css_len_203632,
                                              &s_n_m_203636,
                                              &computed_group_sizze_216248,
                                              &kernel_arg_237762,
                                              &kernel_arg_237763,
                                              &kernel_arg_237764,
                                              &kernel_arg_237765,
                                              &kernel_arg_237766,
                                              &kernel_arg_237767,
                                              &kernel_arg_237768,
                                              &kernel_arg_237769};
                                        int64_t time_start_237722 = 0,
                                                time_end_237723 = 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_216411",
                                                    (long) binop_x_229202,
                                                    (long) 1, (long) 1,
                                                    (long) computed_group_sizze_216248,
                                                    (long) 1, (long) 1,
                                                    (int) (0 +
                                                           (shared_sizze_237724 +
                                                            (8 -
                                                             shared_sizze_237724 %
                                                             8) % 8) +
                                                           (shared_sizze_237726 +
                                                            (8 -
                                                             shared_sizze_237726 %
                                                             8) % 8) +
                                                           (shared_sizze_237728 +
                                                            (8 -
                                                             shared_sizze_237728 %
                                                             8) % 8) +
                                                           (shared_sizze_237730 +
                                                            (8 -
                                                             shared_sizze_237730 %
                                                             8) % 8) +
                                                           (shared_sizze_237732 +
                                                            (8 -
                                                             shared_sizze_237732 %
                                                             8) % 8) +
                                                           (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) +
                                                           (shared_sizze_237742 +
                                                            (8 -
                                                             shared_sizze_237742 %
                                                             8) % 8) +
                                                           (shared_sizze_237744 +
                                                            (8 -
                                                             shared_sizze_237744 %
                                                             8) % 8) +
                                                           (shared_sizze_237746 +
                                                            (8 -
                                                             shared_sizze_237746 %
                                                             8) % 8) +
                                                           (shared_sizze_237748 +
                                                            (8 -
                                                             shared_sizze_237748 %
                                                             8) % 8) +
                                                           (shared_sizze_237750 +
                                                            (8 -
                                                             shared_sizze_237750 %
                                                             8) % 8) +
                                                           (shared_sizze_237752 +
                                                            (8 -
                                                             shared_sizze_237752 %
                                                             8) % 8) +
                                                           (shared_sizze_237754 +
                                                            (8 -
                                                             shared_sizze_237754 %
                                                             8) % 8) +
                                                           (shared_sizze_237756 +
                                                            (8 -
                                                             shared_sizze_237756 %
                                                             8) % 8) +
                                                           (shared_sizze_237758 +
                                                            (8 -
                                                             shared_sizze_237758 %
                                                             8) % 8) +
                                                           (shared_sizze_237760 +
                                                            (8 -
                                                             shared_sizze_237760 %
                                                             8) % 8)));
                                            time_start_237722 = get_wall_time();
                                        }
                                        
                                        cudaEvent_t *pevents = NULL;
                                        
                                        if (ctx->profiling &&
                                            !ctx->profiling_paused) {
                                            pevents =
                                                cuda_get_events(&ctx->cuda,
                                                                &ctx->mainzisegmap_intragroup_216411_runs,
                                                                &ctx->mainzisegmap_intragroup_216411_total_runtime);
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                               0));
                                        }
                                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_intragroup_216411,
                                                                              grid[0],
                                                                              grid[1],
                                                                              grid[2],
                                                                              computed_group_sizze_216248,
                                                                              1,
                                                                              1,
                                                                              0 +
                                                                              (shared_sizze_237724 +
                                                                               (8 -
                                                                                shared_sizze_237724 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_237726 +
                                                                               (8 -
                                                                                shared_sizze_237726 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_237728 +
                                                                               (8 -
                                                                                shared_sizze_237728 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_237730 +
                                                                               (8 -
                                                                                shared_sizze_237730 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_237732 +
                                                                               (8 -
                                                                                shared_sizze_237732 %
                                                                                8) %
                                                                               8) +
                                                                              (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) +
                                                                              (shared_sizze_237742 +
                                                                               (8 -
                                                                                shared_sizze_237742 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_237744 +
                                                                               (8 -
                                                                                shared_sizze_237744 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_237746 +
                                                                               (8 -
                                                                                shared_sizze_237746 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_237748 +
                                                                               (8 -
                                                                                shared_sizze_237748 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_237750 +
                                                                               (8 -
                                                                                shared_sizze_237750 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_237752 +
                                                                               (8 -
                                                                                shared_sizze_237752 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_237754 +
                                                                               (8 -
                                                                                shared_sizze_237754 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_237756 +
                                                                               (8 -
                                                                                shared_sizze_237756 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_237758 +
                                                                               (8 -
                                                                                shared_sizze_237758 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_237760 +
                                                                               (8 -
                                                                                shared_sizze_237760 %
                                                                                8) %
                                                                               8),
                                                                              NULL,
                                                                              kernel_args_237721,
                                                                              NULL));
                                        if (pevents != NULL)
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                               0));
                                        if (ctx->debugging) {
                                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                            time_end_237723 = get_wall_time();
                                            fprintf(ctx->log,
                                                    "Kernel %s runtime: %ldus\n",
                                                    "main.segmap_intragroup_216411",
                                                    time_end_237723 -
                                                    time_start_237722);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_set_device(ctx,
                                                            &ext_mem_230388,
                                                            &mem_230290,
                                                            "mem_230290") != 0)
                                        return 1;
                                    if (memblock_set_device(ctx,
                                                            &ext_mem_230387,
                                                            &mem_230295,
                                                            "mem_230295") != 0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230295,
                                                              "mem_230295") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230290,
                                                              "mem_230290") !=
                                        0)
                                        return 1;
                                } else {
                                    int64_t segmap_usable_groups_216595 =
                                            sdiv_up64(nest_sizze_208848,
                                                      segmap_group_sizze_216594);
                                    struct memblock_device ext_mem_230386;
                                    
                                    ext_mem_230386.references = NULL;
                                    
                                    struct memblock_device ext_mem_230385;
                                    
                                    ext_mem_230385.references = NULL;
                                    
                                    int32_t local_memory_capacity_234109;
                                    
                                    local_memory_capacity_234109 =
                                        ctx->cuda.max_shared_memory;
                                    if (sle64((int64_t) 0,
                                              sext_i32_i64(local_memory_capacity_234109)) &&
                                        suff_outer_par_216599) {
                                        struct memblock_device mem_230301;
                                        
                                        mem_230301.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230301,
                                                                  bytes_229297,
                                                                  "mem_230301")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230306;
                                        
                                        mem_230306.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230306,
                                                                  bytes_229297,
                                                                  "mem_230306")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n",
                                                    "\n# SegMap");
                                        
                                        CUdeviceptr kernel_arg_237773 =
                                                    ext_mem_229264.mem;
                                        CUdeviceptr kernel_arg_237774 =
                                                    ext_mem_229265.mem;
                                        CUdeviceptr kernel_arg_237775 =
                                                    ext_mem_229362.mem;
                                        CUdeviceptr kernel_arg_237776 =
                                                    ext_mem_229363.mem;
                                        CUdeviceptr kernel_arg_237777 =
                                                    mem_229526.mem;
                                        CUdeviceptr kernel_arg_237778 =
                                                    mem_229531.mem;
                                        CUdeviceptr kernel_arg_237779 =
                                                    mem_230301.mem;
                                        CUdeviceptr kernel_arg_237780 =
                                                    mem_230306.mem;
                                        
                                        if ((((((1 &&
                                                 segmap_usable_groups_216595 !=
                                                 0) && 1 != 0) && 1 != 0) &&
                                              segmap_group_sizze_216594 != 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_216595;
                                            grid[perm[1]] = 1;
                                            grid[perm[2]] = 1;
                                            
                                            void *kernel_args_237770[] =
                                                 {&ctx->global_failure,
                                                  &n_p_203492, &q_s_203493,
                                                  &jump_s_203499,
                                                  &partition_sizze_203577,
                                                  &defunc_0_f_res_203631,
                                                  &pad_css_len_203632,
                                                  &s_n_m_203636,
                                                  &kernel_arg_237773,
                                                  &kernel_arg_237774,
                                                  &kernel_arg_237775,
                                                  &kernel_arg_237776,
                                                  &kernel_arg_237777,
                                                  &kernel_arg_237778,
                                                  &kernel_arg_237779,
                                                  &kernel_arg_237780};
                                            int64_t time_start_237771 = 0,
                                                    time_end_237772 = 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_216607",
                                                        (long) segmap_usable_groups_216595,
                                                        (long) 1, (long) 1,
                                                        (long) segmap_group_sizze_216594,
                                                        (long) 1, (long) 1,
                                                        (int) 0);
                                                time_start_237771 =
                                                    get_wall_time();
                                            }
                                            
                                            cudaEvent_t *pevents = NULL;
                                            
                                            if (ctx->profiling &&
                                                !ctx->profiling_paused) {
                                                pevents =
                                                    cuda_get_events(&ctx->cuda,
                                                                    &ctx->mainzisegmap_216607_runs,
                                                                    &ctx->mainzisegmap_216607_total_runtime);
                                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                                   0));
                                            }
                                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_216607,
                                                                                  grid[0],
                                                                                  grid[1],
                                                                                  grid[2],
                                                                                  segmap_group_sizze_216594,
                                                                                  1,
                                                                                  1,
                                                                                  0,
                                                                                  NULL,
                                                                                  kernel_args_237770,
                                                                                  NULL));
                                            if (pevents != NULL)
                                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                                   0));
                                            if (ctx->debugging) {
                                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                                time_end_237772 =
                                                    get_wall_time();
                                                fprintf(ctx->log,
                                                        "Kernel %s runtime: %ldus\n",
                                                        "main.segmap_216607",
                                                        time_end_237772 -
                                                        time_start_237771);
                                            }
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n", "");
                                        if (memblock_set_device(ctx,
                                                                &ext_mem_230386,
                                                                &mem_230301,
                                                                "mem_230301") !=
                                            0)
                                            return 1;
                                        if (memblock_set_device(ctx,
                                                                &ext_mem_230385,
                                                                &mem_230306,
                                                                "mem_230306") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230306,
                                                                  "mem_230306") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230301,
                                                                  "mem_230301") !=
                                            0)
                                            return 1;
                                    } else {
                                        int64_t segmap_usable_groups_216750 =
                                                sdiv_up64(nest_sizze_208848,
                                                          segmap_group_sizze_216749);
                                        struct memblock_device mem_230312;
                                        
                                        mem_230312.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230312,
                                                                  bytes_229297,
                                                                  "mem_230312")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230316;
                                        
                                        mem_230316.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230316,
                                                                  bytes_230315,
                                                                  "mem_230316")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n",
                                                    "\n# SegMap");
                                        
                                        CUdeviceptr kernel_arg_237784 =
                                                    mem_230312.mem;
                                        CUdeviceptr kernel_arg_237785 =
                                                    mem_230316.mem;
                                        
                                        if ((((((1 &&
                                                 segmap_usable_groups_216750 !=
                                                 0) && 1 != 0) && 1 != 0) &&
                                              segmap_group_sizze_216749 != 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_216750;
                                            grid[perm[1]] = 1;
                                            grid[perm[2]] = 1;
                                            
                                            void *kernel_args_237781[] =
                                                 {&ctx->global_failure,
                                                  &n_p_203492, &jump_s_203499,
                                                  &partition_sizze_203577,
                                                  &defunc_0_f_res_203631,
                                                  &pad_css_len_203632,
                                                  &s_n_m_203636,
                                                  &kernel_arg_237784,
                                                  &kernel_arg_237785};
                                            int64_t time_start_237782 = 0,
                                                    time_end_237783 = 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_216756",
                                                        (long) segmap_usable_groups_216750,
                                                        (long) 1, (long) 1,
                                                        (long) segmap_group_sizze_216749,
                                                        (long) 1, (long) 1,
                                                        (int) 0);
                                                time_start_237782 =
                                                    get_wall_time();
                                            }
                                            
                                            cudaEvent_t *pevents = NULL;
                                            
                                            if (ctx->profiling &&
                                                !ctx->profiling_paused) {
                                                pevents =
                                                    cuda_get_events(&ctx->cuda,
                                                                    &ctx->mainzisegmap_216756_runs,
                                                                    &ctx->mainzisegmap_216756_total_runtime);
                                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                                   0));
                                            }
                                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_216756,
                                                                                  grid[0],
                                                                                  grid[1],
                                                                                  grid[2],
                                                                                  segmap_group_sizze_216749,
                                                                                  1,
                                                                                  1,
                                                                                  0,
                                                                                  NULL,
                                                                                  kernel_args_237781,
                                                                                  NULL));
                                            if (pevents != NULL)
                                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                                   0));
                                            if (ctx->debugging) {
                                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                                time_end_237783 =
                                                    get_wall_time();
                                                fprintf(ctx->log,
                                                        "Kernel %s runtime: %ldus\n",
                                                        "main.segmap_216756",
                                                        time_end_237783 -
                                                        time_start_237782);
                                            }
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n", "");
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230316,
                                                                  "mem_230316") !=
                                            0)
                                            return 1;
                                        
                                        struct memblock_device mem_230322;
                                        
                                        mem_230322.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230322,
                                                                  bytes_229297,
                                                                  "mem_230322")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230327;
                                        
                                        mem_230327.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230327,
                                                                  bytes_229297,
                                                                  "mem_230327")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230332;
                                        
                                        mem_230332.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230332,
                                                                  bytes_229297,
                                                                  "mem_230332")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230337;
                                        
                                        mem_230337.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230337,
                                                                  bytes_229297,
                                                                  "mem_230337")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230342;
                                        
                                        mem_230342.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230342,
                                                                  bytes_229297,
                                                                  "mem_230342")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        if (slt64(q_s_203493 * (int64_t) 2,
                                                  segred_group_sizze_216772)) {
                                            int64_t
                                            segment_sizze_nonzzero_233875 =
                                            smax64((int64_t) 1, q_s_203493);
                                            int64_t num_threads_233876 =
                                                    num_groups_216773 *
                                                    segred_group_sizze_216772;
                                            
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s\n",
                                                        "\n# SegRed-small");
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "num_segments",
                                                        (long long) (partition_sizze_203577 *
                                                                     n_p_203492 *
                                                                     s_n_m_203636),
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "segment_size",
                                                        (long long) q_s_203493,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "segments_per_group",
                                                        (long long) squot64(segred_group_sizze_216772,
                                                                            segment_sizze_nonzzero_233875),
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "required_groups",
                                                        (long long) sext_i64_i32(sdiv_up64(partition_sizze_203577 *
                                                                                           n_p_203492 *
                                                                                           s_n_m_203636,
                                                                                           squot64(segred_group_sizze_216772,
                                                                                                   segment_sizze_nonzzero_233875))),
                                                        '\n');
                                            
                                            unsigned int shared_sizze_237789 =
                                                         (int64_t) 8 *
                                                         segred_group_sizze_216772;
                                            unsigned int shared_sizze_237791 =
                                                         (int64_t) 8 *
                                                         segred_group_sizze_216772;
                                            unsigned int shared_sizze_237793 =
                                                         (int64_t) 8 *
                                                         segred_group_sizze_216772;
                                            unsigned int shared_sizze_237795 =
                                                         (int64_t) 8 *
                                                         segred_group_sizze_216772;
                                            unsigned int shared_sizze_237797 =
                                                         (int64_t) 8 *
                                                         segred_group_sizze_216772;
                                            CUdeviceptr kernel_arg_237799 =
                                                        ext_mem_229264.mem;
                                            CUdeviceptr kernel_arg_237800 =
                                                        ext_mem_229265.mem;
                                            CUdeviceptr kernel_arg_237801 =
                                                        ext_mem_229362.mem;
                                            CUdeviceptr kernel_arg_237802 =
                                                        ext_mem_229363.mem;
                                            CUdeviceptr kernel_arg_237803 =
                                                        mem_229531.mem;
                                            CUdeviceptr kernel_arg_237804 =
                                                        mem_230312.mem;
                                            CUdeviceptr kernel_arg_237805 =
                                                        mem_230322.mem;
                                            CUdeviceptr kernel_arg_237806 =
                                                        mem_230327.mem;
                                            CUdeviceptr kernel_arg_237807 =
                                                        mem_230332.mem;
                                            CUdeviceptr kernel_arg_237808 =
                                                        mem_230337.mem;
                                            CUdeviceptr kernel_arg_237809 =
                                                        mem_230342.mem;
                                            unsigned int shared_offset_237790 =
                                                         0;
                                            unsigned int shared_offset_237792 =
                                                         0 +
                                                         (shared_sizze_237789 +
                                                          (8 -
                                                           shared_sizze_237789 %
                                                           8) % 8);
                                            unsigned int shared_offset_237794 =
                                                         0 +
                                                         (shared_sizze_237789 +
                                                          (8 -
                                                           shared_sizze_237789 %
                                                           8) % 8) +
                                                         (shared_sizze_237791 +
                                                          (8 -
                                                           shared_sizze_237791 %
                                                           8) % 8);
                                            unsigned int shared_offset_237796 =
                                                         0 +
                                                         (shared_sizze_237789 +
                                                          (8 -
                                                           shared_sizze_237789 %
                                                           8) % 8) +
                                                         (shared_sizze_237791 +
                                                          (8 -
                                                           shared_sizze_237791 %
                                                           8) % 8) +
                                                         (shared_sizze_237793 +
                                                          (8 -
                                                           shared_sizze_237793 %
                                                           8) % 8);
                                            unsigned int shared_offset_237798 =
                                                         0 +
                                                         (shared_sizze_237789 +
                                                          (8 -
                                                           shared_sizze_237789 %
                                                           8) % 8) +
                                                         (shared_sizze_237791 +
                                                          (8 -
                                                           shared_sizze_237791 %
                                                           8) % 8) +
                                                         (shared_sizze_237793 +
                                                          (8 -
                                                           shared_sizze_237793 %
                                                           8) % 8) +
                                                         (shared_sizze_237795 +
                                                          (8 -
                                                           shared_sizze_237795 %
                                                           8) % 8);
                                            
                                            if ((((((1 && num_groups_216773 !=
                                                     0) && 1 != 0) && 1 != 0) &&
                                                  segred_group_sizze_216772 !=
                                                  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_216773;
                                                grid[perm[1]] = 1;
                                                grid[perm[2]] = 1;
                                                
                                                void *kernel_args_237786[] =
                                                     {&ctx->global_failure,
                                                      &shared_offset_237790,
                                                      &shared_offset_237792,
                                                      &shared_offset_237794,
                                                      &shared_offset_237796,
                                                      &shared_offset_237798,
                                                      &n_p_203492, &q_s_203493,
                                                      &partition_sizze_203577,
                                                      &defunc_0_f_res_203631,
                                                      &s_n_m_203636,
                                                      &num_groups_216773,
                                                      &segment_sizze_nonzzero_233875,
                                                      &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,
                                                      &kernel_arg_237809};
                                                int64_t time_start_237787 = 0,
                                                        time_end_237788 = 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_216784",
                                                            (long) num_groups_216773,
                                                            (long) 1, (long) 1,
                                                            (long) segred_group_sizze_216772,
                                                            (long) 1, (long) 1,
                                                            (int) (0 +
                                                                   (shared_sizze_237789 +
                                                                    (8 -
                                                                     shared_sizze_237789 %
                                                                     8) % 8) +
                                                                   (shared_sizze_237791 +
                                                                    (8 -
                                                                     shared_sizze_237791 %
                                                                     8) % 8) +
                                                                   (shared_sizze_237793 +
                                                                    (8 -
                                                                     shared_sizze_237793 %
                                                                     8) % 8) +
                                                                   (shared_sizze_237795 +
                                                                    (8 -
                                                                     shared_sizze_237795 %
                                                                     8) % 8) +
                                                                   (shared_sizze_237797 +
                                                                    (8 -
                                                                     shared_sizze_237797 %
                                                                     8) % 8)));
                                                    time_start_237787 =
                                                        get_wall_time();
                                                }
                                                
                                                cudaEvent_t *pevents = NULL;
                                                
                                                if (ctx->profiling &&
                                                    !ctx->profiling_paused) {
                                                    pevents =
                                                        cuda_get_events(&ctx->cuda,
                                                                        &ctx->mainzisegred_small_216784_runs,
                                                                        &ctx->mainzisegred_small_216784_total_runtime);
                                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                                       0));
                                                }
                                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_small_216784,
                                                                                      grid[0],
                                                                                      grid[1],
                                                                                      grid[2],
                                                                                      segred_group_sizze_216772,
                                                                                      1,
                                                                                      1,
                                                                                      0 +
                                                                                      (shared_sizze_237789 +
                                                                                       (8 -
                                                                                        shared_sizze_237789 %
                                                                                        8) %
                                                                                       8) +
                                                                                      (shared_sizze_237791 +
                                                                                       (8 -
                                                                                        shared_sizze_237791 %
                                                                                        8) %
                                                                                       8) +
                                                                                      (shared_sizze_237793 +
                                                                                       (8 -
                                                                                        shared_sizze_237793 %
                                                                                        8) %
                                                                                       8) +
                                                                                      (shared_sizze_237795 +
                                                                                       (8 -
                                                                                        shared_sizze_237795 %
                                                                                        8) %
                                                                                       8) +
                                                                                      (shared_sizze_237797 +
                                                                                       (8 -
                                                                                        shared_sizze_237797 %
                                                                                        8) %
                                                                                       8),
                                                                                      NULL,
                                                                                      kernel_args_237786,
                                                                                      NULL));
                                                if (pevents != NULL)
                                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                                       0));
                                                if (ctx->debugging) {
                                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                                    time_end_237788 =
                                                        get_wall_time();
                                                    fprintf(ctx->log,
                                                            "Kernel %s runtime: %ldus\n",
                                                            "main.segred_small_216784",
                                                            time_end_237788 -
                                                            time_start_237787);
                                                }
                                            }
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s\n", "");
                                        } else {
                                            int64_t groups_per_segment_233930 =
                                                    sdiv_up64(num_groups_216773,
                                                              smax64((int64_t) 1,
                                                                     partition_sizze_203577 *
                                                                     n_p_203492 *
                                                                     s_n_m_203636));
                                            int64_t elements_per_thread_233931 =
                                                    sdiv_up64(q_s_203493,
                                                              segred_group_sizze_216772 *
                                                              groups_per_segment_233930);
                                            int64_t virt_num_groups_233932 =
                                                    groups_per_segment_233930 *
                                                    (partition_sizze_203577 *
                                                     n_p_203492 * s_n_m_203636);
                                            int64_t num_threads_233933 =
                                                    num_groups_216773 *
                                                    segred_group_sizze_216772;
                                            int64_t threads_per_segment_233934 =
                                                    groups_per_segment_233930 *
                                                    segred_group_sizze_216772;
                                            
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s\n",
                                                        "\n# SegRed-large");
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "num_segments",
                                                        (long long) (partition_sizze_203577 *
                                                                     n_p_203492 *
                                                                     s_n_m_203636),
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "segment_size",
                                                        (long long) q_s_203493,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "virt_num_groups",
                                                        (long long) virt_num_groups_233932,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "num_groups",
                                                        (long long) num_groups_216773,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "group_size",
                                                        (long long) segred_group_sizze_216772,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "elems_per_thread",
                                                        (long long) elements_per_thread_233931,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "groups_per_segment",
                                                        (long long) groups_per_segment_233930,
                                                        '\n');
                                            
                                            struct memblock_device
                                            segred_tmp_mem_233935;
                                            
                                            segred_tmp_mem_233935.references =
                                                NULL;
                                            if (memblock_alloc_device(ctx,
                                                                      &segred_tmp_mem_233935,
                                                                      (int64_t) 8 *
                                                                      virt_num_groups_233932,
                                                                      "segred_tmp_mem_233935")) {
                                                err = 1;
                                                goto cleanup;
                                            }
                                            
                                            struct memblock_device
                                            segred_tmp_mem_233937;
                                            
                                            segred_tmp_mem_233937.references =
                                                NULL;
                                            if (memblock_alloc_device(ctx,
                                                                      &segred_tmp_mem_233937,
                                                                      (int64_t) 8 *
                                                                      virt_num_groups_233932,
                                                                      "segred_tmp_mem_233937")) {
                                                err = 1;
                                                goto cleanup;
                                            }
                                            
                                            struct memblock_device
                                            segred_tmp_mem_233939;
                                            
                                            segred_tmp_mem_233939.references =
                                                NULL;
                                            if (memblock_alloc_device(ctx,
                                                                      &segred_tmp_mem_233939,
                                                                      (int64_t) 8 *
                                                                      virt_num_groups_233932,
                                                                      "segred_tmp_mem_233939")) {
                                                err = 1;
                                                goto cleanup;
                                            }
                                            
                                            struct memblock_device
                                            segred_tmp_mem_233941;
                                            
                                            segred_tmp_mem_233941.references =
                                                NULL;
                                            if (memblock_alloc_device(ctx,
                                                                      &segred_tmp_mem_233941,
                                                                      (int64_t) 8 *
                                                                      virt_num_groups_233932,
                                                                      "segred_tmp_mem_233941")) {
                                                err = 1;
                                                goto cleanup;
                                            }
                                            
                                            struct memblock_device
                                            segred_tmp_mem_233943;
                                            
                                            segred_tmp_mem_233943.references =
                                                NULL;
                                            if (memblock_alloc_device(ctx,
                                                                      &segred_tmp_mem_233943,
                                                                      (int64_t) 8 *
                                                                      virt_num_groups_233932,
                                                                      "segred_tmp_mem_233943")) {
                                                err = 1;
                                                goto cleanup;
                                            }
                                            
                                            struct memblock_device
                                            mainzicounter_mem_233945 =
                                            ctx->mainzicounter_mem_233945;
                                            unsigned int shared_sizze_237814 =
                                                         1;
                                            unsigned int shared_sizze_237816 =
                                                         (int64_t) 8 *
                                                         segred_group_sizze_216772;
                                            unsigned int shared_sizze_237818 =
                                                         (int64_t) 8 *
                                                         segred_group_sizze_216772;
                                            unsigned int shared_sizze_237820 =
                                                         (int64_t) 8 *
                                                         segred_group_sizze_216772;
                                            unsigned int shared_sizze_237822 =
                                                         (int64_t) 8 *
                                                         segred_group_sizze_216772;
                                            unsigned int shared_sizze_237824 =
                                                         (int64_t) 8 *
                                                         segred_group_sizze_216772;
                                            CUdeviceptr kernel_arg_237826 =
                                                        ext_mem_229264.mem;
                                            CUdeviceptr kernel_arg_237827 =
                                                        ext_mem_229265.mem;
                                            CUdeviceptr kernel_arg_237828 =
                                                        ext_mem_229362.mem;
                                            CUdeviceptr kernel_arg_237829 =
                                                        ext_mem_229363.mem;
                                            CUdeviceptr kernel_arg_237830 =
                                                        mem_229531.mem;
                                            CUdeviceptr kernel_arg_237831 =
                                                        mem_230312.mem;
                                            CUdeviceptr kernel_arg_237832 =
                                                        mem_230322.mem;
                                            CUdeviceptr kernel_arg_237833 =
                                                        mem_230327.mem;
                                            CUdeviceptr kernel_arg_237834 =
                                                        mem_230332.mem;
                                            CUdeviceptr kernel_arg_237835 =
                                                        mem_230337.mem;
                                            CUdeviceptr kernel_arg_237836 =
                                                        mem_230342.mem;
                                            CUdeviceptr kernel_arg_237837 =
                                                        segred_tmp_mem_233935.mem;
                                            CUdeviceptr kernel_arg_237838 =
                                                        segred_tmp_mem_233937.mem;
                                            CUdeviceptr kernel_arg_237839 =
                                                        segred_tmp_mem_233939.mem;
                                            CUdeviceptr kernel_arg_237840 =
                                                        segred_tmp_mem_233941.mem;
                                            CUdeviceptr kernel_arg_237841 =
                                                        segred_tmp_mem_233943.mem;
                                            CUdeviceptr kernel_arg_237842 =
                                                        mainzicounter_mem_233945.mem;
                                            unsigned int shared_offset_237815 =
                                                         0;
                                            unsigned int shared_offset_237817 =
                                                         0 +
                                                         (shared_sizze_237814 +
                                                          (8 -
                                                           shared_sizze_237814 %
                                                           8) % 8);
                                            unsigned int shared_offset_237819 =
                                                         0 +
                                                         (shared_sizze_237814 +
                                                          (8 -
                                                           shared_sizze_237814 %
                                                           8) % 8) +
                                                         (shared_sizze_237816 +
                                                          (8 -
                                                           shared_sizze_237816 %
                                                           8) % 8);
                                            unsigned int shared_offset_237821 =
                                                         0 +
                                                         (shared_sizze_237814 +
                                                          (8 -
                                                           shared_sizze_237814 %
                                                           8) % 8) +
                                                         (shared_sizze_237816 +
                                                          (8 -
                                                           shared_sizze_237816 %
                                                           8) % 8) +
                                                         (shared_sizze_237818 +
                                                          (8 -
                                                           shared_sizze_237818 %
                                                           8) % 8);
                                            unsigned int shared_offset_237823 =
                                                         0 +
                                                         (shared_sizze_237814 +
                                                          (8 -
                                                           shared_sizze_237814 %
                                                           8) % 8) +
                                                         (shared_sizze_237816 +
                                                          (8 -
                                                           shared_sizze_237816 %
                                                           8) % 8) +
                                                         (shared_sizze_237818 +
                                                          (8 -
                                                           shared_sizze_237818 %
                                                           8) % 8) +
                                                         (shared_sizze_237820 +
                                                          (8 -
                                                           shared_sizze_237820 %
                                                           8) % 8);
                                            unsigned int shared_offset_237825 =
                                                         0 +
                                                         (shared_sizze_237814 +
                                                          (8 -
                                                           shared_sizze_237814 %
                                                           8) % 8) +
                                                         (shared_sizze_237816 +
                                                          (8 -
                                                           shared_sizze_237816 %
                                                           8) % 8) +
                                                         (shared_sizze_237818 +
                                                          (8 -
                                                           shared_sizze_237818 %
                                                           8) % 8) +
                                                         (shared_sizze_237820 +
                                                          (8 -
                                                           shared_sizze_237820 %
                                                           8) % 8) +
                                                         (shared_sizze_237822 +
                                                          (8 -
                                                           shared_sizze_237822 %
                                                           8) % 8);
                                            
                                            if ((((((1 && num_groups_216773 !=
                                                     0) && 1 != 0) && 1 != 0) &&
                                                  segred_group_sizze_216772 !=
                                                  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_216773;
                                                grid[perm[1]] = 1;
                                                grid[perm[2]] = 1;
                                                
                                                void *kernel_args_237811[] =
                                                     {&ctx->global_failure,
                                                      &shared_offset_237815,
                                                      &shared_offset_237817,
                                                      &shared_offset_237819,
                                                      &shared_offset_237821,
                                                      &shared_offset_237823,
                                                      &shared_offset_237825,
                                                      &n_p_203492, &q_s_203493,
                                                      &partition_sizze_203577,
                                                      &defunc_0_f_res_203631,
                                                      &s_n_m_203636,
                                                      &num_groups_216773,
                                                      &groups_per_segment_233930,
                                                      &elements_per_thread_233931,
                                                      &virt_num_groups_233932,
                                                      &threads_per_segment_233934,
                                                      &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,
                                                      &kernel_arg_237835,
                                                      &kernel_arg_237836,
                                                      &kernel_arg_237837,
                                                      &kernel_arg_237838,
                                                      &kernel_arg_237839,
                                                      &kernel_arg_237840,
                                                      &kernel_arg_237841,
                                                      &kernel_arg_237842};
                                                int64_t time_start_237812 = 0,
                                                        time_end_237813 = 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_216784",
                                                            (long) num_groups_216773,
                                                            (long) 1, (long) 1,
                                                            (long) segred_group_sizze_216772,
                                                            (long) 1, (long) 1,
                                                            (int) (0 +
                                                                   (shared_sizze_237814 +
                                                                    (8 -
                                                                     shared_sizze_237814 %
                                                                     8) % 8) +
                                                                   (shared_sizze_237816 +
                                                                    (8 -
                                                                     shared_sizze_237816 %
                                                                     8) % 8) +
                                                                   (shared_sizze_237818 +
                                                                    (8 -
                                                                     shared_sizze_237818 %
                                                                     8) % 8) +
                                                                   (shared_sizze_237820 +
                                                                    (8 -
                                                                     shared_sizze_237820 %
                                                                     8) % 8) +
                                                                   (shared_sizze_237822 +
                                                                    (8 -
                                                                     shared_sizze_237822 %
                                                                     8) % 8) +
                                                                   (shared_sizze_237824 +
                                                                    (8 -
                                                                     shared_sizze_237824 %
                                                                     8) % 8)));
                                                    time_start_237812 =
                                                        get_wall_time();
                                                }
                                                
                                                cudaEvent_t *pevents = NULL;
                                                
                                                if (ctx->profiling &&
                                                    !ctx->profiling_paused) {
                                                    pevents =
                                                        cuda_get_events(&ctx->cuda,
                                                                        &ctx->mainzisegred_large_216784_runs,
                                                                        &ctx->mainzisegred_large_216784_total_runtime);
                                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                                       0));
                                                }
                                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_large_216784,
                                                                                      grid[0],
                                                                                      grid[1],
                                                                                      grid[2],
                                                                                      segred_group_sizze_216772,
                                                                                      1,
                                                                                      1,
                                                                                      0 +
                                                                                      (shared_sizze_237814 +
                                                                                       (8 -
                                                                                        shared_sizze_237814 %
                                                                                        8) %
                                                                                       8) +
                                                                                      (shared_sizze_237816 +
                                                                                       (8 -
                                                                                        shared_sizze_237816 %
                                                                                        8) %
                                                                                       8) +
                                                                                      (shared_sizze_237818 +
                                                                                       (8 -
                                                                                        shared_sizze_237818 %
                                                                                        8) %
                                                                                       8) +
                                                                                      (shared_sizze_237820 +
                                                                                       (8 -
                                                                                        shared_sizze_237820 %
                                                                                        8) %
                                                                                       8) +
                                                                                      (shared_sizze_237822 +
                                                                                       (8 -
                                                                                        shared_sizze_237822 %
                                                                                        8) %
                                                                                       8) +
                                                                                      (shared_sizze_237824 +
                                                                                       (8 -
                                                                                        shared_sizze_237824 %
                                                                                        8) %
                                                                                       8),
                                                                                      NULL,
                                                                                      kernel_args_237811,
                                                                                      NULL));
                                                if (pevents != NULL)
                                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                                       0));
                                                if (ctx->debugging) {
                                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                                    time_end_237813 =
                                                        get_wall_time();
                                                    fprintf(ctx->log,
                                                            "Kernel %s runtime: %ldus\n",
                                                            "main.segred_large_216784",
                                                            time_end_237813 -
                                                            time_start_237812);
                                                }
                                            }
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s\n", "");
                                            if (memblock_unref_device(ctx,
                                                                      &segred_tmp_mem_233943,
                                                                      "segred_tmp_mem_233943") !=
                                                0)
                                                return 1;
                                            if (memblock_unref_device(ctx,
                                                                      &segred_tmp_mem_233941,
                                                                      "segred_tmp_mem_233941") !=
                                                0)
                                                return 1;
                                            if (memblock_unref_device(ctx,
                                                                      &segred_tmp_mem_233939,
                                                                      "segred_tmp_mem_233939") !=
                                                0)
                                                return 1;
                                            if (memblock_unref_device(ctx,
                                                                      &segred_tmp_mem_233937,
                                                                      "segred_tmp_mem_233937") !=
                                                0)
                                                return 1;
                                            if (memblock_unref_device(ctx,
                                                                      &segred_tmp_mem_233935,
                                                                      "segred_tmp_mem_233935") !=
                                                0)
                                                return 1;
                                        }
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230312,
                                                                  "mem_230312") !=
                                            0)
                                            return 1;
                                        
                                        int64_t segmap_usable_groups_216842 =
                                                sdiv_up64(nest_sizze_208848,
                                                          segmap_group_sizze_216841);
                                        struct memblock_device mem_230348;
                                        
                                        mem_230348.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230348,
                                                                  bytes_229297,
                                                                  "mem_230348")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230353;
                                        
                                        mem_230353.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230353,
                                                                  bytes_229297,
                                                                  "mem_230353")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230358;
                                        
                                        mem_230358.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230358,
                                                                  bytes_229297,
                                                                  "mem_230358")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230363;
                                        
                                        mem_230363.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230363,
                                                                  bytes_229297,
                                                                  "mem_230363")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230368;
                                        
                                        mem_230368.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230368,
                                                                  bytes_229297,
                                                                  "mem_230368")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230373;
                                        
                                        mem_230373.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230373,
                                                                  bytes_229297,
                                                                  "mem_230373")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n",
                                                    "\n# SegMap");
                                        
                                        CUdeviceptr kernel_arg_237846 =
                                                    mem_230322.mem;
                                        CUdeviceptr kernel_arg_237847 =
                                                    mem_230327.mem;
                                        CUdeviceptr kernel_arg_237848 =
                                                    mem_230332.mem;
                                        CUdeviceptr kernel_arg_237849 =
                                                    mem_230337.mem;
                                        CUdeviceptr kernel_arg_237850 =
                                                    mem_230342.mem;
                                        CUdeviceptr kernel_arg_237851 =
                                                    mem_230348.mem;
                                        CUdeviceptr kernel_arg_237852 =
                                                    mem_230353.mem;
                                        CUdeviceptr kernel_arg_237853 =
                                                    mem_230358.mem;
                                        CUdeviceptr kernel_arg_237854 =
                                                    mem_230363.mem;
                                        CUdeviceptr kernel_arg_237855 =
                                                    mem_230368.mem;
                                        CUdeviceptr kernel_arg_237856 =
                                                    mem_230373.mem;
                                        
                                        if ((((((1 &&
                                                 segmap_usable_groups_216842 !=
                                                 0) && 1 != 0) && 1 != 0) &&
                                              segmap_group_sizze_216841 != 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_216842;
                                            grid[perm[1]] = 1;
                                            grid[perm[2]] = 1;
                                            
                                            void *kernel_args_237843[] =
                                                 {&ctx->global_failure,
                                                  &n_p_203492, &jump_s_203499,
                                                  &partition_sizze_203577,
                                                  &defunc_0_f_res_203631,
                                                  &pad_css_len_203632,
                                                  &s_n_m_203636,
                                                  &kernel_arg_237846,
                                                  &kernel_arg_237847,
                                                  &kernel_arg_237848,
                                                  &kernel_arg_237849,
                                                  &kernel_arg_237850,
                                                  &kernel_arg_237851,
                                                  &kernel_arg_237852,
                                                  &kernel_arg_237853,
                                                  &kernel_arg_237854,
                                                  &kernel_arg_237855,
                                                  &kernel_arg_237856};
                                            int64_t time_start_237844 = 0,
                                                    time_end_237845 = 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_216852",
                                                        (long) segmap_usable_groups_216842,
                                                        (long) 1, (long) 1,
                                                        (long) segmap_group_sizze_216841,
                                                        (long) 1, (long) 1,
                                                        (int) 0);
                                                time_start_237844 =
                                                    get_wall_time();
                                            }
                                            
                                            cudaEvent_t *pevents = NULL;
                                            
                                            if (ctx->profiling &&
                                                !ctx->profiling_paused) {
                                                pevents =
                                                    cuda_get_events(&ctx->cuda,
                                                                    &ctx->mainzisegmap_216852_runs,
                                                                    &ctx->mainzisegmap_216852_total_runtime);
                                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                                   0));
                                            }
                                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_216852,
                                                                                  grid[0],
                                                                                  grid[1],
                                                                                  grid[2],
                                                                                  segmap_group_sizze_216841,
                                                                                  1,
                                                                                  1,
                                                                                  0,
                                                                                  NULL,
                                                                                  kernel_args_237843,
                                                                                  NULL));
                                            if (pevents != NULL)
                                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                                   0));
                                            if (ctx->debugging) {
                                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                                time_end_237845 =
                                                    get_wall_time();
                                                fprintf(ctx->log,
                                                        "Kernel %s runtime: %ldus\n",
                                                        "main.segmap_216852",
                                                        time_end_237845 -
                                                        time_start_237844);
                                            }
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n", "");
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230322,
                                                                  "mem_230322") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230327,
                                                                  "mem_230327") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230332,
                                                                  "mem_230332") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230337,
                                                                  "mem_230337") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230342,
                                                                  "mem_230342") !=
                                            0)
                                            return 1;
                                        
                                        struct memblock_device mem_230379;
                                        
                                        mem_230379.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230379,
                                                                  bytes_229297,
                                                                  "mem_230379")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230384;
                                        
                                        mem_230384.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230384,
                                                                  bytes_229297,
                                                                  "mem_230384")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        if (slt64(q_s_203493 * (int64_t) 2,
                                                  segred_group_sizze_216898)) {
                                            int64_t
                                            segment_sizze_nonzzero_234019 =
                                            smax64((int64_t) 1, q_s_203493);
                                            int64_t num_threads_234020 =
                                                    num_groups_216899 *
                                                    segred_group_sizze_216898;
                                            
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s\n",
                                                        "\n# SegRed-small");
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "num_segments",
                                                        (long long) (partition_sizze_203577 *
                                                                     n_p_203492 *
                                                                     s_n_m_203636),
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "segment_size",
                                                        (long long) q_s_203493,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "segments_per_group",
                                                        (long long) squot64(segred_group_sizze_216898,
                                                                            segment_sizze_nonzzero_234019),
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "required_groups",
                                                        (long long) sext_i64_i32(sdiv_up64(partition_sizze_203577 *
                                                                                           n_p_203492 *
                                                                                           s_n_m_203636,
                                                                                           squot64(segred_group_sizze_216898,
                                                                                                   segment_sizze_nonzzero_234019))),
                                                        '\n');
                                            
                                            unsigned int shared_sizze_237860 =
                                                         (int64_t) 8 *
                                                         segred_group_sizze_216898;
                                            unsigned int shared_sizze_237862 =
                                                         (int64_t) 8 *
                                                         segred_group_sizze_216898;
                                            CUdeviceptr kernel_arg_237864 =
                                                        ext_mem_229264.mem;
                                            CUdeviceptr kernel_arg_237865 =
                                                        ext_mem_229265.mem;
                                            CUdeviceptr kernel_arg_237866 =
                                                        ext_mem_229362.mem;
                                            CUdeviceptr kernel_arg_237867 =
                                                        ext_mem_229363.mem;
                                            CUdeviceptr kernel_arg_237868 =
                                                        mem_229526.mem;
                                            CUdeviceptr kernel_arg_237869 =
                                                        mem_229531.mem;
                                            CUdeviceptr kernel_arg_237870 =
                                                        mem_230348.mem;
                                            CUdeviceptr kernel_arg_237871 =
                                                        mem_230353.mem;
                                            CUdeviceptr kernel_arg_237872 =
                                                        mem_230358.mem;
                                            CUdeviceptr kernel_arg_237873 =
                                                        mem_230363.mem;
                                            CUdeviceptr kernel_arg_237874 =
                                                        mem_230368.mem;
                                            CUdeviceptr kernel_arg_237875 =
                                                        mem_230373.mem;
                                            CUdeviceptr kernel_arg_237876 =
                                                        mem_230379.mem;
                                            CUdeviceptr kernel_arg_237877 =
                                                        mem_230384.mem;
                                            unsigned int shared_offset_237861 =
                                                         0;
                                            unsigned int shared_offset_237863 =
                                                         0 +
                                                         (shared_sizze_237860 +
                                                          (8 -
                                                           shared_sizze_237860 %
                                                           8) % 8);
                                            
                                            if ((((((1 && num_groups_216899 !=
                                                     0) && 1 != 0) && 1 != 0) &&
                                                  segred_group_sizze_216898 !=
                                                  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_216899;
                                                grid[perm[1]] = 1;
                                                grid[perm[2]] = 1;
                                                
                                                void *kernel_args_237857[] =
                                                     {&ctx->global_failure,
                                                      &shared_offset_237861,
                                                      &shared_offset_237863,
                                                      &n_p_203492, &q_s_203493,
                                                      &partition_sizze_203577,
                                                      &defunc_0_f_res_203631,
                                                      &s_n_m_203636,
                                                      &num_groups_216899,
                                                      &segment_sizze_nonzzero_234019,
                                                      &kernel_arg_237864,
                                                      &kernel_arg_237865,
                                                      &kernel_arg_237866,
                                                      &kernel_arg_237867,
                                                      &kernel_arg_237868,
                                                      &kernel_arg_237869,
                                                      &kernel_arg_237870,
                                                      &kernel_arg_237871,
                                                      &kernel_arg_237872,
                                                      &kernel_arg_237873,
                                                      &kernel_arg_237874,
                                                      &kernel_arg_237875,
                                                      &kernel_arg_237876,
                                                      &kernel_arg_237877};
                                                int64_t time_start_237858 = 0,
                                                        time_end_237859 = 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_216907",
                                                            (long) num_groups_216899,
                                                            (long) 1, (long) 1,
                                                            (long) segred_group_sizze_216898,
                                                            (long) 1, (long) 1,
                                                            (int) (0 +
                                                                   (shared_sizze_237860 +
                                                                    (8 -
                                                                     shared_sizze_237860 %
                                                                     8) % 8) +
                                                                   (shared_sizze_237862 +
                                                                    (8 -
                                                                     shared_sizze_237862 %
                                                                     8) % 8)));
                                                    time_start_237858 =
                                                        get_wall_time();
                                                }
                                                
                                                cudaEvent_t *pevents = NULL;
                                                
                                                if (ctx->profiling &&
                                                    !ctx->profiling_paused) {
                                                    pevents =
                                                        cuda_get_events(&ctx->cuda,
                                                                        &ctx->mainzisegred_small_216907_runs,
                                                                        &ctx->mainzisegred_small_216907_total_runtime);
                                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                                       0));
                                                }
                                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_small_216907,
                                                                                      grid[0],
                                                                                      grid[1],
                                                                                      grid[2],
                                                                                      segred_group_sizze_216898,
                                                                                      1,
                                                                                      1,
                                                                                      0 +
                                                                                      (shared_sizze_237860 +
                                                                                       (8 -
                                                                                        shared_sizze_237860 %
                                                                                        8) %
                                                                                       8) +
                                                                                      (shared_sizze_237862 +
                                                                                       (8 -
                                                                                        shared_sizze_237862 %
                                                                                        8) %
                                                                                       8),
                                                                                      NULL,
                                                                                      kernel_args_237857,
                                                                                      NULL));
                                                if (pevents != NULL)
                                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                                       0));
                                                if (ctx->debugging) {
                                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                                    time_end_237859 =
                                                        get_wall_time();
                                                    fprintf(ctx->log,
                                                            "Kernel %s runtime: %ldus\n",
                                                            "main.segred_small_216907",
                                                            time_end_237859 -
                                                            time_start_237858);
                                                }
                                            }
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s\n", "");
                                        } else {
                                            int64_t groups_per_segment_234056 =
                                                    sdiv_up64(num_groups_216899,
                                                              smax64((int64_t) 1,
                                                                     partition_sizze_203577 *
                                                                     n_p_203492 *
                                                                     s_n_m_203636));
                                            int64_t elements_per_thread_234057 =
                                                    sdiv_up64(q_s_203493,
                                                              segred_group_sizze_216898 *
                                                              groups_per_segment_234056);
                                            int64_t virt_num_groups_234058 =
                                                    groups_per_segment_234056 *
                                                    (partition_sizze_203577 *
                                                     n_p_203492 * s_n_m_203636);
                                            int64_t num_threads_234059 =
                                                    num_groups_216899 *
                                                    segred_group_sizze_216898;
                                            int64_t threads_per_segment_234060 =
                                                    groups_per_segment_234056 *
                                                    segred_group_sizze_216898;
                                            
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s\n",
                                                        "\n# SegRed-large");
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "num_segments",
                                                        (long long) (partition_sizze_203577 *
                                                                     n_p_203492 *
                                                                     s_n_m_203636),
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "segment_size",
                                                        (long long) q_s_203493,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "virt_num_groups",
                                                        (long long) virt_num_groups_234058,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "num_groups",
                                                        (long long) num_groups_216899,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "group_size",
                                                        (long long) segred_group_sizze_216898,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "elems_per_thread",
                                                        (long long) elements_per_thread_234057,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "groups_per_segment",
                                                        (long long) groups_per_segment_234056,
                                                        '\n');
                                            
                                            struct memblock_device
                                            segred_tmp_mem_234061;
                                            
                                            segred_tmp_mem_234061.references =
                                                NULL;
                                            if (memblock_alloc_device(ctx,
                                                                      &segred_tmp_mem_234061,
                                                                      (int64_t) 8 *
                                                                      virt_num_groups_234058,
                                                                      "segred_tmp_mem_234061")) {
                                                err = 1;
                                                goto cleanup;
                                            }
                                            
                                            struct memblock_device
                                            segred_tmp_mem_234063;
                                            
                                            segred_tmp_mem_234063.references =
                                                NULL;
                                            if (memblock_alloc_device(ctx,
                                                                      &segred_tmp_mem_234063,
                                                                      (int64_t) 8 *
                                                                      virt_num_groups_234058,
                                                                      "segred_tmp_mem_234063")) {
                                                err = 1;
                                                goto cleanup;
                                            }
                                            
                                            struct memblock_device
                                            mainzicounter_mem_234065 =
                                            ctx->mainzicounter_mem_234065;
                                            unsigned int shared_sizze_237882 =
                                                         1;
                                            unsigned int shared_sizze_237884 =
                                                         (int64_t) 8 *
                                                         segred_group_sizze_216898;
                                            unsigned int shared_sizze_237886 =
                                                         (int64_t) 8 *
                                                         segred_group_sizze_216898;
                                            CUdeviceptr kernel_arg_237888 =
                                                        ext_mem_229264.mem;
                                            CUdeviceptr kernel_arg_237889 =
                                                        ext_mem_229265.mem;
                                            CUdeviceptr kernel_arg_237890 =
                                                        ext_mem_229362.mem;
                                            CUdeviceptr kernel_arg_237891 =
                                                        ext_mem_229363.mem;
                                            CUdeviceptr kernel_arg_237892 =
                                                        mem_229526.mem;
                                            CUdeviceptr kernel_arg_237893 =
                                                        mem_229531.mem;
                                            CUdeviceptr kernel_arg_237894 =
                                                        mem_230348.mem;
                                            CUdeviceptr kernel_arg_237895 =
                                                        mem_230353.mem;
                                            CUdeviceptr kernel_arg_237896 =
                                                        mem_230358.mem;
                                            CUdeviceptr kernel_arg_237897 =
                                                        mem_230363.mem;
                                            CUdeviceptr kernel_arg_237898 =
                                                        mem_230368.mem;
                                            CUdeviceptr kernel_arg_237899 =
                                                        mem_230373.mem;
                                            CUdeviceptr kernel_arg_237900 =
                                                        mem_230379.mem;
                                            CUdeviceptr kernel_arg_237901 =
                                                        mem_230384.mem;
                                            CUdeviceptr kernel_arg_237902 =
                                                        segred_tmp_mem_234061.mem;
                                            CUdeviceptr kernel_arg_237903 =
                                                        segred_tmp_mem_234063.mem;
                                            CUdeviceptr kernel_arg_237904 =
                                                        mainzicounter_mem_234065.mem;
                                            unsigned int shared_offset_237883 =
                                                         0;
                                            unsigned int shared_offset_237885 =
                                                         0 +
                                                         (shared_sizze_237882 +
                                                          (8 -
                                                           shared_sizze_237882 %
                                                           8) % 8);
                                            unsigned int shared_offset_237887 =
                                                         0 +
                                                         (shared_sizze_237882 +
                                                          (8 -
                                                           shared_sizze_237882 %
                                                           8) % 8) +
                                                         (shared_sizze_237884 +
                                                          (8 -
                                                           shared_sizze_237884 %
                                                           8) % 8);
                                            
                                            if ((((((1 && num_groups_216899 !=
                                                     0) && 1 != 0) && 1 != 0) &&
                                                  segred_group_sizze_216898 !=
                                                  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_216899;
                                                grid[perm[1]] = 1;
                                                grid[perm[2]] = 1;
                                                
                                                void *kernel_args_237879[] =
                                                     {&ctx->global_failure,
                                                      &shared_offset_237883,
                                                      &shared_offset_237885,
                                                      &shared_offset_237887,
                                                      &n_p_203492, &q_s_203493,
                                                      &partition_sizze_203577,
                                                      &defunc_0_f_res_203631,
                                                      &s_n_m_203636,
                                                      &num_groups_216899,
                                                      &groups_per_segment_234056,
                                                      &elements_per_thread_234057,
                                                      &virt_num_groups_234058,
                                                      &threads_per_segment_234060,
                                                      &kernel_arg_237888,
                                                      &kernel_arg_237889,
                                                      &kernel_arg_237890,
                                                      &kernel_arg_237891,
                                                      &kernel_arg_237892,
                                                      &kernel_arg_237893,
                                                      &kernel_arg_237894,
                                                      &kernel_arg_237895,
                                                      &kernel_arg_237896,
                                                      &kernel_arg_237897,
                                                      &kernel_arg_237898,
                                                      &kernel_arg_237899,
                                                      &kernel_arg_237900,
                                                      &kernel_arg_237901,
                                                      &kernel_arg_237902,
                                                      &kernel_arg_237903,
                                                      &kernel_arg_237904};
                                                int64_t time_start_237880 = 0,
                                                        time_end_237881 = 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_216907",
                                                            (long) num_groups_216899,
                                                            (long) 1, (long) 1,
                                                            (long) segred_group_sizze_216898,
                                                            (long) 1, (long) 1,
                                                            (int) (0 +
                                                                   (shared_sizze_237882 +
                                                                    (8 -
                                                                     shared_sizze_237882 %
                                                                     8) % 8) +
                                                                   (shared_sizze_237884 +
                                                                    (8 -
                                                                     shared_sizze_237884 %
                                                                     8) % 8) +
                                                                   (shared_sizze_237886 +
                                                                    (8 -
                                                                     shared_sizze_237886 %
                                                                     8) % 8)));
                                                    time_start_237880 =
                                                        get_wall_time();
                                                }
                                                
                                                cudaEvent_t *pevents = NULL;
                                                
                                                if (ctx->profiling &&
                                                    !ctx->profiling_paused) {
                                                    pevents =
                                                        cuda_get_events(&ctx->cuda,
                                                                        &ctx->mainzisegred_large_216907_runs,
                                                                        &ctx->mainzisegred_large_216907_total_runtime);
                                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                                       0));
                                                }
                                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_large_216907,
                                                                                      grid[0],
                                                                                      grid[1],
                                                                                      grid[2],
                                                                                      segred_group_sizze_216898,
                                                                                      1,
                                                                                      1,
                                                                                      0 +
                                                                                      (shared_sizze_237882 +
                                                                                       (8 -
                                                                                        shared_sizze_237882 %
                                                                                        8) %
                                                                                       8) +
                                                                                      (shared_sizze_237884 +
                                                                                       (8 -
                                                                                        shared_sizze_237884 %
                                                                                        8) %
                                                                                       8) +
                                                                                      (shared_sizze_237886 +
                                                                                       (8 -
                                                                                        shared_sizze_237886 %
                                                                                        8) %
                                                                                       8),
                                                                                      NULL,
                                                                                      kernel_args_237879,
                                                                                      NULL));
                                                if (pevents != NULL)
                                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                                       0));
                                                if (ctx->debugging) {
                                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                                    time_end_237881 =
                                                        get_wall_time();
                                                    fprintf(ctx->log,
                                                            "Kernel %s runtime: %ldus\n",
                                                            "main.segred_large_216907",
                                                            time_end_237881 -
                                                            time_start_237880);
                                                }
                                            }
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s\n", "");
                                            if (memblock_unref_device(ctx,
                                                                      &segred_tmp_mem_234063,
                                                                      "segred_tmp_mem_234063") !=
                                                0)
                                                return 1;
                                            if (memblock_unref_device(ctx,
                                                                      &segred_tmp_mem_234061,
                                                                      "segred_tmp_mem_234061") !=
                                                0)
                                                return 1;
                                        }
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230348,
                                                                  "mem_230348") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230353,
                                                                  "mem_230353") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230358,
                                                                  "mem_230358") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230363,
                                                                  "mem_230363") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230368,
                                                                  "mem_230368") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230373,
                                                                  "mem_230373") !=
                                            0)
                                            return 1;
                                        if (memblock_set_device(ctx,
                                                                &ext_mem_230386,
                                                                &mem_230379,
                                                                "mem_230379") !=
                                            0)
                                            return 1;
                                        if (memblock_set_device(ctx,
                                                                &ext_mem_230385,
                                                                &mem_230384,
                                                                "mem_230384") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230384,
                                                                  "mem_230384") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230379,
                                                                  "mem_230379") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230373,
                                                                  "mem_230373") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230368,
                                                                  "mem_230368") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230363,
                                                                  "mem_230363") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230358,
                                                                  "mem_230358") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230353,
                                                                  "mem_230353") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230348,
                                                                  "mem_230348") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230342,
                                                                  "mem_230342") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230337,
                                                                  "mem_230337") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230332,
                                                                  "mem_230332") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230327,
                                                                  "mem_230327") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230322,
                                                                  "mem_230322") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230316,
                                                                  "mem_230316") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230312,
                                                                  "mem_230312") !=
                                            0)
                                            return 1;
                                    }
                                    if (memblock_set_device(ctx,
                                                            &ext_mem_230388,
                                                            &ext_mem_230386,
                                                            "ext_mem_230386") !=
                                        0)
                                        return 1;
                                    if (memblock_set_device(ctx,
                                                            &ext_mem_230387,
                                                            &ext_mem_230385,
                                                            "ext_mem_230385") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230385,
                                                              "ext_mem_230385") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230386,
                                                              "ext_mem_230386") !=
                                        0)
                                        return 1;
                                }
                                if (memblock_set_device(ctx, &ext_mem_230402,
                                                        &ext_mem_230388,
                                                        "ext_mem_230388") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_230401,
                                                        &ext_mem_230387,
                                                        "ext_mem_230387") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230387,
                                                          "ext_mem_230387") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230388,
                                                          "ext_mem_230388") !=
                                    0)
                                    return 1;
                            }
                            if (memblock_set_device(ctx, &ext_mem_230416,
                                                    &ext_mem_230402,
                                                    "ext_mem_230402") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_230415,
                                                    &ext_mem_230401,
                                                    "ext_mem_230401") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230401,
                                                      "ext_mem_230401") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230402,
                                                      "ext_mem_230402") != 0)
                                return 1;
                        }
                        if (memblock_set_device(ctx, &ext_mem_230418,
                                                &ext_mem_230416,
                                                "ext_mem_230416") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_230417,
                                                &ext_mem_230415,
                                                "ext_mem_230415") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230415,
                                                  "ext_mem_230415") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230416,
                                                  "ext_mem_230416") != 0)
                            return 1;
                    }
                    if (memblock_set_device(ctx, &ext_mem_230420,
                                            &ext_mem_230418,
                                            "ext_mem_230418") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_230419,
                                            &ext_mem_230417,
                                            "ext_mem_230417") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230417,
                                              "ext_mem_230417") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230418,
                                              "ext_mem_230418") != 0)
                        return 1;
                }
                if (memblock_set_device(ctx, &ext_mem_230487, &ext_mem_230420,
                                        "ext_mem_230420") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_230486, &ext_mem_230419,
                                        "ext_mem_230419") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_230419,
                                          "ext_mem_230419") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_230420,
                                          "ext_mem_230420") != 0)
                    return 1;
            } else {
                bool match_lit_204617 = (int64_t) 0 == d_s_203496;
                int64_t binop_y_230428 = (int64_t) 8 * q_s_203493;
                int64_t bytes_230429 = smax64((int64_t) 0, binop_y_230428);
                struct memblock_device ext_mem_230485;
                
                ext_mem_230485.references = NULL;
                
                struct memblock_device ext_mem_230484;
                
                ext_mem_230484.references = NULL;
                if (match_lit_204617) {
                    struct memblock_device mem_230425;
                    
                    mem_230425.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_230425, bytes_229297,
                                              "mem_230425")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (futrts_builtinzhreplicate_f64(ctx, mem_230425,
                                                      partition_sizze_203577 *
                                                      n_p_203492 * s_n_m_203636,
                                                      0.0) != 0) {
                        if (memblock_unref_device(ctx, &mem_230425,
                                                  "mem_230425") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230484,
                                                  "ext_mem_230484") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230485,
                                                  "ext_mem_230485") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230486,
                                                  "ext_mem_230486") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230487,
                                                  "ext_mem_230487") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229515,
                                                  "mem_param_229515") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229507,
                                                  "mem_param_229507") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231517,
                                                  "ext_mem_231517") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231518,
                                                  "ext_mem_231518") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229493,
                                                  "mem_param_229493") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229485,
                                                  "mem_param_229485") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229477,
                                                  "mem_param_229477") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231860,
                                                  "ext_mem_231860") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231861,
                                                  "ext_mem_231861") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231862,
                                                  "ext_mem_231862") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230551,
                                                  "mem_230551") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230534,
                                                  "mem_230534") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230517,
                                                  "mem_230517") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230500,
                                                  "mem_230500") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229531,
                                                  "mem_229531") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229526,
                                                  "mem_229526") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229520,
                                                  "mem_229520") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229469,
                                                  "mem_229469") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229465,
                                                  "mem_229465") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229460,
                                                  "ext_mem_229460") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229461,
                                                  "ext_mem_229461") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229411,
                                                  "ext_mem_229411") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229412,
                                                  "ext_mem_229412") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229362,
                                                  "ext_mem_229362") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229363,
                                                  "ext_mem_229363") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229264,
                                                  "ext_mem_229264") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229265,
                                                  "ext_mem_229265") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229206,
                                                  "mem_229206") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229200,
                                                  "mem_229200") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229196,
                                                  "ext_mem_229196") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229197,
                                                  "ext_mem_229197") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229164,
                                                  "mem_229164") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229161,
                                                  "mem_229161") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229157,
                                                  "mem_229157") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229155,
                                                  "mem_229155") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229152,
                                                  "mem_229152") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229148,
                                                  "mem_229148") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232249,
                                                  "mem_out_232249") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232248,
                                                  "mem_out_232248") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232247,
                                                  "mem_out_232247") != 0)
                            return 1;
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mem_230436;
                    
                    mem_230436.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_230436, bytes_229297,
                                              "mem_230436")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                    
                    unsigned int shared_sizze_237908 = (int64_t) 8 * q_s_203493;
                    unsigned int shared_sizze_237910 = (int64_t) 8 * q_s_203493;
                    unsigned int shared_sizze_237912 = bytes_230429;
                    CUdeviceptr kernel_arg_237914 = ext_mem_229264.mem;
                    CUdeviceptr kernel_arg_237915 = ext_mem_229265.mem;
                    CUdeviceptr kernel_arg_237916 = ext_mem_229362.mem;
                    CUdeviceptr kernel_arg_237917 = ext_mem_229363.mem;
                    CUdeviceptr kernel_arg_237918 = mem_229526.mem;
                    CUdeviceptr kernel_arg_237919 = mem_229531.mem;
                    CUdeviceptr kernel_arg_237920 = mem_230436.mem;
                    unsigned int shared_offset_237909 = 0;
                    unsigned int shared_offset_237911 = 0 +
                                 (shared_sizze_237908 + (8 -
                                                         shared_sizze_237908 %
                                                         8) % 8);
                    unsigned int shared_offset_237913 = 0 +
                                 (shared_sizze_237908 + (8 -
                                                         shared_sizze_237908 %
                                                         8) % 8) +
                                 (shared_sizze_237910 + (8 -
                                                         shared_sizze_237910 %
                                                         8) % 8);
                    
                    if ((((((1 && nest_sizze_208848 != 0) && 1 != 0) && 1 !=
                           0) && q_s_203493 != 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_208848;
                        grid[perm[1]] = 1;
                        grid[perm[2]] = 1;
                        
                        void *kernel_args_237905[] = {&ctx->global_failure,
                                                      &shared_offset_237909,
                                                      &shared_offset_237911,
                                                      &shared_offset_237913,
                                                      &n_p_203492, &q_s_203493,
                                                      &jump_s_203499,
                                                      &partition_sizze_203577,
                                                      &defunc_0_f_res_203631,
                                                      &pad_css_len_203632,
                                                      &s_n_m_203636,
                                                      &kernel_arg_237914,
                                                      &kernel_arg_237915,
                                                      &kernel_arg_237916,
                                                      &kernel_arg_237917,
                                                      &kernel_arg_237918,
                                                      &kernel_arg_237919,
                                                      &kernel_arg_237920};
                        int64_t time_start_237906 = 0, time_end_237907 = 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_217183",
                                    (long) nest_sizze_208848, (long) 1,
                                    (long) 1, (long) q_s_203493, (long) 1,
                                    (long) 1, (int) (0 + (shared_sizze_237908 +
                                                          (8 -
                                                           shared_sizze_237908 %
                                                           8) % 8) +
                                                     (shared_sizze_237910 + (8 -
                                                                             shared_sizze_237910 %
                                                                             8) %
                                                      8) +
                                                     (shared_sizze_237912 + (8 -
                                                                             shared_sizze_237912 %
                                                                             8) %
                                                      8)));
                            time_start_237906 = get_wall_time();
                        }
                        
                        cudaEvent_t *pevents = NULL;
                        
                        if (ctx->profiling && !ctx->profiling_paused) {
                            pevents = cuda_get_events(&ctx->cuda,
                                                      &ctx->mainzisegmap_intragroup_217183_runs,
                                                      &ctx->mainzisegmap_intragroup_217183_total_runtime);
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                        }
                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_intragroup_217183,
                                                              grid[0], grid[1],
                                                              grid[2],
                                                              q_s_203493, 1, 1,
                                                              0 +
                                                              (shared_sizze_237908 +
                                                               (8 -
                                                                shared_sizze_237908 %
                                                                8) % 8) +
                                                              (shared_sizze_237910 +
                                                               (8 -
                                                                shared_sizze_237910 %
                                                                8) % 8) +
                                                              (shared_sizze_237912 +
                                                               (8 -
                                                                shared_sizze_237912 %
                                                                8) % 8), NULL,
                                                              kernel_args_237905,
                                                              NULL));
                        if (pevents != NULL)
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                        if (ctx->debugging) {
                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                            time_end_237907 = get_wall_time();
                            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                    "main.segmap_intragroup_217183",
                                    time_end_237907 - time_start_237906);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    if (memblock_set_device(ctx, &ext_mem_230485, &mem_230436,
                                            "mem_230436") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_230484, &mem_230425,
                                            "mem_230425") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230436, "mem_230436") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230425, "mem_230425") !=
                        0)
                        return 1;
                } else {
                    bool match_lit_204689 = (int64_t) 1 == d_s_203496;
                    struct memblock_device ext_mem_230483;
                    
                    ext_mem_230483.references = NULL;
                    
                    struct memblock_device ext_mem_230482;
                    
                    ext_mem_230482.references = NULL;
                    if (match_lit_204689) {
                        struct memblock_device mem_230450;
                        
                        mem_230450.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230450,
                                                  bytes_229297, "mem_230450")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_230455;
                        
                        mem_230455.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230455,
                                                  bytes_229297, "mem_230455")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        
                        unsigned int shared_sizze_237924 = (int64_t) 8 *
                                     q_s_203493;
                        unsigned int shared_sizze_237926 = (int64_t) 8 *
                                     q_s_203493;
                        unsigned int shared_sizze_237928 = (int64_t) 8 *
                                     q_s_203493;
                        unsigned int shared_sizze_237930 = (int64_t) 8 *
                                     q_s_203493;
                        unsigned int shared_sizze_237932 = (int64_t) 8 *
                                     q_s_203493;
                        unsigned int shared_sizze_237934 = bytes_230429;
                        unsigned int shared_sizze_237936 = bytes_230429;
                        CUdeviceptr kernel_arg_237938 = ext_mem_229264.mem;
                        CUdeviceptr kernel_arg_237939 = ext_mem_229265.mem;
                        CUdeviceptr kernel_arg_237940 = ext_mem_229362.mem;
                        CUdeviceptr kernel_arg_237941 = ext_mem_229363.mem;
                        CUdeviceptr kernel_arg_237942 = mem_229526.mem;
                        CUdeviceptr kernel_arg_237943 = mem_229531.mem;
                        CUdeviceptr kernel_arg_237944 = mem_230450.mem;
                        CUdeviceptr kernel_arg_237945 = mem_230455.mem;
                        unsigned int shared_offset_237925 = 0;
                        unsigned int shared_offset_237927 = 0 +
                                     (shared_sizze_237924 + (8 -
                                                             shared_sizze_237924 %
                                                             8) % 8);
                        unsigned int shared_offset_237929 = 0 +
                                     (shared_sizze_237924 + (8 -
                                                             shared_sizze_237924 %
                                                             8) % 8) +
                                     (shared_sizze_237926 + (8 -
                                                             shared_sizze_237926 %
                                                             8) % 8);
                        unsigned int shared_offset_237931 = 0 +
                                     (shared_sizze_237924 + (8 -
                                                             shared_sizze_237924 %
                                                             8) % 8) +
                                     (shared_sizze_237926 + (8 -
                                                             shared_sizze_237926 %
                                                             8) % 8) +
                                     (shared_sizze_237928 + (8 -
                                                             shared_sizze_237928 %
                                                             8) % 8);
                        unsigned int shared_offset_237933 = 0 +
                                     (shared_sizze_237924 + (8 -
                                                             shared_sizze_237924 %
                                                             8) % 8) +
                                     (shared_sizze_237926 + (8 -
                                                             shared_sizze_237926 %
                                                             8) % 8) +
                                     (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_237924 + (8 -
                                                             shared_sizze_237924 %
                                                             8) % 8) +
                                     (shared_sizze_237926 + (8 -
                                                             shared_sizze_237926 %
                                                             8) % 8) +
                                     (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_237924 + (8 -
                                                             shared_sizze_237924 %
                                                             8) % 8) +
                                     (shared_sizze_237926 + (8 -
                                                             shared_sizze_237926 %
                                                             8) % 8) +
                                     (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);
                        
                        if ((((((1 && nest_sizze_208848 != 0) && 1 != 0) && 1 !=
                               0) && q_s_203493 != 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_208848;
                            grid[perm[1]] = 1;
                            grid[perm[2]] = 1;
                            
                            void *kernel_args_237921[] = {&ctx->global_failure,
                                                          &shared_offset_237925,
                                                          &shared_offset_237927,
                                                          &shared_offset_237929,
                                                          &shared_offset_237931,
                                                          &shared_offset_237933,
                                                          &shared_offset_237935,
                                                          &shared_offset_237937,
                                                          &n_p_203492,
                                                          &q_s_203493,
                                                          &jump_s_203499,
                                                          &partition_sizze_203577,
                                                          &defunc_0_f_res_203631,
                                                          &pad_css_len_203632,
                                                          &s_n_m_203636,
                                                          &kernel_arg_237938,
                                                          &kernel_arg_237939,
                                                          &kernel_arg_237940,
                                                          &kernel_arg_237941,
                                                          &kernel_arg_237942,
                                                          &kernel_arg_237943,
                                                          &kernel_arg_237944,
                                                          &kernel_arg_237945};
                            int64_t time_start_237922 = 0, time_end_237923 = 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_217504",
                                        (long) nest_sizze_208848, (long) 1,
                                        (long) 1, (long) q_s_203493, (long) 1,
                                        (long) 1, (int) (0 +
                                                         (shared_sizze_237924 +
                                                          (8 -
                                                           shared_sizze_237924 %
                                                           8) % 8) +
                                                         (shared_sizze_237926 +
                                                          (8 -
                                                           shared_sizze_237926 %
                                                           8) % 8) +
                                                         (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)));
                                time_start_237922 = get_wall_time();
                            }
                            
                            cudaEvent_t *pevents = NULL;
                            
                            if (ctx->profiling && !ctx->profiling_paused) {
                                pevents = cuda_get_events(&ctx->cuda,
                                                          &ctx->mainzisegmap_intragroup_217504_runs,
                                                          &ctx->mainzisegmap_intragroup_217504_total_runtime);
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                   0));
                            }
                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_intragroup_217504,
                                                                  grid[0],
                                                                  grid[1],
                                                                  grid[2],
                                                                  q_s_203493, 1,
                                                                  1, 0 +
                                                                  (shared_sizze_237924 +
                                                                   (8 -
                                                                    shared_sizze_237924 %
                                                                    8) % 8) +
                                                                  (shared_sizze_237926 +
                                                                   (8 -
                                                                    shared_sizze_237926 %
                                                                    8) % 8) +
                                                                  (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),
                                                                  NULL,
                                                                  kernel_args_237921,
                                                                  NULL));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                            if (ctx->debugging) {
                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                time_end_237923 = get_wall_time();
                                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                        "main.segmap_intragroup_217504",
                                        time_end_237923 - time_start_237922);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_set_device(ctx, &ext_mem_230483,
                                                &mem_230450, "mem_230450") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_230482,
                                                &mem_230455, "mem_230455") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230455,
                                                  "mem_230455") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230450,
                                                  "mem_230450") != 0)
                            return 1;
                    } else {
                        struct memblock_device mem_230476;
                        
                        mem_230476.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230476,
                                                  bytes_229297, "mem_230476")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_230481;
                        
                        mem_230481.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230481,
                                                  bytes_229297, "mem_230481")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        
                        unsigned int shared_sizze_237949 = (int64_t) 8 *
                                     q_s_203493;
                        unsigned int shared_sizze_237951 = (int64_t) 8 *
                                     q_s_203493;
                        unsigned int shared_sizze_237953 = (int64_t) 8 *
                                     q_s_203493;
                        unsigned int shared_sizze_237955 = (int64_t) 8 *
                                     q_s_203493;
                        unsigned int shared_sizze_237957 = (int64_t) 8 *
                                     q_s_203493;
                        unsigned int shared_sizze_237959 = (int64_t) 8 *
                                     q_s_203493;
                        unsigned int shared_sizze_237961 = (int64_t) 8 *
                                     q_s_203493;
                        unsigned int shared_sizze_237963 = bytes_230429;
                        unsigned int shared_sizze_237965 = bytes_230429;
                        unsigned int shared_sizze_237967 = bytes_230429;
                        unsigned int shared_sizze_237969 = bytes_230429;
                        CUdeviceptr kernel_arg_237971 = ext_mem_229264.mem;
                        CUdeviceptr kernel_arg_237972 = ext_mem_229265.mem;
                        CUdeviceptr kernel_arg_237973 = ext_mem_229362.mem;
                        CUdeviceptr kernel_arg_237974 = ext_mem_229363.mem;
                        CUdeviceptr kernel_arg_237975 = mem_229526.mem;
                        CUdeviceptr kernel_arg_237976 = mem_229531.mem;
                        CUdeviceptr kernel_arg_237977 = mem_230476.mem;
                        CUdeviceptr kernel_arg_237978 = mem_230481.mem;
                        unsigned int shared_offset_237950 = 0;
                        unsigned int shared_offset_237952 = 0 +
                                     (shared_sizze_237949 + (8 -
                                                             shared_sizze_237949 %
                                                             8) % 8);
                        unsigned int shared_offset_237954 = 0 +
                                     (shared_sizze_237949 + (8 -
                                                             shared_sizze_237949 %
                                                             8) % 8) +
                                     (shared_sizze_237951 + (8 -
                                                             shared_sizze_237951 %
                                                             8) % 8);
                        unsigned int shared_offset_237956 = 0 +
                                     (shared_sizze_237949 + (8 -
                                                             shared_sizze_237949 %
                                                             8) % 8) +
                                     (shared_sizze_237951 + (8 -
                                                             shared_sizze_237951 %
                                                             8) % 8) +
                                     (shared_sizze_237953 + (8 -
                                                             shared_sizze_237953 %
                                                             8) % 8);
                        unsigned int shared_offset_237958 = 0 +
                                     (shared_sizze_237949 + (8 -
                                                             shared_sizze_237949 %
                                                             8) % 8) +
                                     (shared_sizze_237951 + (8 -
                                                             shared_sizze_237951 %
                                                             8) % 8) +
                                     (shared_sizze_237953 + (8 -
                                                             shared_sizze_237953 %
                                                             8) % 8) +
                                     (shared_sizze_237955 + (8 -
                                                             shared_sizze_237955 %
                                                             8) % 8);
                        unsigned int shared_offset_237960 = 0 +
                                     (shared_sizze_237949 + (8 -
                                                             shared_sizze_237949 %
                                                             8) % 8) +
                                     (shared_sizze_237951 + (8 -
                                                             shared_sizze_237951 %
                                                             8) % 8) +
                                     (shared_sizze_237953 + (8 -
                                                             shared_sizze_237953 %
                                                             8) % 8) +
                                     (shared_sizze_237955 + (8 -
                                                             shared_sizze_237955 %
                                                             8) % 8) +
                                     (shared_sizze_237957 + (8 -
                                                             shared_sizze_237957 %
                                                             8) % 8);
                        unsigned int shared_offset_237962 = 0 +
                                     (shared_sizze_237949 + (8 -
                                                             shared_sizze_237949 %
                                                             8) % 8) +
                                     (shared_sizze_237951 + (8 -
                                                             shared_sizze_237951 %
                                                             8) % 8) +
                                     (shared_sizze_237953 + (8 -
                                                             shared_sizze_237953 %
                                                             8) % 8) +
                                     (shared_sizze_237955 + (8 -
                                                             shared_sizze_237955 %
                                                             8) % 8) +
                                     (shared_sizze_237957 + (8 -
                                                             shared_sizze_237957 %
                                                             8) % 8) +
                                     (shared_sizze_237959 + (8 -
                                                             shared_sizze_237959 %
                                                             8) % 8);
                        unsigned int shared_offset_237964 = 0 +
                                     (shared_sizze_237949 + (8 -
                                                             shared_sizze_237949 %
                                                             8) % 8) +
                                     (shared_sizze_237951 + (8 -
                                                             shared_sizze_237951 %
                                                             8) % 8) +
                                     (shared_sizze_237953 + (8 -
                                                             shared_sizze_237953 %
                                                             8) % 8) +
                                     (shared_sizze_237955 + (8 -
                                                             shared_sizze_237955 %
                                                             8) % 8) +
                                     (shared_sizze_237957 + (8 -
                                                             shared_sizze_237957 %
                                                             8) % 8) +
                                     (shared_sizze_237959 + (8 -
                                                             shared_sizze_237959 %
                                                             8) % 8) +
                                     (shared_sizze_237961 + (8 -
                                                             shared_sizze_237961 %
                                                             8) % 8);
                        unsigned int shared_offset_237966 = 0 +
                                     (shared_sizze_237949 + (8 -
                                                             shared_sizze_237949 %
                                                             8) % 8) +
                                     (shared_sizze_237951 + (8 -
                                                             shared_sizze_237951 %
                                                             8) % 8) +
                                     (shared_sizze_237953 + (8 -
                                                             shared_sizze_237953 %
                                                             8) % 8) +
                                     (shared_sizze_237955 + (8 -
                                                             shared_sizze_237955 %
                                                             8) % 8) +
                                     (shared_sizze_237957 + (8 -
                                                             shared_sizze_237957 %
                                                             8) % 8) +
                                     (shared_sizze_237959 + (8 -
                                                             shared_sizze_237959 %
                                                             8) % 8) +
                                     (shared_sizze_237961 + (8 -
                                                             shared_sizze_237961 %
                                                             8) % 8) +
                                     (shared_sizze_237963 + (8 -
                                                             shared_sizze_237963 %
                                                             8) % 8);
                        unsigned int shared_offset_237968 = 0 +
                                     (shared_sizze_237949 + (8 -
                                                             shared_sizze_237949 %
                                                             8) % 8) +
                                     (shared_sizze_237951 + (8 -
                                                             shared_sizze_237951 %
                                                             8) % 8) +
                                     (shared_sizze_237953 + (8 -
                                                             shared_sizze_237953 %
                                                             8) % 8) +
                                     (shared_sizze_237955 + (8 -
                                                             shared_sizze_237955 %
                                                             8) % 8) +
                                     (shared_sizze_237957 + (8 -
                                                             shared_sizze_237957 %
                                                             8) % 8) +
                                     (shared_sizze_237959 + (8 -
                                                             shared_sizze_237959 %
                                                             8) % 8) +
                                     (shared_sizze_237961 + (8 -
                                                             shared_sizze_237961 %
                                                             8) % 8) +
                                     (shared_sizze_237963 + (8 -
                                                             shared_sizze_237963 %
                                                             8) % 8) +
                                     (shared_sizze_237965 + (8 -
                                                             shared_sizze_237965 %
                                                             8) % 8);
                        unsigned int shared_offset_237970 = 0 +
                                     (shared_sizze_237949 + (8 -
                                                             shared_sizze_237949 %
                                                             8) % 8) +
                                     (shared_sizze_237951 + (8 -
                                                             shared_sizze_237951 %
                                                             8) % 8) +
                                     (shared_sizze_237953 + (8 -
                                                             shared_sizze_237953 %
                                                             8) % 8) +
                                     (shared_sizze_237955 + (8 -
                                                             shared_sizze_237955 %
                                                             8) % 8) +
                                     (shared_sizze_237957 + (8 -
                                                             shared_sizze_237957 %
                                                             8) % 8) +
                                     (shared_sizze_237959 + (8 -
                                                             shared_sizze_237959 %
                                                             8) % 8) +
                                     (shared_sizze_237961 + (8 -
                                                             shared_sizze_237961 %
                                                             8) % 8) +
                                     (shared_sizze_237963 + (8 -
                                                             shared_sizze_237963 %
                                                             8) % 8) +
                                     (shared_sizze_237965 + (8 -
                                                             shared_sizze_237965 %
                                                             8) % 8) +
                                     (shared_sizze_237967 + (8 -
                                                             shared_sizze_237967 %
                                                             8) % 8);
                        
                        if ((((((1 && nest_sizze_208848 != 0) && 1 != 0) && 1 !=
                               0) && q_s_203493 != 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_208848;
                            grid[perm[1]] = 1;
                            grid[perm[2]] = 1;
                            
                            void *kernel_args_237946[] = {&ctx->global_failure,
                                                          &shared_offset_237950,
                                                          &shared_offset_237952,
                                                          &shared_offset_237954,
                                                          &shared_offset_237956,
                                                          &shared_offset_237958,
                                                          &shared_offset_237960,
                                                          &shared_offset_237962,
                                                          &shared_offset_237964,
                                                          &shared_offset_237966,
                                                          &shared_offset_237968,
                                                          &shared_offset_237970,
                                                          &n_p_203492,
                                                          &q_s_203493,
                                                          &jump_s_203499,
                                                          &partition_sizze_203577,
                                                          &defunc_0_f_res_203631,
                                                          &pad_css_len_203632,
                                                          &s_n_m_203636,
                                                          &kernel_arg_237971,
                                                          &kernel_arg_237972,
                                                          &kernel_arg_237973,
                                                          &kernel_arg_237974,
                                                          &kernel_arg_237975,
                                                          &kernel_arg_237976,
                                                          &kernel_arg_237977,
                                                          &kernel_arg_237978};
                            int64_t time_start_237947 = 0, time_end_237948 = 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_217955",
                                        (long) nest_sizze_208848, (long) 1,
                                        (long) 1, (long) q_s_203493, (long) 1,
                                        (long) 1, (int) (0 +
                                                         (shared_sizze_237949 +
                                                          (8 -
                                                           shared_sizze_237949 %
                                                           8) % 8) +
                                                         (shared_sizze_237951 +
                                                          (8 -
                                                           shared_sizze_237951 %
                                                           8) % 8) +
                                                         (shared_sizze_237953 +
                                                          (8 -
                                                           shared_sizze_237953 %
                                                           8) % 8) +
                                                         (shared_sizze_237955 +
                                                          (8 -
                                                           shared_sizze_237955 %
                                                           8) % 8) +
                                                         (shared_sizze_237957 +
                                                          (8 -
                                                           shared_sizze_237957 %
                                                           8) % 8) +
                                                         (shared_sizze_237959 +
                                                          (8 -
                                                           shared_sizze_237959 %
                                                           8) % 8) +
                                                         (shared_sizze_237961 +
                                                          (8 -
                                                           shared_sizze_237961 %
                                                           8) % 8) +
                                                         (shared_sizze_237963 +
                                                          (8 -
                                                           shared_sizze_237963 %
                                                           8) % 8) +
                                                         (shared_sizze_237965 +
                                                          (8 -
                                                           shared_sizze_237965 %
                                                           8) % 8) +
                                                         (shared_sizze_237967 +
                                                          (8 -
                                                           shared_sizze_237967 %
                                                           8) % 8) +
                                                         (shared_sizze_237969 +
                                                          (8 -
                                                           shared_sizze_237969 %
                                                           8) % 8)));
                                time_start_237947 = get_wall_time();
                            }
                            
                            cudaEvent_t *pevents = NULL;
                            
                            if (ctx->profiling && !ctx->profiling_paused) {
                                pevents = cuda_get_events(&ctx->cuda,
                                                          &ctx->mainzisegmap_intragroup_217955_runs,
                                                          &ctx->mainzisegmap_intragroup_217955_total_runtime);
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                   0));
                            }
                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_intragroup_217955,
                                                                  grid[0],
                                                                  grid[1],
                                                                  grid[2],
                                                                  q_s_203493, 1,
                                                                  1, 0 +
                                                                  (shared_sizze_237949 +
                                                                   (8 -
                                                                    shared_sizze_237949 %
                                                                    8) % 8) +
                                                                  (shared_sizze_237951 +
                                                                   (8 -
                                                                    shared_sizze_237951 %
                                                                    8) % 8) +
                                                                  (shared_sizze_237953 +
                                                                   (8 -
                                                                    shared_sizze_237953 %
                                                                    8) % 8) +
                                                                  (shared_sizze_237955 +
                                                                   (8 -
                                                                    shared_sizze_237955 %
                                                                    8) % 8) +
                                                                  (shared_sizze_237957 +
                                                                   (8 -
                                                                    shared_sizze_237957 %
                                                                    8) % 8) +
                                                                  (shared_sizze_237959 +
                                                                   (8 -
                                                                    shared_sizze_237959 %
                                                                    8) % 8) +
                                                                  (shared_sizze_237961 +
                                                                   (8 -
                                                                    shared_sizze_237961 %
                                                                    8) % 8) +
                                                                  (shared_sizze_237963 +
                                                                   (8 -
                                                                    shared_sizze_237963 %
                                                                    8) % 8) +
                                                                  (shared_sizze_237965 +
                                                                   (8 -
                                                                    shared_sizze_237965 %
                                                                    8) % 8) +
                                                                  (shared_sizze_237967 +
                                                                   (8 -
                                                                    shared_sizze_237967 %
                                                                    8) % 8) +
                                                                  (shared_sizze_237969 +
                                                                   (8 -
                                                                    shared_sizze_237969 %
                                                                    8) % 8),
                                                                  NULL,
                                                                  kernel_args_237946,
                                                                  NULL));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                            if (ctx->debugging) {
                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                time_end_237948 = get_wall_time();
                                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                        "main.segmap_intragroup_217955",
                                        time_end_237948 - time_start_237947);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_set_device(ctx, &ext_mem_230483,
                                                &mem_230476, "mem_230476") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_230482,
                                                &mem_230481, "mem_230481") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230481,
                                                  "mem_230481") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230476,
                                                  "mem_230476") != 0)
                            return 1;
                    }
                    if (memblock_set_device(ctx, &ext_mem_230485,
                                            &ext_mem_230483,
                                            "ext_mem_230483") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_230484,
                                            &ext_mem_230482,
                                            "ext_mem_230482") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230482,
                                              "ext_mem_230482") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230483,
                                              "ext_mem_230483") != 0)
                        return 1;
                }
                if (memblock_set_device(ctx, &ext_mem_230487, &ext_mem_230485,
                                        "ext_mem_230485") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_230486, &ext_mem_230484,
                                        "ext_mem_230484") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_230484,
                                          "ext_mem_230484") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_230485,
                                          "ext_mem_230485") != 0)
                    return 1;
            }
            
            struct memblock_device ext_mem_230494;
            
            ext_mem_230494.references = NULL;
            if (cond_203635) {
                if (memblock_set_device(ctx, &ext_mem_230494, &ext_mem_230487,
                                        "ext_mem_230487") != 0)
                    return 1;
            } else {
                bool bounds_invalid_upwards_204971 = slt64(pad_css_len_203632,
                                                           (int64_t) 0);
                bool valid_204972 = !bounds_invalid_upwards_204971;
                bool range_valid_c_204973;
                
                if (!valid_204972) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Range ", (long long) (int64_t) 0, "..",
                                  (long long) (int64_t) 1, "..<",
                                  (long long) pad_css_len_203632,
                                  " is invalid.",
                                  "-> #0  /prelude/array.fut:90:3-10\n   #1  /prelude/array.fut:195:11-16\n   #2  utils.fut:6:3-16\n   #3  loess.fut:557:3-566:9\n   #4  stl.fut:220:31-96\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:219:23-221:48\n   #8  /prelude/soacs.fut:67:19-23\n   #9  /prelude/soacs.fut:67:3-37\n   #10 stl.fut:218:15-222:44\n   #11 stl.fut:415:61-429:75\n   #12 stl.fut:455:3-469:34\n   #13 stl.fut:439:1-469:34\n");
                    if (memblock_unref_device(ctx, &ext_mem_230494,
                                              "ext_mem_230494") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230486,
                                              "ext_mem_230486") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230487,
                                              "ext_mem_230487") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229515,
                                              "mem_param_229515") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229507,
                                              "mem_param_229507") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231517,
                                              "ext_mem_231517") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231518,
                                              "ext_mem_231518") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229493,
                                              "mem_param_229493") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229485,
                                              "mem_param_229485") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229477,
                                              "mem_param_229477") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231860,
                                              "ext_mem_231860") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231861,
                                              "ext_mem_231861") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231862,
                                              "ext_mem_231862") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230551, "mem_230551") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230534, "mem_230534") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230517, "mem_230517") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230500, "mem_230500") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229531, "mem_229531") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229526, "mem_229526") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229520, "mem_229520") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229469, "mem_229469") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229465, "mem_229465") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229460,
                                              "ext_mem_229460") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229461,
                                              "ext_mem_229461") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229411,
                                              "ext_mem_229411") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229412,
                                              "ext_mem_229412") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229362,
                                              "ext_mem_229362") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229363,
                                              "ext_mem_229363") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229264,
                                              "ext_mem_229264") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229265,
                                              "ext_mem_229265") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229206, "mem_229206") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229200, "mem_229200") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229196,
                                              "ext_mem_229196") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229197,
                                              "ext_mem_229197") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229164, "mem_229164") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229161, "mem_229161") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229157, "mem_229157") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229155, "mem_229155") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229152, "mem_229152") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229148, "mem_229148") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232249,
                                              "mem_out_232249") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232248,
                                              "mem_out_232248") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232247,
                                              "mem_out_232247") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                int64_t y_218405 = n_p_203492 * pad_css_len_203632;
                int64_t nest_sizze_218406 = partition_sizze_203577 * y_218405;
                int64_t segmap_group_sizze_218407;
                
                segmap_group_sizze_218407 =
                    *ctx->tuning_params.mainzisegmap_group_sizze_218115;
                
                int64_t segmap_usable_groups_218408 =
                        sdiv_up64(nest_sizze_218406, segmap_group_sizze_218407);
                struct memblock_device mem_230493;
                
                mem_230493.references = NULL;
                if (memblock_alloc_device(ctx, &mem_230493, bytes_230492,
                                          "mem_230493")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                
                CUdeviceptr kernel_arg_237982 = ext_mem_230486.mem;
                CUdeviceptr kernel_arg_237983 = ext_mem_230487.mem;
                CUdeviceptr kernel_arg_237984 = mem_230493.mem;
                
                if ((((((1 && segmap_usable_groups_218408 != 0) && 1 != 0) &&
                       1 != 0) && segmap_group_sizze_218407 != 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_218408;
                    grid[perm[1]] = 1;
                    grid[perm[2]] = 1;
                    
                    void *kernel_args_237979[] = {&ctx->global_failure,
                                                  &ctx->failure_is_an_option,
                                                  &ctx->global_failure_args,
                                                  &n_p_203492, &jump_s_203499,
                                                  &partition_sizze_203577,
                                                  &defunc_0_f_res_203631,
                                                  &pad_css_len_203632,
                                                  &s_n_m_203636,
                                                  &kernel_arg_237982,
                                                  &kernel_arg_237983,
                                                  &kernel_arg_237984};
                    int64_t time_start_237980 = 0, time_end_237981 = 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_218413",
                                (long) segmap_usable_groups_218408, (long) 1,
                                (long) 1, (long) segmap_group_sizze_218407,
                                (long) 1, (long) 1, (int) 0);
                        time_start_237980 = get_wall_time();
                    }
                    
                    cudaEvent_t *pevents = NULL;
                    
                    if (ctx->profiling && !ctx->profiling_paused) {
                        pevents = cuda_get_events(&ctx->cuda,
                                                  &ctx->mainzisegmap_218413_runs,
                                                  &ctx->mainzisegmap_218413_total_runtime);
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                    }
                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_218413,
                                                          grid[0], grid[1],
                                                          grid[2],
                                                          segmap_group_sizze_218407,
                                                          1, 1, 0, NULL,
                                                          kernel_args_237979,
                                                          NULL));
                    if (pevents != NULL)
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                    if (ctx->debugging) {
                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                        time_end_237981 = get_wall_time();
                        fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                "main.segmap_218413", time_end_237981 -
                                time_start_237980);
                    }
                }
                ctx->failure_is_an_option = 1;
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_set_device(ctx, &ext_mem_230494, &mem_230493,
                                        "mem_230493") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230493, "mem_230493") != 0)
                    return 1;
            }
            if (memblock_unref_device(ctx, &ext_mem_230486, "ext_mem_230486") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_230487, "ext_mem_230487") !=
                0)
                return 1;
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            
            CUdeviceptr kernel_arg_237988 = ext_mem_230494.mem;
            CUdeviceptr kernel_arg_237989 = mem_230500.mem;
            
            if ((((((1 && segmap_usable_groups_218558 != 0) && 1 != 0) && 1 !=
                   0) && segmap_group_sizze_218557 != 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_218558;
                grid[perm[1]] = 1;
                grid[perm[2]] = 1;
                
                void *kernel_args_237985[] = {&ctx->global_failure,
                                              &ctx->failure_is_an_option,
                                              &ctx->global_failure_args,
                                              &n_p_203492,
                                              &partition_sizze_203577,
                                              &C_len_203634,
                                              &css_results_l_204110,
                                              &kernel_arg_237988,
                                              &kernel_arg_237989};
                int64_t time_start_237986 = 0, time_end_237987 = 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_218562",
                            (long) segmap_usable_groups_218558, (long) 1,
                            (long) 1, (long) segmap_group_sizze_218557,
                            (long) 1, (long) 1, (int) 0);
                    time_start_237986 = get_wall_time();
                }
                
                cudaEvent_t *pevents = NULL;
                
                if (ctx->profiling && !ctx->profiling_paused) {
                    pevents = cuda_get_events(&ctx->cuda,
                                              &ctx->mainzisegmap_218562_runs,
                                              &ctx->mainzisegmap_218562_total_runtime);
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                }
                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_218562,
                                                      grid[0], grid[1], grid[2],
                                                      segmap_group_sizze_218557,
                                                      1, 1, 0, NULL,
                                                      kernel_args_237985,
                                                      NULL));
                if (pevents != NULL)
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                if (ctx->debugging) {
                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                    time_end_237987 = get_wall_time();
                    fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                            "main.segmap_218562", time_end_237987 -
                            time_start_237986);
                }
            }
            ctx->failure_is_an_option = 1;
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            if (memblock_unref_device(ctx, &ext_mem_230494, "ext_mem_230494") !=
                0)
                return 1;
            
            struct memblock_device ext_mem_230512;
            
            ext_mem_230512.references = NULL;
            
            int32_t local_memory_capacity_234294;
            
            local_memory_capacity_234294 = ctx->cuda.max_shared_memory;
            if (sle64((int64_t) 0,
                      sext_i32_i64(local_memory_capacity_234294)) &&
                suff_outer_par_218578) {
                struct memblock_device mem_230503;
                
                mem_230503.references = NULL;
                if (memblock_alloc_device(ctx, &mem_230503, binop_y_230498,
                                          "mem_230503")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhgpu_map_transpose_f64(ctx, mem_230503,
                                                          (int64_t) 0,
                                                          mem_230500,
                                                          (int64_t) 0,
                                                          (int64_t) 1,
                                                          C_len_203634,
                                                          partition_sizze_203577) !=
                    0) {
                    if (memblock_unref_device(ctx, &mem_230503, "mem_230503") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230512,
                                              "ext_mem_230512") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230494,
                                              "ext_mem_230494") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230486,
                                              "ext_mem_230486") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230487,
                                              "ext_mem_230487") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229515,
                                              "mem_param_229515") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229507,
                                              "mem_param_229507") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231517,
                                              "ext_mem_231517") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231518,
                                              "ext_mem_231518") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229493,
                                              "mem_param_229493") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229485,
                                              "mem_param_229485") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229477,
                                              "mem_param_229477") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231860,
                                              "ext_mem_231860") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231861,
                                              "ext_mem_231861") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231862,
                                              "ext_mem_231862") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230551, "mem_230551") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230534, "mem_230534") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230517, "mem_230517") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230500, "mem_230500") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229531, "mem_229531") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229526, "mem_229526") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229520, "mem_229520") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229469, "mem_229469") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229465, "mem_229465") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229460,
                                              "ext_mem_229460") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229461,
                                              "ext_mem_229461") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229411,
                                              "ext_mem_229411") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229412,
                                              "ext_mem_229412") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229362,
                                              "ext_mem_229362") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229363,
                                              "ext_mem_229363") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229264,
                                              "ext_mem_229264") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229265,
                                              "ext_mem_229265") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229206, "mem_229206") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229200, "mem_229200") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229196,
                                              "ext_mem_229196") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229197,
                                              "ext_mem_229197") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229164, "mem_229164") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229161, "mem_229161") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229157, "mem_229157") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229155, "mem_229155") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229152, "mem_229152") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229148, "mem_229148") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232249,
                                              "mem_out_232249") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232248,
                                              "mem_out_232248") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232247,
                                              "mem_out_232247") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_230507;
                
                mem_230507.references = NULL;
                if (memblock_alloc_device(ctx, &mem_230507, bytes_229180,
                                          "mem_230507")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                
                CUdeviceptr kernel_arg_237993 = mem_230503.mem;
                CUdeviceptr kernel_arg_237994 = mem_230507.mem;
                
                if ((((((1 && segmap_usable_groups_218595 != 0) && 1 != 0) &&
                       1 != 0) && segmap_group_sizze_218594 != 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_218595;
                    grid[perm[1]] = 1;
                    grid[perm[2]] = 1;
                    
                    void *kernel_args_237990[] = {&ctx->global_failure,
                                                  &n_p_203492,
                                                  &partition_sizze_203577,
                                                  &kernel_arg_237993,
                                                  &kernel_arg_237994};
                    int64_t time_start_237991 = 0, time_end_237992 = 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_218598",
                                (long) segmap_usable_groups_218595, (long) 1,
                                (long) 1, (long) segmap_group_sizze_218594,
                                (long) 1, (long) 1, (int) 0);
                        time_start_237991 = get_wall_time();
                    }
                    
                    cudaEvent_t *pevents = NULL;
                    
                    if (ctx->profiling && !ctx->profiling_paused) {
                        pevents = cuda_get_events(&ctx->cuda,
                                                  &ctx->mainzisegmap_218598_runs,
                                                  &ctx->mainzisegmap_218598_total_runtime);
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                    }
                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_218598,
                                                          grid[0], grid[1],
                                                          grid[2],
                                                          segmap_group_sizze_218594,
                                                          1, 1, 0, NULL,
                                                          kernel_args_237990,
                                                          NULL));
                    if (pevents != NULL)
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                    if (ctx->debugging) {
                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                        time_end_237992 = get_wall_time();
                        fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                "main.segmap_218598", time_end_237992 -
                                time_start_237991);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_unref_device(ctx, &mem_230503, "mem_230503") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_230512, &mem_230507,
                                        "mem_230507") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230507, "mem_230507") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230503, "mem_230503") != 0)
                    return 1;
            } else {
                struct memblock_device mem_230511;
                
                mem_230511.references = NULL;
                if (memblock_alloc_device(ctx, &mem_230511, bytes_229180,
                                          "mem_230511")) {
                    err = 1;
                    goto cleanup;
                }
                if (slt64(n_p_203492 * (int64_t) 2,
                          segred_group_sizze_218625)) {
                    int64_t segment_sizze_nonzzero_234226 = smax64((int64_t) 1,
                                                                   n_p_203492);
                    int64_t num_threads_234227 = num_groups_218626 *
                            segred_group_sizze_218625;
                    
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegRed-small");
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "num_segments",
                                (long long) partition_sizze_203577, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                (long long) n_p_203492, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "segments_per_group",
                                (long long) squot64(segred_group_sizze_218625,
                                                    segment_sizze_nonzzero_234226),
                                '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "required_groups",
                                (long long) sext_i64_i32(sdiv_up64(partition_sizze_203577,
                                                                   squot64(segred_group_sizze_218625,
                                                                           segment_sizze_nonzzero_234226))),
                                '\n');
                    
                    unsigned int shared_sizze_237998 = (int64_t) 8 *
                                 segred_group_sizze_218625;
                    CUdeviceptr kernel_arg_238000 = mem_230500.mem;
                    CUdeviceptr kernel_arg_238001 = mem_230511.mem;
                    unsigned int shared_offset_237999 = 0;
                    
                    if ((((((1 && num_groups_218626 != 0) && 1 != 0) && 1 !=
                           0) && segred_group_sizze_218625 != 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_218626;
                        grid[perm[1]] = 1;
                        grid[perm[2]] = 1;
                        
                        void *kernel_args_237995[] = {&ctx->global_failure,
                                                      &shared_offset_237999,
                                                      &n_p_203492,
                                                      &partition_sizze_203577,
                                                      &C_len_203634,
                                                      &num_groups_218626,
                                                      &segment_sizze_nonzzero_234226,
                                                      &kernel_arg_238000,
                                                      &kernel_arg_238001};
                        int64_t time_start_237996 = 0, time_end_237997 = 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_218631",
                                    (long) num_groups_218626, (long) 1,
                                    (long) 1, (long) segred_group_sizze_218625,
                                    (long) 1, (long) 1, (int) (0 +
                                                               (shared_sizze_237998 +
                                                                (8 -
                                                                 shared_sizze_237998 %
                                                                 8) % 8)));
                            time_start_237996 = get_wall_time();
                        }
                        
                        cudaEvent_t *pevents = NULL;
                        
                        if (ctx->profiling && !ctx->profiling_paused) {
                            pevents = cuda_get_events(&ctx->cuda,
                                                      &ctx->mainzisegred_small_218631_runs,
                                                      &ctx->mainzisegred_small_218631_total_runtime);
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                        }
                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_small_218631,
                                                              grid[0], grid[1],
                                                              grid[2],
                                                              segred_group_sizze_218625,
                                                              1, 1, 0 +
                                                              (shared_sizze_237998 +
                                                               (8 -
                                                                shared_sizze_237998 %
                                                                8) % 8), NULL,
                                                              kernel_args_237995,
                                                              NULL));
                        if (pevents != NULL)
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                        if (ctx->debugging) {
                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                            time_end_237997 = get_wall_time();
                            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                    "main.segred_small_218631",
                                    time_end_237997 - time_start_237996);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                } else {
                    int64_t groups_per_segment_234253 =
                            sdiv_up64(num_groups_218626, smax64((int64_t) 1,
                                                                partition_sizze_203577));
                    int64_t elements_per_thread_234254 = sdiv_up64(n_p_203492,
                                                                   segred_group_sizze_218625 *
                                                                   groups_per_segment_234253);
                    int64_t virt_num_groups_234255 = groups_per_segment_234253 *
                            partition_sizze_203577;
                    int64_t num_threads_234256 = num_groups_218626 *
                            segred_group_sizze_218625;
                    int64_t threads_per_segment_234257 =
                            groups_per_segment_234253 *
                            segred_group_sizze_218625;
                    
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegRed-large");
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "num_segments",
                                (long long) partition_sizze_203577, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                (long long) n_p_203492, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "virt_num_groups",
                                (long long) virt_num_groups_234255, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "num_groups",
                                (long long) num_groups_218626, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "group_size",
                                (long long) segred_group_sizze_218625, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "elems_per_thread",
                                (long long) elements_per_thread_234254, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "groups_per_segment",
                                (long long) groups_per_segment_234253, '\n');
                    
                    struct memblock_device segred_tmp_mem_234258;
                    
                    segred_tmp_mem_234258.references = NULL;
                    if (memblock_alloc_device(ctx, &segred_tmp_mem_234258,
                                              (int64_t) 8 *
                                              virt_num_groups_234255,
                                              "segred_tmp_mem_234258")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mainzicounter_mem_234260 =
                                           ctx->mainzicounter_mem_234260;
                    unsigned int shared_sizze_238006 = 1;
                    unsigned int shared_sizze_238008 = (int64_t) 8 *
                                 segred_group_sizze_218625;
                    CUdeviceptr kernel_arg_238010 = mem_230500.mem;
                    CUdeviceptr kernel_arg_238011 = mem_230511.mem;
                    CUdeviceptr kernel_arg_238012 = segred_tmp_mem_234258.mem;
                    CUdeviceptr kernel_arg_238013 =
                                mainzicounter_mem_234260.mem;
                    unsigned int shared_offset_238007 = 0;
                    unsigned int shared_offset_238009 = 0 +
                                 (shared_sizze_238006 + (8 -
                                                         shared_sizze_238006 %
                                                         8) % 8);
                    
                    if ((((((1 && num_groups_218626 != 0) && 1 != 0) && 1 !=
                           0) && segred_group_sizze_218625 != 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_218626;
                        grid[perm[1]] = 1;
                        grid[perm[2]] = 1;
                        
                        void *kernel_args_238003[] = {&ctx->global_failure,
                                                      &shared_offset_238007,
                                                      &shared_offset_238009,
                                                      &n_p_203492,
                                                      &partition_sizze_203577,
                                                      &C_len_203634,
                                                      &num_groups_218626,
                                                      &groups_per_segment_234253,
                                                      &elements_per_thread_234254,
                                                      &virt_num_groups_234255,
                                                      &threads_per_segment_234257,
                                                      &kernel_arg_238010,
                                                      &kernel_arg_238011,
                                                      &kernel_arg_238012,
                                                      &kernel_arg_238013};
                        int64_t time_start_238004 = 0, time_end_238005 = 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_218631",
                                    (long) num_groups_218626, (long) 1,
                                    (long) 1, (long) segred_group_sizze_218625,
                                    (long) 1, (long) 1, (int) (0 +
                                                               (shared_sizze_238006 +
                                                                (8 -
                                                                 shared_sizze_238006 %
                                                                 8) % 8) +
                                                               (shared_sizze_238008 +
                                                                (8 -
                                                                 shared_sizze_238008 %
                                                                 8) % 8)));
                            time_start_238004 = get_wall_time();
                        }
                        
                        cudaEvent_t *pevents = NULL;
                        
                        if (ctx->profiling && !ctx->profiling_paused) {
                            pevents = cuda_get_events(&ctx->cuda,
                                                      &ctx->mainzisegred_large_218631_runs,
                                                      &ctx->mainzisegred_large_218631_total_runtime);
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                        }
                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_large_218631,
                                                              grid[0], grid[1],
                                                              grid[2],
                                                              segred_group_sizze_218625,
                                                              1, 1, 0 +
                                                              (shared_sizze_238006 +
                                                               (8 -
                                                                shared_sizze_238006 %
                                                                8) % 8) +
                                                              (shared_sizze_238008 +
                                                               (8 -
                                                                shared_sizze_238008 %
                                                                8) % 8), NULL,
                                                              kernel_args_238003,
                                                              NULL));
                        if (pevents != NULL)
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                        if (ctx->debugging) {
                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                            time_end_238005 = get_wall_time();
                            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                    "main.segred_large_218631",
                                    time_end_238005 - time_start_238004);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    if (memblock_unref_device(ctx, &segred_tmp_mem_234258,
                                              "segred_tmp_mem_234258") != 0)
                        return 1;
                }
                if (memblock_set_device(ctx, &ext_mem_230512, &mem_230511,
                                        "mem_230511") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230511, "mem_230511") != 0)
                    return 1;
            }
            if (slt64((int64_t) 0, partition_sizze_203577 *
                      lifted_single_ma_l_arg_204134)) {
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegScan");
                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_234295 = sdiv_up64(partition_sizze_203577 *
                                                      lifted_single_ma_l_arg_204134,
                                                      segscan_group_sizze_218677 *
                                                      (int64_t) 11) *
                        segscan_group_sizze_218677;
                int64_t numGroups_234296 = sdiv_up64(partition_sizze_203577 *
                                                     lifted_single_ma_l_arg_204134,
                                                     segscan_group_sizze_218677 *
                                                     (int64_t) 11);
                struct memblock_device mainziid_counter_mem_234297 =
                                       ctx->mainziid_counter_mem_234297;
                struct memblock_device status_flags_mem_234299;
                
                status_flags_mem_234299.references = NULL;
                if (memblock_alloc_device(ctx, &status_flags_mem_234299,
                                          numGroups_234296,
                                          "status_flags_mem_234299")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device aggregates_mem_234301;
                
                aggregates_mem_234301.references = NULL;
                if (memblock_alloc_device(ctx, &aggregates_mem_234301,
                                          (int64_t) 8 * numGroups_234296,
                                          "aggregates_mem_234301")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device incprefixes_mem_234303;
                
                incprefixes_mem_234303.references = NULL;
                if (memblock_alloc_device(ctx, &incprefixes_mem_234303,
                                          (int64_t) 8 * numGroups_234296,
                                          "incprefixes_mem_234303")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhreplicate_i8(ctx, status_flags_mem_234299,
                                                 numGroups_234296,
                                                 (int8_t) 0) != 0) {
                    if (memblock_unref_device(ctx, &incprefixes_mem_234303,
                                              "incprefixes_mem_234303") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &aggregates_mem_234301,
                                              "aggregates_mem_234301") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &status_flags_mem_234299,
                                              "status_flags_mem_234299") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230512,
                                              "ext_mem_230512") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230494,
                                              "ext_mem_230494") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230486,
                                              "ext_mem_230486") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230487,
                                              "ext_mem_230487") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229515,
                                              "mem_param_229515") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229507,
                                              "mem_param_229507") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231517,
                                              "ext_mem_231517") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231518,
                                              "ext_mem_231518") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229493,
                                              "mem_param_229493") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229485,
                                              "mem_param_229485") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229477,
                                              "mem_param_229477") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231860,
                                              "ext_mem_231860") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231861,
                                              "ext_mem_231861") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231862,
                                              "ext_mem_231862") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230551, "mem_230551") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230534, "mem_230534") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230517, "mem_230517") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230500, "mem_230500") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229531, "mem_229531") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229526, "mem_229526") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229520, "mem_229520") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229469, "mem_229469") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229465, "mem_229465") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229460,
                                              "ext_mem_229460") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229461,
                                              "ext_mem_229461") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229411,
                                              "ext_mem_229411") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229412,
                                              "ext_mem_229412") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229362,
                                              "ext_mem_229362") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229363,
                                              "ext_mem_229363") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229264,
                                              "ext_mem_229264") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229265,
                                              "ext_mem_229265") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229206, "mem_229206") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229200, "mem_229200") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229196,
                                              "ext_mem_229196") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229197,
                                              "ext_mem_229197") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229164, "mem_229164") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229161, "mem_229161") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229157, "mem_229157") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229155, "mem_229155") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229152, "mem_229152") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229148, "mem_229148") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232249,
                                              "mem_out_232249") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232248,
                                              "mem_out_232248") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232247,
                                              "mem_out_232247") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                unsigned int shared_sizze_238018 = smax64(smax64((int64_t) 288,
                                                                 (int64_t) 8 *
                                                                 segscan_group_sizze_218677),
                                                          (int64_t) 11 *
                                                          segscan_group_sizze_218677 *
                                                          (int64_t) 8);
                CUdeviceptr kernel_arg_238020 = mem_230500.mem;
                CUdeviceptr kernel_arg_238021 = ext_mem_230512.mem;
                CUdeviceptr kernel_arg_238022 = mem_230517.mem;
                CUdeviceptr kernel_arg_238023 = mainziid_counter_mem_234297.mem;
                CUdeviceptr kernel_arg_238024 = status_flags_mem_234299.mem;
                CUdeviceptr kernel_arg_238025 = aggregates_mem_234301.mem;
                CUdeviceptr kernel_arg_238026 = incprefixes_mem_234303.mem;
                unsigned int shared_offset_238019 = 0;
                
                if ((((((1 && sdiv_up64(partition_sizze_203577 *
                                        lifted_single_ma_l_arg_204134,
                                        segscan_group_sizze_218677 *
                                        (int64_t) 11) != 0) && 1 != 0) && 1 !=
                       0) && segscan_group_sizze_218677 != 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_203577 *
                                              lifted_single_ma_l_arg_204134,
                                              segscan_group_sizze_218677 *
                                              (int64_t) 11);
                    grid[perm[1]] = 1;
                    grid[perm[2]] = 1;
                    
                    void *kernel_args_238015[] = {&ctx->global_failure,
                                                  &ctx->failure_is_an_option,
                                                  &ctx->global_failure_args,
                                                  &shared_offset_238019,
                                                  &n_p_203492, &i64_res_203507,
                                                  &partition_sizze_203577,
                                                  &C_len_203634,
                                                  &lifted_single_ma_l_arg_204134,
                                                  &kernel_arg_238020,
                                                  &kernel_arg_238021,
                                                  &kernel_arg_238022,
                                                  &kernel_arg_238023,
                                                  &kernel_arg_238024,
                                                  &kernel_arg_238025,
                                                  &kernel_arg_238026};
                    int64_t time_start_238016 = 0, time_end_238017 = 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_218683",
                                (long) sdiv_up64(partition_sizze_203577 *
                                                 lifted_single_ma_l_arg_204134,
                                                 segscan_group_sizze_218677 *
                                                 (int64_t) 11), (long) 1,
                                (long) 1, (long) segscan_group_sizze_218677,
                                (long) 1, (long) 1, (int) (0 +
                                                           (shared_sizze_238018 +
                                                            (8 -
                                                             shared_sizze_238018 %
                                                             8) % 8)));
                        time_start_238016 = get_wall_time();
                    }
                    
                    cudaEvent_t *pevents = NULL;
                    
                    if (ctx->profiling && !ctx->profiling_paused) {
                        pevents = cuda_get_events(&ctx->cuda,
                                                  &ctx->mainzisegscan_218683_runs,
                                                  &ctx->mainzisegscan_218683_total_runtime);
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                    }
                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegscan_218683,
                                                          grid[0], grid[1],
                                                          grid[2],
                                                          segscan_group_sizze_218677,
                                                          1, 1, 0 +
                                                          (shared_sizze_238018 +
                                                           (8 -
                                                            shared_sizze_238018 %
                                                            8) % 8), NULL,
                                                          kernel_args_238015,
                                                          NULL));
                    if (pevents != NULL)
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                    if (ctx->debugging) {
                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                        time_end_238017 = get_wall_time();
                        fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                "main.segscan_218683", time_end_238017 -
                                time_start_238016);
                    }
                }
                ctx->failure_is_an_option = 1;
                if (memblock_unref_device(ctx, &incprefixes_mem_234303,
                                          "incprefixes_mem_234303") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &aggregates_mem_234301,
                                          "aggregates_mem_234301") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &status_flags_mem_234299,
                                          "status_flags_mem_234299") != 0)
                    return 1;
            }
            if (memblock_unref_device(ctx, &ext_mem_230512, "ext_mem_230512") !=
                0)
                return 1;
            
            struct memblock_device ext_mem_230529;
            
            ext_mem_230529.references = NULL;
            
            int32_t local_memory_capacity_234475;
            
            local_memory_capacity_234475 = ctx->cuda.max_shared_memory;
            if (sle64((int64_t) 0,
                      sext_i32_i64(local_memory_capacity_234475)) &&
                suff_outer_par_218709) {
                struct memblock_device mem_230520;
                
                mem_230520.references = NULL;
                if (memblock_alloc_device(ctx, &mem_230520, binop_y_230515,
                                          "mem_230520")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhgpu_map_transpose_f64(ctx, mem_230520,
                                                          (int64_t) 0,
                                                          mem_230517,
                                                          (int64_t) 0,
                                                          (int64_t) 1,
                                                          lifted_single_ma_l_arg_204134,
                                                          partition_sizze_203577) !=
                    0) {
                    if (memblock_unref_device(ctx, &mem_230520, "mem_230520") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230529,
                                              "ext_mem_230529") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230512,
                                              "ext_mem_230512") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230494,
                                              "ext_mem_230494") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230486,
                                              "ext_mem_230486") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230487,
                                              "ext_mem_230487") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229515,
                                              "mem_param_229515") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229507,
                                              "mem_param_229507") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231517,
                                              "ext_mem_231517") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231518,
                                              "ext_mem_231518") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229493,
                                              "mem_param_229493") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229485,
                                              "mem_param_229485") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229477,
                                              "mem_param_229477") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231860,
                                              "ext_mem_231860") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231861,
                                              "ext_mem_231861") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231862,
                                              "ext_mem_231862") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230551, "mem_230551") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230534, "mem_230534") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230517, "mem_230517") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230500, "mem_230500") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229531, "mem_229531") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229526, "mem_229526") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229520, "mem_229520") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229469, "mem_229469") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229465, "mem_229465") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229460,
                                              "ext_mem_229460") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229461,
                                              "ext_mem_229461") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229411,
                                              "ext_mem_229411") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229412,
                                              "ext_mem_229412") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229362,
                                              "ext_mem_229362") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229363,
                                              "ext_mem_229363") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229264,
                                              "ext_mem_229264") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229265,
                                              "ext_mem_229265") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229206, "mem_229206") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229200, "mem_229200") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229196,
                                              "ext_mem_229196") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229197,
                                              "ext_mem_229197") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229164, "mem_229164") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229161, "mem_229161") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229157, "mem_229157") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229155, "mem_229155") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229152, "mem_229152") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229148, "mem_229148") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232249,
                                              "mem_out_232249") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232248,
                                              "mem_out_232248") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232247,
                                              "mem_out_232247") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_230524;
                
                mem_230524.references = NULL;
                if (memblock_alloc_device(ctx, &mem_230524, bytes_229180,
                                          "mem_230524")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                
                CUdeviceptr kernel_arg_238030 = mem_230520.mem;
                CUdeviceptr kernel_arg_238031 = mem_230524.mem;
                
                if ((((((1 && segmap_usable_groups_218726 != 0) && 1 != 0) &&
                       1 != 0) && segmap_group_sizze_218725 != 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_218726;
                    grid[perm[1]] = 1;
                    grid[perm[2]] = 1;
                    
                    void *kernel_args_238027[] = {&ctx->global_failure,
                                                  &n_p_203492,
                                                  &partition_sizze_203577,
                                                  &kernel_arg_238030,
                                                  &kernel_arg_238031};
                    int64_t time_start_238028 = 0, time_end_238029 = 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_218729",
                                (long) segmap_usable_groups_218726, (long) 1,
                                (long) 1, (long) segmap_group_sizze_218725,
                                (long) 1, (long) 1, (int) 0);
                        time_start_238028 = get_wall_time();
                    }
                    
                    cudaEvent_t *pevents = NULL;
                    
                    if (ctx->profiling && !ctx->profiling_paused) {
                        pevents = cuda_get_events(&ctx->cuda,
                                                  &ctx->mainzisegmap_218729_runs,
                                                  &ctx->mainzisegmap_218729_total_runtime);
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                    }
                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_218729,
                                                          grid[0], grid[1],
                                                          grid[2],
                                                          segmap_group_sizze_218725,
                                                          1, 1, 0, NULL,
                                                          kernel_args_238027,
                                                          NULL));
                    if (pevents != NULL)
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                    if (ctx->debugging) {
                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                        time_end_238029 = get_wall_time();
                        fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                "main.segmap_218729", time_end_238029 -
                                time_start_238028);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_unref_device(ctx, &mem_230520, "mem_230520") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_230529, &mem_230524,
                                        "mem_230524") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230524, "mem_230524") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230520, "mem_230520") != 0)
                    return 1;
            } else {
                struct memblock_device mem_230528;
                
                mem_230528.references = NULL;
                if (memblock_alloc_device(ctx, &mem_230528, bytes_229180,
                                          "mem_230528")) {
                    err = 1;
                    goto cleanup;
                }
                if (slt64(n_p_203492 * (int64_t) 2,
                          segred_group_sizze_218756)) {
                    int64_t segment_sizze_nonzzero_234407 = smax64((int64_t) 1,
                                                                   n_p_203492);
                    int64_t num_threads_234408 = num_groups_218757 *
                            segred_group_sizze_218756;
                    
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegRed-small");
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "num_segments",
                                (long long) partition_sizze_203577, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                (long long) n_p_203492, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "segments_per_group",
                                (long long) squot64(segred_group_sizze_218756,
                                                    segment_sizze_nonzzero_234407),
                                '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "required_groups",
                                (long long) sext_i64_i32(sdiv_up64(partition_sizze_203577,
                                                                   squot64(segred_group_sizze_218756,
                                                                           segment_sizze_nonzzero_234407))),
                                '\n');
                    
                    unsigned int shared_sizze_238035 = (int64_t) 8 *
                                 segred_group_sizze_218756;
                    CUdeviceptr kernel_arg_238037 = mem_230517.mem;
                    CUdeviceptr kernel_arg_238038 = mem_230528.mem;
                    unsigned int shared_offset_238036 = 0;
                    
                    if ((((((1 && num_groups_218757 != 0) && 1 != 0) && 1 !=
                           0) && segred_group_sizze_218756 != 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_218757;
                        grid[perm[1]] = 1;
                        grid[perm[2]] = 1;
                        
                        void *kernel_args_238032[] = {&ctx->global_failure,
                                                      &shared_offset_238036,
                                                      &n_p_203492,
                                                      &partition_sizze_203577,
                                                      &lifted_single_ma_l_arg_204134,
                                                      &num_groups_218757,
                                                      &segment_sizze_nonzzero_234407,
                                                      &kernel_arg_238037,
                                                      &kernel_arg_238038};
                        int64_t time_start_238033 = 0, time_end_238034 = 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_218762",
                                    (long) num_groups_218757, (long) 1,
                                    (long) 1, (long) segred_group_sizze_218756,
                                    (long) 1, (long) 1, (int) (0 +
                                                               (shared_sizze_238035 +
                                                                (8 -
                                                                 shared_sizze_238035 %
                                                                 8) % 8)));
                            time_start_238033 = get_wall_time();
                        }
                        
                        cudaEvent_t *pevents = NULL;
                        
                        if (ctx->profiling && !ctx->profiling_paused) {
                            pevents = cuda_get_events(&ctx->cuda,
                                                      &ctx->mainzisegred_small_218762_runs,
                                                      &ctx->mainzisegred_small_218762_total_runtime);
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                        }
                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_small_218762,
                                                              grid[0], grid[1],
                                                              grid[2],
                                                              segred_group_sizze_218756,
                                                              1, 1, 0 +
                                                              (shared_sizze_238035 +
                                                               (8 -
                                                                shared_sizze_238035 %
                                                                8) % 8), NULL,
                                                              kernel_args_238032,
                                                              NULL));
                        if (pevents != NULL)
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                        if (ctx->debugging) {
                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                            time_end_238034 = get_wall_time();
                            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                    "main.segred_small_218762",
                                    time_end_238034 - time_start_238033);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                } else {
                    int64_t groups_per_segment_234434 =
                            sdiv_up64(num_groups_218757, smax64((int64_t) 1,
                                                                partition_sizze_203577));
                    int64_t elements_per_thread_234435 = sdiv_up64(n_p_203492,
                                                                   segred_group_sizze_218756 *
                                                                   groups_per_segment_234434);
                    int64_t virt_num_groups_234436 = groups_per_segment_234434 *
                            partition_sizze_203577;
                    int64_t num_threads_234437 = num_groups_218757 *
                            segred_group_sizze_218756;
                    int64_t threads_per_segment_234438 =
                            groups_per_segment_234434 *
                            segred_group_sizze_218756;
                    
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegRed-large");
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "num_segments",
                                (long long) partition_sizze_203577, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                (long long) n_p_203492, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "virt_num_groups",
                                (long long) virt_num_groups_234436, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "num_groups",
                                (long long) num_groups_218757, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "group_size",
                                (long long) segred_group_sizze_218756, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "elems_per_thread",
                                (long long) elements_per_thread_234435, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "groups_per_segment",
                                (long long) groups_per_segment_234434, '\n');
                    
                    struct memblock_device segred_tmp_mem_234439;
                    
                    segred_tmp_mem_234439.references = NULL;
                    if (memblock_alloc_device(ctx, &segred_tmp_mem_234439,
                                              (int64_t) 8 *
                                              virt_num_groups_234436,
                                              "segred_tmp_mem_234439")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mainzicounter_mem_234441 =
                                           ctx->mainzicounter_mem_234441;
                    unsigned int shared_sizze_238043 = 1;
                    unsigned int shared_sizze_238045 = (int64_t) 8 *
                                 segred_group_sizze_218756;
                    CUdeviceptr kernel_arg_238047 = mem_230517.mem;
                    CUdeviceptr kernel_arg_238048 = mem_230528.mem;
                    CUdeviceptr kernel_arg_238049 = segred_tmp_mem_234439.mem;
                    CUdeviceptr kernel_arg_238050 =
                                mainzicounter_mem_234441.mem;
                    unsigned int shared_offset_238044 = 0;
                    unsigned int shared_offset_238046 = 0 +
                                 (shared_sizze_238043 + (8 -
                                                         shared_sizze_238043 %
                                                         8) % 8);
                    
                    if ((((((1 && num_groups_218757 != 0) && 1 != 0) && 1 !=
                           0) && segred_group_sizze_218756 != 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_218757;
                        grid[perm[1]] = 1;
                        grid[perm[2]] = 1;
                        
                        void *kernel_args_238040[] = {&ctx->global_failure,
                                                      &shared_offset_238044,
                                                      &shared_offset_238046,
                                                      &n_p_203492,
                                                      &partition_sizze_203577,
                                                      &lifted_single_ma_l_arg_204134,
                                                      &num_groups_218757,
                                                      &groups_per_segment_234434,
                                                      &elements_per_thread_234435,
                                                      &virt_num_groups_234436,
                                                      &threads_per_segment_234438,
                                                      &kernel_arg_238047,
                                                      &kernel_arg_238048,
                                                      &kernel_arg_238049,
                                                      &kernel_arg_238050};
                        int64_t time_start_238041 = 0, time_end_238042 = 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_218762",
                                    (long) num_groups_218757, (long) 1,
                                    (long) 1, (long) segred_group_sizze_218756,
                                    (long) 1, (long) 1, (int) (0 +
                                                               (shared_sizze_238043 +
                                                                (8 -
                                                                 shared_sizze_238043 %
                                                                 8) % 8) +
                                                               (shared_sizze_238045 +
                                                                (8 -
                                                                 shared_sizze_238045 %
                                                                 8) % 8)));
                            time_start_238041 = get_wall_time();
                        }
                        
                        cudaEvent_t *pevents = NULL;
                        
                        if (ctx->profiling && !ctx->profiling_paused) {
                            pevents = cuda_get_events(&ctx->cuda,
                                                      &ctx->mainzisegred_large_218762_runs,
                                                      &ctx->mainzisegred_large_218762_total_runtime);
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                        }
                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_large_218762,
                                                              grid[0], grid[1],
                                                              grid[2],
                                                              segred_group_sizze_218756,
                                                              1, 1, 0 +
                                                              (shared_sizze_238043 +
                                                               (8 -
                                                                shared_sizze_238043 %
                                                                8) % 8) +
                                                              (shared_sizze_238045 +
                                                               (8 -
                                                                shared_sizze_238045 %
                                                                8) % 8), NULL,
                                                              kernel_args_238040,
                                                              NULL));
                        if (pevents != NULL)
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                        if (ctx->debugging) {
                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                            time_end_238042 = get_wall_time();
                            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                    "main.segred_large_218762",
                                    time_end_238042 - time_start_238041);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    if (memblock_unref_device(ctx, &segred_tmp_mem_234439,
                                              "segred_tmp_mem_234439") != 0)
                        return 1;
                }
                if (memblock_set_device(ctx, &ext_mem_230529, &mem_230528,
                                        "mem_230528") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230528, "mem_230528") != 0)
                    return 1;
            }
            if (slt64((int64_t) 0, partition_sizze_203577 *
                      dyn_lifted_single_ma_l_arg_204144)) {
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegScan");
                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_234476 = sdiv_up64(partition_sizze_203577 *
                                                      dyn_lifted_single_ma_l_arg_204144,
                                                      segscan_group_sizze_218808 *
                                                      (int64_t) 11) *
                        segscan_group_sizze_218808;
                int64_t numGroups_234477 = sdiv_up64(partition_sizze_203577 *
                                                     dyn_lifted_single_ma_l_arg_204144,
                                                     segscan_group_sizze_218808 *
                                                     (int64_t) 11);
                struct memblock_device mainziid_counter_mem_234478 =
                                       ctx->mainziid_counter_mem_234478;
                struct memblock_device status_flags_mem_234480;
                
                status_flags_mem_234480.references = NULL;
                if (memblock_alloc_device(ctx, &status_flags_mem_234480,
                                          numGroups_234477,
                                          "status_flags_mem_234480")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device aggregates_mem_234482;
                
                aggregates_mem_234482.references = NULL;
                if (memblock_alloc_device(ctx, &aggregates_mem_234482,
                                          (int64_t) 8 * numGroups_234477,
                                          "aggregates_mem_234482")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device incprefixes_mem_234484;
                
                incprefixes_mem_234484.references = NULL;
                if (memblock_alloc_device(ctx, &incprefixes_mem_234484,
                                          (int64_t) 8 * numGroups_234477,
                                          "incprefixes_mem_234484")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhreplicate_i8(ctx, status_flags_mem_234480,
                                                 numGroups_234477,
                                                 (int8_t) 0) != 0) {
                    if (memblock_unref_device(ctx, &incprefixes_mem_234484,
                                              "incprefixes_mem_234484") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &aggregates_mem_234482,
                                              "aggregates_mem_234482") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &status_flags_mem_234480,
                                              "status_flags_mem_234480") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230529,
                                              "ext_mem_230529") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230512,
                                              "ext_mem_230512") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230494,
                                              "ext_mem_230494") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230486,
                                              "ext_mem_230486") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230487,
                                              "ext_mem_230487") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229515,
                                              "mem_param_229515") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229507,
                                              "mem_param_229507") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231517,
                                              "ext_mem_231517") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231518,
                                              "ext_mem_231518") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229493,
                                              "mem_param_229493") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229485,
                                              "mem_param_229485") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229477,
                                              "mem_param_229477") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231860,
                                              "ext_mem_231860") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231861,
                                              "ext_mem_231861") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231862,
                                              "ext_mem_231862") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230551, "mem_230551") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230534, "mem_230534") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230517, "mem_230517") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230500, "mem_230500") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229531, "mem_229531") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229526, "mem_229526") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229520, "mem_229520") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229469, "mem_229469") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229465, "mem_229465") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229460,
                                              "ext_mem_229460") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229461,
                                              "ext_mem_229461") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229411,
                                              "ext_mem_229411") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229412,
                                              "ext_mem_229412") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229362,
                                              "ext_mem_229362") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229363,
                                              "ext_mem_229363") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229264,
                                              "ext_mem_229264") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229265,
                                              "ext_mem_229265") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229206, "mem_229206") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229200, "mem_229200") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229196,
                                              "ext_mem_229196") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229197,
                                              "ext_mem_229197") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229164, "mem_229164") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229161, "mem_229161") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229157, "mem_229157") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229155, "mem_229155") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229152, "mem_229152") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229148, "mem_229148") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232249,
                                              "mem_out_232249") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232248,
                                              "mem_out_232248") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232247,
                                              "mem_out_232247") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                unsigned int shared_sizze_238055 = smax64(smax64((int64_t) 288,
                                                                 (int64_t) 8 *
                                                                 segscan_group_sizze_218808),
                                                          (int64_t) 11 *
                                                          segscan_group_sizze_218808 *
                                                          (int64_t) 8);
                CUdeviceptr kernel_arg_238057 = mem_230517.mem;
                CUdeviceptr kernel_arg_238058 = ext_mem_230529.mem;
                CUdeviceptr kernel_arg_238059 = mem_230534.mem;
                CUdeviceptr kernel_arg_238060 = mainziid_counter_mem_234478.mem;
                CUdeviceptr kernel_arg_238061 = status_flags_mem_234480.mem;
                CUdeviceptr kernel_arg_238062 = aggregates_mem_234482.mem;
                CUdeviceptr kernel_arg_238063 = incprefixes_mem_234484.mem;
                unsigned int shared_offset_238056 = 0;
                
                if ((((((1 && sdiv_up64(partition_sizze_203577 *
                                        dyn_lifted_single_ma_l_arg_204144,
                                        segscan_group_sizze_218808 *
                                        (int64_t) 11) != 0) && 1 != 0) && 1 !=
                       0) && segscan_group_sizze_218808 != 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_203577 *
                                              dyn_lifted_single_ma_l_arg_204144,
                                              segscan_group_sizze_218808 *
                                              (int64_t) 11);
                    grid[perm[1]] = 1;
                    grid[perm[2]] = 1;
                    
                    void *kernel_args_238052[] = {&ctx->global_failure,
                                                  &ctx->failure_is_an_option,
                                                  &ctx->global_failure_args,
                                                  &shared_offset_238056,
                                                  &n_p_203492, &i64_res_203507,
                                                  &partition_sizze_203577,
                                                  &lifted_single_ma_l_arg_204134,
                                                  &dyn_lifted_single_ma_l_arg_204144,
                                                  &kernel_arg_238057,
                                                  &kernel_arg_238058,
                                                  &kernel_arg_238059,
                                                  &kernel_arg_238060,
                                                  &kernel_arg_238061,
                                                  &kernel_arg_238062,
                                                  &kernel_arg_238063};
                    int64_t time_start_238053 = 0, time_end_238054 = 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_218814",
                                (long) sdiv_up64(partition_sizze_203577 *
                                                 dyn_lifted_single_ma_l_arg_204144,
                                                 segscan_group_sizze_218808 *
                                                 (int64_t) 11), (long) 1,
                                (long) 1, (long) segscan_group_sizze_218808,
                                (long) 1, (long) 1, (int) (0 +
                                                           (shared_sizze_238055 +
                                                            (8 -
                                                             shared_sizze_238055 %
                                                             8) % 8)));
                        time_start_238053 = get_wall_time();
                    }
                    
                    cudaEvent_t *pevents = NULL;
                    
                    if (ctx->profiling && !ctx->profiling_paused) {
                        pevents = cuda_get_events(&ctx->cuda,
                                                  &ctx->mainzisegscan_218814_runs,
                                                  &ctx->mainzisegscan_218814_total_runtime);
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                    }
                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegscan_218814,
                                                          grid[0], grid[1],
                                                          grid[2],
                                                          segscan_group_sizze_218808,
                                                          1, 1, 0 +
                                                          (shared_sizze_238055 +
                                                           (8 -
                                                            shared_sizze_238055 %
                                                            8) % 8), NULL,
                                                          kernel_args_238052,
                                                          NULL));
                    if (pevents != NULL)
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                    if (ctx->debugging) {
                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                        time_end_238054 = get_wall_time();
                        fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                "main.segscan_218814", time_end_238054 -
                                time_start_238053);
                    }
                }
                ctx->failure_is_an_option = 1;
                if (memblock_unref_device(ctx, &incprefixes_mem_234484,
                                          "incprefixes_mem_234484") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &aggregates_mem_234482,
                                          "aggregates_mem_234482") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &status_flags_mem_234480,
                                          "status_flags_mem_234480") != 0)
                    return 1;
            }
            if (memblock_unref_device(ctx, &ext_mem_230529, "ext_mem_230529") !=
                0)
                return 1;
            
            struct memblock_device ext_mem_230546;
            
            ext_mem_230546.references = NULL;
            
            int32_t local_memory_capacity_234656;
            
            local_memory_capacity_234656 = ctx->cuda.max_shared_memory;
            if (sle64((int64_t) 0,
                      sext_i32_i64(local_memory_capacity_234656)) &&
                suff_outer_par_218840) {
                struct memblock_device mem_230537;
                
                mem_230537.references = NULL;
                if (memblock_alloc_device(ctx, &mem_230537, binop_y_230532,
                                          "mem_230537")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhgpu_map_transpose_f64(ctx, mem_230537,
                                                          (int64_t) 0,
                                                          mem_230534,
                                                          (int64_t) 0,
                                                          (int64_t) 1,
                                                          dyn_lifted_single_ma_l_arg_204144,
                                                          partition_sizze_203577) !=
                    0) {
                    if (memblock_unref_device(ctx, &mem_230537, "mem_230537") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230546,
                                              "ext_mem_230546") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230529,
                                              "ext_mem_230529") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230512,
                                              "ext_mem_230512") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230494,
                                              "ext_mem_230494") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230486,
                                              "ext_mem_230486") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230487,
                                              "ext_mem_230487") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229515,
                                              "mem_param_229515") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229507,
                                              "mem_param_229507") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231517,
                                              "ext_mem_231517") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231518,
                                              "ext_mem_231518") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229493,
                                              "mem_param_229493") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229485,
                                              "mem_param_229485") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229477,
                                              "mem_param_229477") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231860,
                                              "ext_mem_231860") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231861,
                                              "ext_mem_231861") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231862,
                                              "ext_mem_231862") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230551, "mem_230551") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230534, "mem_230534") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230517, "mem_230517") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230500, "mem_230500") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229531, "mem_229531") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229526, "mem_229526") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229520, "mem_229520") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229469, "mem_229469") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229465, "mem_229465") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229460,
                                              "ext_mem_229460") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229461,
                                              "ext_mem_229461") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229411,
                                              "ext_mem_229411") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229412,
                                              "ext_mem_229412") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229362,
                                              "ext_mem_229362") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229363,
                                              "ext_mem_229363") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229264,
                                              "ext_mem_229264") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229265,
                                              "ext_mem_229265") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229206, "mem_229206") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229200, "mem_229200") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229196,
                                              "ext_mem_229196") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229197,
                                              "ext_mem_229197") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229164, "mem_229164") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229161, "mem_229161") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229157, "mem_229157") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229155, "mem_229155") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229152, "mem_229152") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229148, "mem_229148") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232249,
                                              "mem_out_232249") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232248,
                                              "mem_out_232248") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232247,
                                              "mem_out_232247") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_230541;
                
                mem_230541.references = NULL;
                if (memblock_alloc_device(ctx, &mem_230541, bytes_229180,
                                          "mem_230541")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                
                CUdeviceptr kernel_arg_238067 = mem_230537.mem;
                CUdeviceptr kernel_arg_238068 = mem_230541.mem;
                
                if ((((((1 && segmap_usable_groups_218857 != 0) && 1 != 0) &&
                       1 != 0) && segmap_group_sizze_218856 != 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_218857;
                    grid[perm[1]] = 1;
                    grid[perm[2]] = 1;
                    
                    void *kernel_args_238064[] = {&ctx->global_failure,
                                                  &partition_sizze_203577,
                                                  &kernel_arg_238067,
                                                  &kernel_arg_238068};
                    int64_t time_start_238065 = 0, time_end_238066 = 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_218860",
                                (long) segmap_usable_groups_218857, (long) 1,
                                (long) 1, (long) segmap_group_sizze_218856,
                                (long) 1, (long) 1, (int) 0);
                        time_start_238065 = get_wall_time();
                    }
                    
                    cudaEvent_t *pevents = NULL;
                    
                    if (ctx->profiling && !ctx->profiling_paused) {
                        pevents = cuda_get_events(&ctx->cuda,
                                                  &ctx->mainzisegmap_218860_runs,
                                                  &ctx->mainzisegmap_218860_total_runtime);
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                    }
                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_218860,
                                                          grid[0], grid[1],
                                                          grid[2],
                                                          segmap_group_sizze_218856,
                                                          1, 1, 0, NULL,
                                                          kernel_args_238064,
                                                          NULL));
                    if (pevents != NULL)
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                    if (ctx->debugging) {
                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                        time_end_238066 = get_wall_time();
                        fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                "main.segmap_218860", time_end_238066 -
                                time_start_238065);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_unref_device(ctx, &mem_230537, "mem_230537") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_230546, &mem_230541,
                                        "mem_230541") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230541, "mem_230541") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230537, "mem_230537") != 0)
                    return 1;
            } else {
                struct memblock_device mem_230545;
                
                mem_230545.references = NULL;
                if (memblock_alloc_device(ctx, &mem_230545, bytes_229180,
                                          "mem_230545")) {
                    err = 1;
                    goto cleanup;
                }
                if (slt64((int64_t) 6, segred_group_sizze_218887)) {
                    int64_t segment_sizze_nonzzero_234588 = smax64((int64_t) 1,
                                                                   (int64_t) 3);
                    int64_t num_threads_234589 = num_groups_218888 *
                            segred_group_sizze_218887;
                    
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegRed-small");
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "num_segments",
                                (long long) partition_sizze_203577, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                (long long) (int64_t) 3, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "segments_per_group",
                                (long long) squot64(segred_group_sizze_218887,
                                                    segment_sizze_nonzzero_234588),
                                '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "required_groups",
                                (long long) sext_i64_i32(sdiv_up64(partition_sizze_203577,
                                                                   squot64(segred_group_sizze_218887,
                                                                           segment_sizze_nonzzero_234588))),
                                '\n');
                    
                    unsigned int shared_sizze_238072 = (int64_t) 8 *
                                 segred_group_sizze_218887;
                    CUdeviceptr kernel_arg_238074 = mem_230534.mem;
                    CUdeviceptr kernel_arg_238075 = mem_230545.mem;
                    unsigned int shared_offset_238073 = 0;
                    
                    if ((((((1 && num_groups_218888 != 0) && 1 != 0) && 1 !=
                           0) && segred_group_sizze_218887 != 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_218888;
                        grid[perm[1]] = 1;
                        grid[perm[2]] = 1;
                        
                        void *kernel_args_238069[] = {&ctx->global_failure,
                                                      &shared_offset_238073,
                                                      &partition_sizze_203577,
                                                      &dyn_lifted_single_ma_l_arg_204144,
                                                      &num_groups_218888,
                                                      &segment_sizze_nonzzero_234588,
                                                      &kernel_arg_238074,
                                                      &kernel_arg_238075};
                        int64_t time_start_238070 = 0, time_end_238071 = 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_218893",
                                    (long) num_groups_218888, (long) 1,
                                    (long) 1, (long) segred_group_sizze_218887,
                                    (long) 1, (long) 1, (int) (0 +
                                                               (shared_sizze_238072 +
                                                                (8 -
                                                                 shared_sizze_238072 %
                                                                 8) % 8)));
                            time_start_238070 = get_wall_time();
                        }
                        
                        cudaEvent_t *pevents = NULL;
                        
                        if (ctx->profiling && !ctx->profiling_paused) {
                            pevents = cuda_get_events(&ctx->cuda,
                                                      &ctx->mainzisegred_small_218893_runs,
                                                      &ctx->mainzisegred_small_218893_total_runtime);
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                        }
                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_small_218893,
                                                              grid[0], grid[1],
                                                              grid[2],
                                                              segred_group_sizze_218887,
                                                              1, 1, 0 +
                                                              (shared_sizze_238072 +
                                                               (8 -
                                                                shared_sizze_238072 %
                                                                8) % 8), NULL,
                                                              kernel_args_238069,
                                                              NULL));
                        if (pevents != NULL)
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                        if (ctx->debugging) {
                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                            time_end_238071 = get_wall_time();
                            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                    "main.segred_small_218893",
                                    time_end_238071 - time_start_238070);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                } else {
                    int64_t groups_per_segment_234615 =
                            sdiv_up64(num_groups_218888, smax64((int64_t) 1,
                                                                partition_sizze_203577));
                    int64_t elements_per_thread_234616 = sdiv_up64((int64_t) 3,
                                                                   segred_group_sizze_218887 *
                                                                   groups_per_segment_234615);
                    int64_t virt_num_groups_234617 = groups_per_segment_234615 *
                            partition_sizze_203577;
                    int64_t num_threads_234618 = num_groups_218888 *
                            segred_group_sizze_218887;
                    int64_t threads_per_segment_234619 =
                            groups_per_segment_234615 *
                            segred_group_sizze_218887;
                    
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegRed-large");
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "num_segments",
                                (long long) partition_sizze_203577, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                (long long) (int64_t) 3, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "virt_num_groups",
                                (long long) virt_num_groups_234617, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "num_groups",
                                (long long) num_groups_218888, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "group_size",
                                (long long) segred_group_sizze_218887, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "elems_per_thread",
                                (long long) elements_per_thread_234616, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "groups_per_segment",
                                (long long) groups_per_segment_234615, '\n');
                    
                    struct memblock_device segred_tmp_mem_234620;
                    
                    segred_tmp_mem_234620.references = NULL;
                    if (memblock_alloc_device(ctx, &segred_tmp_mem_234620,
                                              (int64_t) 8 *
                                              virt_num_groups_234617,
                                              "segred_tmp_mem_234620")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mainzicounter_mem_234622 =
                                           ctx->mainzicounter_mem_234622;
                    unsigned int shared_sizze_238080 = 1;
                    unsigned int shared_sizze_238082 = (int64_t) 8 *
                                 segred_group_sizze_218887;
                    CUdeviceptr kernel_arg_238084 = mem_230534.mem;
                    CUdeviceptr kernel_arg_238085 = mem_230545.mem;
                    CUdeviceptr kernel_arg_238086 = segred_tmp_mem_234620.mem;
                    CUdeviceptr kernel_arg_238087 =
                                mainzicounter_mem_234622.mem;
                    unsigned int shared_offset_238081 = 0;
                    unsigned int shared_offset_238083 = 0 +
                                 (shared_sizze_238080 + (8 -
                                                         shared_sizze_238080 %
                                                         8) % 8);
                    
                    if ((((((1 && num_groups_218888 != 0) && 1 != 0) && 1 !=
                           0) && segred_group_sizze_218887 != 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_218888;
                        grid[perm[1]] = 1;
                        grid[perm[2]] = 1;
                        
                        void *kernel_args_238077[] = {&ctx->global_failure,
                                                      &shared_offset_238081,
                                                      &shared_offset_238083,
                                                      &partition_sizze_203577,
                                                      &dyn_lifted_single_ma_l_arg_204144,
                                                      &num_groups_218888,
                                                      &groups_per_segment_234615,
                                                      &elements_per_thread_234616,
                                                      &virt_num_groups_234617,
                                                      &threads_per_segment_234619,
                                                      &kernel_arg_238084,
                                                      &kernel_arg_238085,
                                                      &kernel_arg_238086,
                                                      &kernel_arg_238087};
                        int64_t time_start_238078 = 0, time_end_238079 = 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_218893",
                                    (long) num_groups_218888, (long) 1,
                                    (long) 1, (long) segred_group_sizze_218887,
                                    (long) 1, (long) 1, (int) (0 +
                                                               (shared_sizze_238080 +
                                                                (8 -
                                                                 shared_sizze_238080 %
                                                                 8) % 8) +
                                                               (shared_sizze_238082 +
                                                                (8 -
                                                                 shared_sizze_238082 %
                                                                 8) % 8)));
                            time_start_238078 = get_wall_time();
                        }
                        
                        cudaEvent_t *pevents = NULL;
                        
                        if (ctx->profiling && !ctx->profiling_paused) {
                            pevents = cuda_get_events(&ctx->cuda,
                                                      &ctx->mainzisegred_large_218893_runs,
                                                      &ctx->mainzisegred_large_218893_total_runtime);
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                        }
                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_large_218893,
                                                              grid[0], grid[1],
                                                              grid[2],
                                                              segred_group_sizze_218887,
                                                              1, 1, 0 +
                                                              (shared_sizze_238080 +
                                                               (8 -
                                                                shared_sizze_238080 %
                                                                8) % 8) +
                                                              (shared_sizze_238082 +
                                                               (8 -
                                                                shared_sizze_238082 %
                                                                8) % 8), NULL,
                                                              kernel_args_238077,
                                                              NULL));
                        if (pevents != NULL)
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                        if (ctx->debugging) {
                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                            time_end_238079 = get_wall_time();
                            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                    "main.segred_large_218893",
                                    time_end_238079 - time_start_238078);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    if (memblock_unref_device(ctx, &segred_tmp_mem_234620,
                                              "segred_tmp_mem_234620") != 0)
                        return 1;
                }
                if (memblock_set_device(ctx, &ext_mem_230546, &mem_230545,
                                        "mem_230545") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230545, "mem_230545") != 0)
                    return 1;
            }
            if (slt64((int64_t) 0, partition_sizze_203577 * n_203490)) {
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegScan");
                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_234657 = sdiv_up64(partition_sizze_203577 *
                                                      n_203490,
                                                      segscan_group_sizze_218939 *
                                                      (int64_t) 11) *
                        segscan_group_sizze_218939;
                int64_t numGroups_234658 = sdiv_up64(partition_sizze_203577 *
                                                     n_203490,
                                                     segscan_group_sizze_218939 *
                                                     (int64_t) 11);
                struct memblock_device mainziid_counter_mem_234659 =
                                       ctx->mainziid_counter_mem_234659;
                struct memblock_device status_flags_mem_234661;
                
                status_flags_mem_234661.references = NULL;
                if (memblock_alloc_device(ctx, &status_flags_mem_234661,
                                          numGroups_234658,
                                          "status_flags_mem_234661")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device aggregates_mem_234663;
                
                aggregates_mem_234663.references = NULL;
                if (memblock_alloc_device(ctx, &aggregates_mem_234663,
                                          (int64_t) 8 * numGroups_234658,
                                          "aggregates_mem_234663")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device incprefixes_mem_234665;
                
                incprefixes_mem_234665.references = NULL;
                if (memblock_alloc_device(ctx, &incprefixes_mem_234665,
                                          (int64_t) 8 * numGroups_234658,
                                          "incprefixes_mem_234665")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhreplicate_i8(ctx, status_flags_mem_234661,
                                                 numGroups_234658,
                                                 (int8_t) 0) != 0) {
                    if (memblock_unref_device(ctx, &incprefixes_mem_234665,
                                              "incprefixes_mem_234665") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &aggregates_mem_234663,
                                              "aggregates_mem_234663") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &status_flags_mem_234661,
                                              "status_flags_mem_234661") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230546,
                                              "ext_mem_230546") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230529,
                                              "ext_mem_230529") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230512,
                                              "ext_mem_230512") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230494,
                                              "ext_mem_230494") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230486,
                                              "ext_mem_230486") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230487,
                                              "ext_mem_230487") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229515,
                                              "mem_param_229515") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229507,
                                              "mem_param_229507") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231517,
                                              "ext_mem_231517") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231518,
                                              "ext_mem_231518") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229493,
                                              "mem_param_229493") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229485,
                                              "mem_param_229485") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229477,
                                              "mem_param_229477") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231860,
                                              "ext_mem_231860") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231861,
                                              "ext_mem_231861") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231862,
                                              "ext_mem_231862") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230551, "mem_230551") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230534, "mem_230534") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230517, "mem_230517") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230500, "mem_230500") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229531, "mem_229531") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229526, "mem_229526") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229520, "mem_229520") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229469, "mem_229469") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229465, "mem_229465") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229460,
                                              "ext_mem_229460") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229461,
                                              "ext_mem_229461") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229411,
                                              "ext_mem_229411") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229412,
                                              "ext_mem_229412") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229362,
                                              "ext_mem_229362") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229363,
                                              "ext_mem_229363") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229264,
                                              "ext_mem_229264") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229265,
                                              "ext_mem_229265") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229206, "mem_229206") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229200, "mem_229200") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229196,
                                              "ext_mem_229196") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229197,
                                              "ext_mem_229197") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229164, "mem_229164") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229161, "mem_229161") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229157, "mem_229157") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229155, "mem_229155") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229152, "mem_229152") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229148, "mem_229148") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232249,
                                              "mem_out_232249") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232248,
                                              "mem_out_232248") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232247,
                                              "mem_out_232247") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                unsigned int shared_sizze_238092 = smax64(smax64((int64_t) 288,
                                                                 (int64_t) 8 *
                                                                 segscan_group_sizze_218939),
                                                          (int64_t) 11 *
                                                          segscan_group_sizze_218939 *
                                                          (int64_t) 8);
                CUdeviceptr kernel_arg_238094 = mem_230534.mem;
                CUdeviceptr kernel_arg_238095 = ext_mem_230546.mem;
                CUdeviceptr kernel_arg_238096 = mem_230551.mem;
                CUdeviceptr kernel_arg_238097 = mainziid_counter_mem_234659.mem;
                CUdeviceptr kernel_arg_238098 = status_flags_mem_234661.mem;
                CUdeviceptr kernel_arg_238099 = aggregates_mem_234663.mem;
                CUdeviceptr kernel_arg_238100 = incprefixes_mem_234665.mem;
                unsigned int shared_offset_238093 = 0;
                
                if ((((((1 && sdiv_up64(partition_sizze_203577 * n_203490,
                                        segscan_group_sizze_218939 *
                                        (int64_t) 11) != 0) && 1 != 0) && 1 !=
                       0) && segscan_group_sizze_218939 != 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_203577 * n_203490,
                                              segscan_group_sizze_218939 *
                                              (int64_t) 11);
                    grid[perm[1]] = 1;
                    grid[perm[2]] = 1;
                    
                    void *kernel_args_238089[] = {&ctx->global_failure,
                                                  &ctx->failure_is_an_option,
                                                  &ctx->global_failure_args,
                                                  &shared_offset_238093,
                                                  &n_203490,
                                                  &partition_sizze_203577,
                                                  &dyn_lifted_single_ma_l_arg_204144,
                                                  &kernel_arg_238094,
                                                  &kernel_arg_238095,
                                                  &kernel_arg_238096,
                                                  &kernel_arg_238097,
                                                  &kernel_arg_238098,
                                                  &kernel_arg_238099,
                                                  &kernel_arg_238100};
                    int64_t time_start_238090 = 0, time_end_238091 = 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_218945",
                                (long) sdiv_up64(partition_sizze_203577 *
                                                 n_203490,
                                                 segscan_group_sizze_218939 *
                                                 (int64_t) 11), (long) 1,
                                (long) 1, (long) segscan_group_sizze_218939,
                                (long) 1, (long) 1, (int) (0 +
                                                           (shared_sizze_238092 +
                                                            (8 -
                                                             shared_sizze_238092 %
                                                             8) % 8)));
                        time_start_238090 = get_wall_time();
                    }
                    
                    cudaEvent_t *pevents = NULL;
                    
                    if (ctx->profiling && !ctx->profiling_paused) {
                        pevents = cuda_get_events(&ctx->cuda,
                                                  &ctx->mainzisegscan_218945_runs,
                                                  &ctx->mainzisegscan_218945_total_runtime);
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                    }
                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegscan_218945,
                                                          grid[0], grid[1],
                                                          grid[2],
                                                          segscan_group_sizze_218939,
                                                          1, 1, 0 +
                                                          (shared_sizze_238092 +
                                                           (8 -
                                                            shared_sizze_238092 %
                                                            8) % 8), NULL,
                                                          kernel_args_238089,
                                                          NULL));
                    if (pevents != NULL)
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                    if (ctx->debugging) {
                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                        time_end_238091 = get_wall_time();
                        fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                "main.segscan_218945", time_end_238091 -
                                time_start_238090);
                    }
                }
                ctx->failure_is_an_option = 1;
                if (memblock_unref_device(ctx, &incprefixes_mem_234665,
                                          "incprefixes_mem_234665") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &aggregates_mem_234663,
                                          "aggregates_mem_234663") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &status_flags_mem_234661,
                                          "status_flags_mem_234661") != 0)
                    return 1;
            }
            if (memblock_unref_device(ctx, &ext_mem_230546, "ext_mem_230546") !=
                0)
                return 1;
            
            struct memblock_device ext_mem_230908;
            
            ext_mem_230908.references = NULL;
            
            struct memblock_device ext_mem_230907;
            
            ext_mem_230907.references = NULL;
            if (cond_204160) {
                bool match_lit_205190 = (int64_t) 0 == d_l_203498;
                struct memblock_device ext_mem_230847;
                
                ext_mem_230847.references = NULL;
                
                struct memblock_device ext_mem_230846;
                
                ext_mem_230846.references = NULL;
                if (match_lit_205190) {
                    struct memblock_device mem_230555;
                    
                    mem_230555.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_230555, bytes_229378,
                                              "mem_230555")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (futrts_builtinzhreplicate_f64(ctx, mem_230555,
                                                      partition_sizze_203577 *
                                                      l_n_m_203643, 0.0) != 0) {
                        if (memblock_unref_device(ctx, &mem_230555,
                                                  "mem_230555") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230846,
                                                  "ext_mem_230846") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230847,
                                                  "ext_mem_230847") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230907,
                                                  "ext_mem_230907") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230908,
                                                  "ext_mem_230908") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230546,
                                                  "ext_mem_230546") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230529,
                                                  "ext_mem_230529") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230512,
                                                  "ext_mem_230512") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230494,
                                                  "ext_mem_230494") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230486,
                                                  "ext_mem_230486") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230487,
                                                  "ext_mem_230487") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229515,
                                                  "mem_param_229515") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229507,
                                                  "mem_param_229507") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231517,
                                                  "ext_mem_231517") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231518,
                                                  "ext_mem_231518") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229493,
                                                  "mem_param_229493") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229485,
                                                  "mem_param_229485") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229477,
                                                  "mem_param_229477") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231860,
                                                  "ext_mem_231860") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231861,
                                                  "ext_mem_231861") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231862,
                                                  "ext_mem_231862") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230551,
                                                  "mem_230551") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230534,
                                                  "mem_230534") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230517,
                                                  "mem_230517") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230500,
                                                  "mem_230500") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229531,
                                                  "mem_229531") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229526,
                                                  "mem_229526") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229520,
                                                  "mem_229520") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229469,
                                                  "mem_229469") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229465,
                                                  "mem_229465") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229460,
                                                  "ext_mem_229460") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229461,
                                                  "ext_mem_229461") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229411,
                                                  "ext_mem_229411") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229412,
                                                  "ext_mem_229412") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229362,
                                                  "ext_mem_229362") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229363,
                                                  "ext_mem_229363") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229264,
                                                  "ext_mem_229264") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229265,
                                                  "ext_mem_229265") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229206,
                                                  "mem_229206") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229200,
                                                  "mem_229200") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229196,
                                                  "ext_mem_229196") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229197,
                                                  "ext_mem_229197") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229164,
                                                  "mem_229164") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229161,
                                                  "mem_229161") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229157,
                                                  "mem_229157") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229155,
                                                  "mem_229155") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229152,
                                                  "mem_229152") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229148,
                                                  "mem_229148") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232249,
                                                  "mem_out_232249") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232248,
                                                  "mem_out_232248") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232247,
                                                  "mem_out_232247") != 0)
                            return 1;
                        err = 1;
                        goto cleanup;
                    }
                    
                    bool suff_outer_par_218971;
                    
                    suff_outer_par_218971 =
                        *ctx->tuning_params.mainzisuff_outer_par_22 <=
                        partition_sizze_203577;
                    if (ctx->logging)
                        fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                "main.suff_outer_par_22",
                                (long) partition_sizze_203577,
                                suff_outer_par_218971 ? "true" : "false");
                    
                    int64_t segmap_group_sizze_219044;
                    
                    segmap_group_sizze_219044 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_218975;
                    
                    int64_t num_groups_219045;
                    int32_t max_num_groups_234760;
                    
                    max_num_groups_234760 =
                        *ctx->tuning_params.mainzisegmap_num_groups_218977;
                    num_groups_219045 = sext_i64_i32(smax64((int64_t) 1,
                                                            smin64(sdiv_up64(partition_sizze_203577,
                                                                             segmap_group_sizze_219044),
                                                                   sext_i32_i64(max_num_groups_234760))));
                    
                    int64_t segmap_group_sizze_219425;
                    
                    segmap_group_sizze_219425 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_219116;
                    
                    bool suff_outer_par_219429;
                    
                    suff_outer_par_219429 =
                        *ctx->tuning_params.mainzisuff_outer_par_23 <=
                        nest_sizze_209492;
                    if (ctx->logging)
                        fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                "main.suff_outer_par_23",
                                (long) nest_sizze_209492,
                                suff_outer_par_219429 ? "true" : "false");
                    
                    int64_t nest_sizze_219507 = q_l_203495 * nest_sizze_209492;
                    int64_t segred_group_sizze_219508;
                    
                    segred_group_sizze_219508 =
                        *ctx->tuning_params.mainzisegred_group_sizze_219260;
                    
                    int64_t num_groups_219509;
                    int32_t max_num_groups_234761;
                    
                    max_num_groups_234761 =
                        *ctx->tuning_params.mainzisegred_num_groups_219262;
                    num_groups_219509 = sext_i64_i32(smax64((int64_t) 1,
                                                            smin64(sdiv_up64(nest_sizze_219507,
                                                                             segred_group_sizze_219508),
                                                                   sext_i32_i64(max_num_groups_234761))));
                    
                    int64_t segmap_group_sizze_219546;
                    
                    segmap_group_sizze_219546 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_219247;
                    
                    int64_t segred_group_sizze_219557;
                    
                    segred_group_sizze_219557 =
                        *ctx->tuning_params.mainzisegred_group_sizze_219193;
                    
                    int64_t num_groups_219558;
                    int32_t max_num_groups_234762;
                    
                    max_num_groups_234762 =
                        *ctx->tuning_params.mainzisegred_num_groups_219195;
                    num_groups_219558 = sext_i64_i32(smax64((int64_t) 1,
                                                            smin64(sdiv_up64(nest_sizze_219507,
                                                                             segred_group_sizze_219557),
                                                                   sext_i32_i64(max_num_groups_234762))));
                    
                    int64_t num_threads_232157 = segmap_group_sizze_219044 *
                            num_groups_219045;
                    int64_t total_sizze_232158 = bytes_229371 *
                            num_threads_232157;
                    struct memblock_device ext_mem_230613;
                    
                    ext_mem_230613.references = NULL;
                    
                    int32_t local_memory_capacity_234958;
                    
                    local_memory_capacity_234958 = ctx->cuda.max_shared_memory;
                    if ((sle64((int64_t) 0,
                               sext_i32_i64(local_memory_capacity_234958)) &&
                         sle64((int64_t) 0,
                               sext_i32_i64(local_memory_capacity_234958))) &&
                        suff_outer_par_218971) {
                        struct memblock_device mem_230558;
                        
                        mem_230558.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230558,
                                                  binop_y_229377,
                                                  "mem_230558")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                  mem_230558,
                                                                  (int64_t) 0,
                                                                  ext_mem_229412,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  l_n_m_203643,
                                                                  partition_sizze_203577) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_230558,
                                                      "mem_230558") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230613,
                                                      "ext_mem_230613") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230555,
                                                      "mem_230555") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230846,
                                                      "ext_mem_230846") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230847,
                                                      "ext_mem_230847") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230907,
                                                      "ext_mem_230907") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230908,
                                                      "ext_mem_230908") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230546,
                                                      "ext_mem_230546") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230529,
                                                      "ext_mem_230529") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230512,
                                                      "ext_mem_230512") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230494,
                                                      "ext_mem_230494") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230486,
                                                      "ext_mem_230486") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230487,
                                                      "ext_mem_230487") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229515,
                                                      "mem_param_229515") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229507,
                                                      "mem_param_229507") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231517,
                                                      "ext_mem_231517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231518,
                                                      "ext_mem_231518") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229493,
                                                      "mem_param_229493") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229485,
                                                      "mem_param_229485") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229477,
                                                      "mem_param_229477") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231860,
                                                      "ext_mem_231860") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231861,
                                                      "ext_mem_231861") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231862,
                                                      "ext_mem_231862") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230551,
                                                      "mem_230551") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230534,
                                                      "mem_230534") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230517,
                                                      "mem_230517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230500,
                                                      "mem_230500") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229531,
                                                      "mem_229531") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229526,
                                                      "mem_229526") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229520,
                                                      "mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229469,
                                                      "mem_229469") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229465,
                                                      "mem_229465") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229460,
                                                      "ext_mem_229460") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229461,
                                                      "ext_mem_229461") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229411,
                                                      "ext_mem_229411") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229412,
                                                      "ext_mem_229412") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229362,
                                                      "ext_mem_229362") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229363,
                                                      "ext_mem_229363") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229264,
                                                      "ext_mem_229264") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229265,
                                                      "ext_mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229206,
                                                      "mem_229206") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229200,
                                                      "mem_229200") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229196,
                                                      "ext_mem_229196") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229197,
                                                      "ext_mem_229197") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229164,
                                                      "mem_229164") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229161,
                                                      "mem_229161") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229157,
                                                      "mem_229157") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229155,
                                                      "mem_229155") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229152,
                                                      "mem_229152") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229148,
                                                      "mem_229148") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232249,
                                                      "mem_out_232249") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232248,
                                                      "mem_out_232248") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232247,
                                                      "mem_out_232247") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_230561;
                        
                        mem_230561.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230561,
                                                  binop_y_229377,
                                                  "mem_230561")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                  mem_230561,
                                                                  (int64_t) 0,
                                                                  ext_mem_229411,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  l_n_m_203643,
                                                                  partition_sizze_203577) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_230561,
                                                      "mem_230561") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230558,
                                                      "mem_230558") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230613,
                                                      "ext_mem_230613") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230555,
                                                      "mem_230555") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230846,
                                                      "ext_mem_230846") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230847,
                                                      "ext_mem_230847") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230907,
                                                      "ext_mem_230907") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230908,
                                                      "ext_mem_230908") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230546,
                                                      "ext_mem_230546") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230529,
                                                      "ext_mem_230529") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230512,
                                                      "ext_mem_230512") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230494,
                                                      "ext_mem_230494") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230486,
                                                      "ext_mem_230486") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230487,
                                                      "ext_mem_230487") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229515,
                                                      "mem_param_229515") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229507,
                                                      "mem_param_229507") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231517,
                                                      "ext_mem_231517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231518,
                                                      "ext_mem_231518") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229493,
                                                      "mem_param_229493") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229485,
                                                      "mem_param_229485") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229477,
                                                      "mem_param_229477") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231860,
                                                      "ext_mem_231860") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231861,
                                                      "ext_mem_231861") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231862,
                                                      "ext_mem_231862") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230551,
                                                      "mem_230551") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230534,
                                                      "mem_230534") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230517,
                                                      "mem_230517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230500,
                                                      "mem_230500") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229531,
                                                      "mem_229531") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229526,
                                                      "mem_229526") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229520,
                                                      "mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229469,
                                                      "mem_229469") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229465,
                                                      "mem_229465") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229460,
                                                      "ext_mem_229460") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229461,
                                                      "ext_mem_229461") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229411,
                                                      "ext_mem_229411") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229412,
                                                      "ext_mem_229412") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229362,
                                                      "ext_mem_229362") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229363,
                                                      "ext_mem_229363") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229264,
                                                      "ext_mem_229264") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229265,
                                                      "ext_mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229206,
                                                      "mem_229206") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229200,
                                                      "mem_229200") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229196,
                                                      "ext_mem_229196") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229197,
                                                      "ext_mem_229197") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229164,
                                                      "mem_229164") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229161,
                                                      "mem_229161") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229157,
                                                      "mem_229157") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229155,
                                                      "mem_229155") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229152,
                                                      "mem_229152") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229148,
                                                      "mem_229148") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232249,
                                                      "mem_out_232249") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232248,
                                                      "mem_out_232248") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232247,
                                                      "mem_out_232247") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_230564;
                        
                        mem_230564.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230564,
                                                  binop_y_229176,
                                                  "mem_230564")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        int64_t group_sizze_234766;
                        
                        group_sizze_234766 =
                            *ctx->tuning_params.mainzigroup_sizze_234766;
                        
                        int64_t num_groups_234767 =
                                sdiv_up64(partition_sizze_203577 * n_203490,
                                          group_sizze_234766);
                        CUdeviceptr kernel_arg_238104 = mem_param_229493.mem;
                        CUdeviceptr kernel_arg_238105 = mem_230564.mem;
                        
                        if ((((((1 && num_groups_234767 != 0) && 1 != 0) && 1 !=
                               0) && group_sizze_234766 != 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_234767;
                            grid[perm[1]] = 1;
                            grid[perm[2]] = 1;
                            
                            void *kernel_args_238101[] = {&n_203490,
                                                          &partition_sizze_203577,
                                                          &ctx_param_ext_229488,
                                                          &ctx_param_ext_229489,
                                                          &ctx_param_ext_229491,
                                                          &kernel_arg_238104,
                                                          &kernel_arg_238105};
                            int64_t time_start_238102 = 0, time_end_238103 = 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_234763",
                                        (long) num_groups_234767, (long) 1,
                                        (long) 1, (long) group_sizze_234766,
                                        (long) 1, (long) 1, (int) 0);
                                time_start_238102 = get_wall_time();
                            }
                            
                            cudaEvent_t *pevents = NULL;
                            
                            if (ctx->profiling && !ctx->profiling_paused) {
                                pevents = cuda_get_events(&ctx->cuda,
                                                          &ctx->mainzicopy_234763_runs,
                                                          &ctx->mainzicopy_234763_total_runtime);
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                   0));
                            }
                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzicopy_234763,
                                                                  grid[0],
                                                                  grid[1],
                                                                  grid[2],
                                                                  group_sizze_234766,
                                                                  1, 1, 0, NULL,
                                                                  kernel_args_238101,
                                                                  NULL));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                            if (ctx->debugging) {
                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                time_end_238103 = get_wall_time();
                                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                        "main.copy_234763", time_end_238103 -
                                        time_start_238102);
                            }
                        }
                        
                        struct memblock_device mem_230567;
                        
                        mem_230567.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230567,
                                                  binop_y_229176,
                                                  "mem_230567")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                  mem_230567,
                                                                  (int64_t) 0,
                                                                  mem_230551,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  n_203490,
                                                                  partition_sizze_203577) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_230567,
                                                      "mem_230567") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230564,
                                                      "mem_230564") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230561,
                                                      "mem_230561") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230558,
                                                      "mem_230558") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230613,
                                                      "ext_mem_230613") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230555,
                                                      "mem_230555") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230846,
                                                      "ext_mem_230846") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230847,
                                                      "ext_mem_230847") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230907,
                                                      "ext_mem_230907") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230908,
                                                      "ext_mem_230908") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230546,
                                                      "ext_mem_230546") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230529,
                                                      "ext_mem_230529") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230512,
                                                      "ext_mem_230512") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230494,
                                                      "ext_mem_230494") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230486,
                                                      "ext_mem_230486") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230487,
                                                      "ext_mem_230487") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229515,
                                                      "mem_param_229515") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229507,
                                                      "mem_param_229507") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231517,
                                                      "ext_mem_231517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231518,
                                                      "ext_mem_231518") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229493,
                                                      "mem_param_229493") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229485,
                                                      "mem_param_229485") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229477,
                                                      "mem_param_229477") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231860,
                                                      "ext_mem_231860") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231861,
                                                      "ext_mem_231861") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231862,
                                                      "ext_mem_231862") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230551,
                                                      "mem_230551") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230534,
                                                      "mem_230534") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230517,
                                                      "mem_230517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230500,
                                                      "mem_230500") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229531,
                                                      "mem_229531") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229526,
                                                      "mem_229526") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229520,
                                                      "mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229469,
                                                      "mem_229469") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229465,
                                                      "mem_229465") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229460,
                                                      "ext_mem_229460") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229461,
                                                      "ext_mem_229461") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229411,
                                                      "ext_mem_229411") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229412,
                                                      "ext_mem_229412") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229362,
                                                      "ext_mem_229362") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229363,
                                                      "ext_mem_229363") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229264,
                                                      "ext_mem_229264") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229265,
                                                      "ext_mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229206,
                                                      "mem_229206") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229200,
                                                      "mem_229200") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229196,
                                                      "ext_mem_229196") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229197,
                                                      "ext_mem_229197") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229164,
                                                      "mem_229164") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229161,
                                                      "mem_229161") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229157,
                                                      "mem_229157") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229155,
                                                      "mem_229155") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229152,
                                                      "mem_229152") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229148,
                                                      "mem_229148") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232249,
                                                      "mem_out_232249") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232248,
                                                      "mem_out_232248") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232247,
                                                      "mem_out_232247") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_230586;
                        
                        mem_230586.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230586,
                                                  binop_y_229377,
                                                  "mem_230586")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device color_232027;
                        
                        color_232027.references = NULL;
                        if (memblock_alloc_device(ctx, &color_232027,
                                                  total_sizze_232158,
                                                  "color_232027")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        
                        CUdeviceptr kernel_arg_238109 = mem_230558.mem;
                        CUdeviceptr kernel_arg_238110 = mem_230561.mem;
                        CUdeviceptr kernel_arg_238111 = mem_230564.mem;
                        CUdeviceptr kernel_arg_238112 = mem_230567.mem;
                        CUdeviceptr kernel_arg_238113 = mem_230586.mem;
                        CUdeviceptr kernel_arg_238114 = color_232027.mem;
                        
                        if ((((((1 && num_groups_219045 != 0) && 1 != 0) && 1 !=
                               0) && segmap_group_sizze_219044 != 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_219045;
                            grid[perm[1]] = 1;
                            grid[perm[2]] = 1;
                            
                            void *kernel_args_238106[] = {&ctx->global_failure,
                                                          &n_203490,
                                                          &q_l_203495,
                                                          &jump_t_203500,
                                                          &partition_sizze_203577,
                                                          &l_n_m_203643,
                                                          &i_203670,
                                                          &num_groups_219045,
                                                          &num_threads_232157,
                                                          &kernel_arg_238109,
                                                          &kernel_arg_238110,
                                                          &kernel_arg_238111,
                                                          &kernel_arg_238112,
                                                          &kernel_arg_238113,
                                                          &kernel_arg_238114};
                            int64_t time_start_238107 = 0, time_end_238108 = 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_219049",
                                        (long) num_groups_219045, (long) 1,
                                        (long) 1,
                                        (long) segmap_group_sizze_219044,
                                        (long) 1, (long) 1, (int) 0);
                                time_start_238107 = get_wall_time();
                            }
                            
                            cudaEvent_t *pevents = NULL;
                            
                            if (ctx->profiling && !ctx->profiling_paused) {
                                pevents = cuda_get_events(&ctx->cuda,
                                                          &ctx->mainzisegmap_219049_runs,
                                                          &ctx->mainzisegmap_219049_total_runtime);
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                   0));
                            }
                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_219049,
                                                                  grid[0],
                                                                  grid[1],
                                                                  grid[2],
                                                                  segmap_group_sizze_219044,
                                                                  1, 1, 0, NULL,
                                                                  kernel_args_238106,
                                                                  NULL));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                            if (ctx->debugging) {
                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                time_end_238108 = get_wall_time();
                                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                        "main.segmap_219049", time_end_238108 -
                                        time_start_238107);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_unref_device(ctx, &mem_230558,
                                                  "mem_230558") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230561,
                                                  "mem_230561") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230564,
                                                  "mem_230564") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230567,
                                                  "mem_230567") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_232027,
                                                  "color_232027") != 0)
                            return 1;
                        
                        struct memblock_device mem_230611;
                        
                        mem_230611.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230611,
                                                  bytes_229378, "mem_230611")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                  mem_230611,
                                                                  (int64_t) 0,
                                                                  mem_230586,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  partition_sizze_203577,
                                                                  l_n_m_203643) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_230611,
                                                      "mem_230611") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232027,
                                                      "color_232027") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230586,
                                                      "mem_230586") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230567,
                                                      "mem_230567") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230564,
                                                      "mem_230564") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230561,
                                                      "mem_230561") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230558,
                                                      "mem_230558") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230613,
                                                      "ext_mem_230613") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230555,
                                                      "mem_230555") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230846,
                                                      "ext_mem_230846") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230847,
                                                      "ext_mem_230847") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230907,
                                                      "ext_mem_230907") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230908,
                                                      "ext_mem_230908") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230546,
                                                      "ext_mem_230546") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230529,
                                                      "ext_mem_230529") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230512,
                                                      "ext_mem_230512") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230494,
                                                      "ext_mem_230494") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230486,
                                                      "ext_mem_230486") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230487,
                                                      "ext_mem_230487") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229515,
                                                      "mem_param_229515") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229507,
                                                      "mem_param_229507") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231517,
                                                      "ext_mem_231517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231518,
                                                      "ext_mem_231518") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229493,
                                                      "mem_param_229493") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229485,
                                                      "mem_param_229485") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229477,
                                                      "mem_param_229477") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231860,
                                                      "ext_mem_231860") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231861,
                                                      "ext_mem_231861") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231862,
                                                      "ext_mem_231862") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230551,
                                                      "mem_230551") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230534,
                                                      "mem_230534") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230517,
                                                      "mem_230517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230500,
                                                      "mem_230500") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229531,
                                                      "mem_229531") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229526,
                                                      "mem_229526") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229520,
                                                      "mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229469,
                                                      "mem_229469") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229465,
                                                      "mem_229465") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229460,
                                                      "ext_mem_229460") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229461,
                                                      "ext_mem_229461") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229411,
                                                      "ext_mem_229411") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229412,
                                                      "ext_mem_229412") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229362,
                                                      "ext_mem_229362") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229363,
                                                      "ext_mem_229363") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229264,
                                                      "ext_mem_229264") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229265,
                                                      "ext_mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229206,
                                                      "mem_229206") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229200,
                                                      "mem_229200") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229196,
                                                      "ext_mem_229196") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229197,
                                                      "ext_mem_229197") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229164,
                                                      "mem_229164") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229161,
                                                      "mem_229161") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229157,
                                                      "mem_229157") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229155,
                                                      "mem_229155") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229152,
                                                      "mem_229152") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229148,
                                                      "mem_229148") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232249,
                                                      "mem_out_232249") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232248,
                                                      "mem_out_232248") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232247,
                                                      "mem_out_232247") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        if (memblock_unref_device(ctx, &mem_230586,
                                                  "mem_230586") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_230613,
                                                &mem_230611, "mem_230611") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230611,
                                                  "mem_230611") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_232027,
                                                  "color_232027") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230586,
                                                  "mem_230586") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230567,
                                                  "mem_230567") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230564,
                                                  "mem_230564") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230561,
                                                  "mem_230561") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230558,
                                                  "mem_230558") != 0)
                            return 1;
                    } else {
                        int64_t segmap_usable_groups_219426 =
                                sdiv_up64(nest_sizze_209492,
                                          segmap_group_sizze_219425);
                        struct memblock_device ext_mem_230607;
                        
                        ext_mem_230607.references = NULL;
                        
                        int32_t local_memory_capacity_234957;
                        
                        local_memory_capacity_234957 =
                            ctx->cuda.max_shared_memory;
                        if (sle64((int64_t) 0,
                                  sext_i32_i64(local_memory_capacity_234957)) &&
                            suff_outer_par_219429) {
                            struct memblock_device mem_230591;
                            
                            mem_230591.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230591,
                                                      bytes_229378,
                                                      "mem_230591")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            
                            CUdeviceptr kernel_arg_238118 = ext_mem_229411.mem;
                            CUdeviceptr kernel_arg_238119 = ext_mem_229412.mem;
                            CUdeviceptr kernel_arg_238120 =
                                        mem_param_229493.mem;
                            CUdeviceptr kernel_arg_238121 = mem_230551.mem;
                            CUdeviceptr kernel_arg_238122 = mem_230591.mem;
                            
                            if ((((((1 && segmap_usable_groups_219426 != 0) &&
                                    1 != 0) && 1 != 0) &&
                                  segmap_group_sizze_219425 != 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_219426;
                                grid[perm[1]] = 1;
                                grid[perm[2]] = 1;
                                
                                void *kernel_args_238115[] =
                                     {&ctx->global_failure, &n_203490,
                                      &q_l_203495, &jump_t_203500,
                                      &partition_sizze_203577, &l_n_m_203643,
                                      &i_203670, &ctx_param_ext_229488,
                                      &ctx_param_ext_229489,
                                      &ctx_param_ext_229491, &kernel_arg_238118,
                                      &kernel_arg_238119, &kernel_arg_238120,
                                      &kernel_arg_238121, &kernel_arg_238122};
                                int64_t time_start_238116 = 0, time_end_238117 =
                                        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_219434",
                                            (long) segmap_usable_groups_219426,
                                            (long) 1, (long) 1,
                                            (long) segmap_group_sizze_219425,
                                            (long) 1, (long) 1, (int) 0);
                                    time_start_238116 = get_wall_time();
                                }
                                
                                cudaEvent_t *pevents = NULL;
                                
                                if (ctx->profiling && !ctx->profiling_paused) {
                                    pevents = cuda_get_events(&ctx->cuda,
                                                              &ctx->mainzisegmap_219434_runs,
                                                              &ctx->mainzisegmap_219434_total_runtime);
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                       0));
                                }
                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_219434,
                                                                      grid[0],
                                                                      grid[1],
                                                                      grid[2],
                                                                      segmap_group_sizze_219425,
                                                                      1, 1, 0,
                                                                      NULL,
                                                                      kernel_args_238115,
                                                                      NULL));
                                if (pevents != NULL)
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                       0));
                                if (ctx->debugging) {
                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                    time_end_238117 = get_wall_time();
                                    fprintf(ctx->log,
                                            "Kernel %s runtime: %ldus\n",
                                            "main.segmap_219434",
                                            time_end_238117 -
                                            time_start_238116);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_set_device(ctx, &ext_mem_230607,
                                                    &mem_230591,
                                                    "mem_230591") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230591,
                                                      "mem_230591") != 0)
                                return 1;
                        } else {
                            struct memblock_device mem_230596;
                            
                            mem_230596.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230596,
                                                      bytes_229378,
                                                      "mem_230596")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (slt64(q_l_203495 * (int64_t) 2,
                                      segred_group_sizze_219508)) {
                                int64_t segment_sizze_nonzzero_234803 =
                                        smax64((int64_t) 1, q_l_203495);
                                int64_t num_threads_234804 = num_groups_219509 *
                                        segred_group_sizze_219508;
                                
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n",
                                            "\n# SegRed-small");
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "num_segments",
                                            (long long) (partition_sizze_203577 *
                                                         l_n_m_203643), '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segment_size",
                                            (long long) q_l_203495, '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segments_per_group",
                                            (long long) squot64(segred_group_sizze_219508,
                                                                segment_sizze_nonzzero_234803),
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "required_groups",
                                            (long long) sext_i64_i32(sdiv_up64(partition_sizze_203577 *
                                                                               l_n_m_203643,
                                                                               squot64(segred_group_sizze_219508,
                                                                                       segment_sizze_nonzzero_234803))),
                                            '\n');
                                
                                unsigned int shared_sizze_238126 = (int64_t) 8 *
                                             segred_group_sizze_219508;
                                CUdeviceptr kernel_arg_238128 =
                                            ext_mem_229411.mem;
                                CUdeviceptr kernel_arg_238129 =
                                            ext_mem_229412.mem;
                                CUdeviceptr kernel_arg_238130 =
                                            mem_param_229493.mem;
                                CUdeviceptr kernel_arg_238131 = mem_230596.mem;
                                unsigned int shared_offset_238127 = 0;
                                
                                if ((((((1 && num_groups_219509 != 0) && 1 !=
                                        0) && 1 != 0) &&
                                      segred_group_sizze_219508 != 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_219509;
                                    grid[perm[1]] = 1;
                                    grid[perm[2]] = 1;
                                    
                                    void *kernel_args_238123[] =
                                         {&ctx->global_failure,
                                          &shared_offset_238127, &n_203490,
                                          &q_l_203495, &jump_t_203500,
                                          &partition_sizze_203577,
                                          &l_n_m_203643, &i_203670,
                                          &num_groups_219509,
                                          &ctx_param_ext_229488,
                                          &ctx_param_ext_229489,
                                          &ctx_param_ext_229491,
                                          &segment_sizze_nonzzero_234803,
                                          &kernel_arg_238128,
                                          &kernel_arg_238129,
                                          &kernel_arg_238130,
                                          &kernel_arg_238131};
                                    int64_t time_start_238124 = 0,
                                            time_end_238125 = 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_219515",
                                                (long) num_groups_219509,
                                                (long) 1, (long) 1,
                                                (long) segred_group_sizze_219508,
                                                (long) 1, (long) 1, (int) (0 +
                                                                           (shared_sizze_238126 +
                                                                            (8 -
                                                                             shared_sizze_238126 %
                                                                             8) %
                                                                            8)));
                                        time_start_238124 = get_wall_time();
                                    }
                                    
                                    cudaEvent_t *pevents = NULL;
                                    
                                    if (ctx->profiling &&
                                        !ctx->profiling_paused) {
                                        pevents = cuda_get_events(&ctx->cuda,
                                                                  &ctx->mainzisegred_small_219515_runs,
                                                                  &ctx->mainzisegred_small_219515_total_runtime);
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                           0));
                                    }
                                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_small_219515,
                                                                          grid[0],
                                                                          grid[1],
                                                                          grid[2],
                                                                          segred_group_sizze_219508,
                                                                          1, 1,
                                                                          0 +
                                                                          (shared_sizze_238126 +
                                                                           (8 -
                                                                            shared_sizze_238126 %
                                                                            8) %
                                                                           8),
                                                                          NULL,
                                                                          kernel_args_238123,
                                                                          NULL));
                                    if (pevents != NULL)
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                           0));
                                    if (ctx->debugging) {
                                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                        time_end_238125 = get_wall_time();
                                        fprintf(ctx->log,
                                                "Kernel %s runtime: %ldus\n",
                                                "main.segred_small_219515",
                                                time_end_238125 -
                                                time_start_238124);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                            } else {
                                int64_t groups_per_segment_234832 =
                                        sdiv_up64(num_groups_219509,
                                                  smax64((int64_t) 1,
                                                         partition_sizze_203577 *
                                                         l_n_m_203643));
                                int64_t elements_per_thread_234833 =
                                        sdiv_up64(q_l_203495,
                                                  segred_group_sizze_219508 *
                                                  groups_per_segment_234832);
                                int64_t virt_num_groups_234834 =
                                        groups_per_segment_234832 *
                                        (partition_sizze_203577 * l_n_m_203643);
                                int64_t num_threads_234835 = num_groups_219509 *
                                        segred_group_sizze_219508;
                                int64_t threads_per_segment_234836 =
                                        groups_per_segment_234832 *
                                        segred_group_sizze_219508;
                                
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n",
                                            "\n# SegRed-large");
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "num_segments",
                                            (long long) (partition_sizze_203577 *
                                                         l_n_m_203643), '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segment_size",
                                            (long long) q_l_203495, '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "virt_num_groups",
                                            (long long) virt_num_groups_234834,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "num_groups",
                                            (long long) num_groups_219509,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "group_size",
                                            (long long) segred_group_sizze_219508,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "elems_per_thread",
                                            (long long) elements_per_thread_234833,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "groups_per_segment",
                                            (long long) groups_per_segment_234832,
                                            '\n');
                                
                                struct memblock_device segred_tmp_mem_234837;
                                
                                segred_tmp_mem_234837.references = NULL;
                                if (memblock_alloc_device(ctx,
                                                          &segred_tmp_mem_234837,
                                                          (int64_t) 8 *
                                                          virt_num_groups_234834,
                                                          "segred_tmp_mem_234837")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mainzicounter_mem_234839
                                                       =
                                                       ctx->mainzicounter_mem_234839;
                                unsigned int shared_sizze_238136 = 1;
                                unsigned int shared_sizze_238138 = (int64_t) 8 *
                                             segred_group_sizze_219508;
                                CUdeviceptr kernel_arg_238140 =
                                            ext_mem_229411.mem;
                                CUdeviceptr kernel_arg_238141 =
                                            ext_mem_229412.mem;
                                CUdeviceptr kernel_arg_238142 =
                                            mem_param_229493.mem;
                                CUdeviceptr kernel_arg_238143 = mem_230596.mem;
                                CUdeviceptr kernel_arg_238144 =
                                            segred_tmp_mem_234837.mem;
                                CUdeviceptr kernel_arg_238145 =
                                            mainzicounter_mem_234839.mem;
                                unsigned int shared_offset_238137 = 0;
                                unsigned int shared_offset_238139 = 0 +
                                             (shared_sizze_238136 + (8 -
                                                                     shared_sizze_238136 %
                                                                     8) % 8);
                                
                                if ((((((1 && num_groups_219509 != 0) && 1 !=
                                        0) && 1 != 0) &&
                                      segred_group_sizze_219508 != 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_219509;
                                    grid[perm[1]] = 1;
                                    grid[perm[2]] = 1;
                                    
                                    void *kernel_args_238133[] =
                                         {&ctx->global_failure,
                                          &shared_offset_238137,
                                          &shared_offset_238139, &n_203490,
                                          &q_l_203495, &jump_t_203500,
                                          &partition_sizze_203577,
                                          &l_n_m_203643, &i_203670,
                                          &num_groups_219509,
                                          &ctx_param_ext_229488,
                                          &ctx_param_ext_229489,
                                          &ctx_param_ext_229491,
                                          &groups_per_segment_234832,
                                          &elements_per_thread_234833,
                                          &virt_num_groups_234834,
                                          &threads_per_segment_234836,
                                          &kernel_arg_238140,
                                          &kernel_arg_238141,
                                          &kernel_arg_238142,
                                          &kernel_arg_238143,
                                          &kernel_arg_238144,
                                          &kernel_arg_238145};
                                    int64_t time_start_238134 = 0,
                                            time_end_238135 = 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_219515",
                                                (long) num_groups_219509,
                                                (long) 1, (long) 1,
                                                (long) segred_group_sizze_219508,
                                                (long) 1, (long) 1, (int) (0 +
                                                                           (shared_sizze_238136 +
                                                                            (8 -
                                                                             shared_sizze_238136 %
                                                                             8) %
                                                                            8) +
                                                                           (shared_sizze_238138 +
                                                                            (8 -
                                                                             shared_sizze_238138 %
                                                                             8) %
                                                                            8)));
                                        time_start_238134 = get_wall_time();
                                    }
                                    
                                    cudaEvent_t *pevents = NULL;
                                    
                                    if (ctx->profiling &&
                                        !ctx->profiling_paused) {
                                        pevents = cuda_get_events(&ctx->cuda,
                                                                  &ctx->mainzisegred_large_219515_runs,
                                                                  &ctx->mainzisegred_large_219515_total_runtime);
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                           0));
                                    }
                                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_large_219515,
                                                                          grid[0],
                                                                          grid[1],
                                                                          grid[2],
                                                                          segred_group_sizze_219508,
                                                                          1, 1,
                                                                          0 +
                                                                          (shared_sizze_238136 +
                                                                           (8 -
                                                                            shared_sizze_238136 %
                                                                            8) %
                                                                           8) +
                                                                          (shared_sizze_238138 +
                                                                           (8 -
                                                                            shared_sizze_238138 %
                                                                            8) %
                                                                           8),
                                                                          NULL,
                                                                          kernel_args_238133,
                                                                          NULL));
                                    if (pevents != NULL)
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                           0));
                                    if (ctx->debugging) {
                                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                        time_end_238135 = get_wall_time();
                                        fprintf(ctx->log,
                                                "Kernel %s runtime: %ldus\n",
                                                "main.segred_large_219515",
                                                time_end_238135 -
                                                time_start_238134);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_unref_device(ctx,
                                                          &segred_tmp_mem_234837,
                                                          "segred_tmp_mem_234837") !=
                                    0)
                                    return 1;
                            }
                            
                            int64_t segmap_usable_groups_219547 =
                                    sdiv_up64(nest_sizze_209492,
                                              segmap_group_sizze_219546);
                            struct memblock_device mem_230601;
                            
                            mem_230601.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230601,
                                                      bytes_229378,
                                                      "mem_230601")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            
                            CUdeviceptr kernel_arg_238149 = mem_230596.mem;
                            CUdeviceptr kernel_arg_238150 = mem_230601.mem;
                            
                            if ((((((1 && segmap_usable_groups_219547 != 0) &&
                                    1 != 0) && 1 != 0) &&
                                  segmap_group_sizze_219546 != 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_219547;
                                grid[perm[1]] = 1;
                                grid[perm[2]] = 1;
                                
                                void *kernel_args_238146[] =
                                     {&ctx->global_failure,
                                      &partition_sizze_203577, &l_n_m_203643,
                                      &kernel_arg_238149, &kernel_arg_238150};
                                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.segmap_219551",
                                            (long) segmap_usable_groups_219547,
                                            (long) 1, (long) 1,
                                            (long) segmap_group_sizze_219546,
                                            (long) 1, (long) 1, (int) 0);
                                    time_start_238147 = get_wall_time();
                                }
                                
                                cudaEvent_t *pevents = NULL;
                                
                                if (ctx->profiling && !ctx->profiling_paused) {
                                    pevents = cuda_get_events(&ctx->cuda,
                                                              &ctx->mainzisegmap_219551_runs,
                                                              &ctx->mainzisegmap_219551_total_runtime);
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                       0));
                                }
                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_219551,
                                                                      grid[0],
                                                                      grid[1],
                                                                      grid[2],
                                                                      segmap_group_sizze_219546,
                                                                      1, 1, 0,
                                                                      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.segmap_219551",
                                            time_end_238148 -
                                            time_start_238147);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx, &mem_230596,
                                                      "mem_230596") != 0)
                                return 1;
                            
                            struct memblock_device mem_230606;
                            
                            mem_230606.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230606,
                                                      bytes_229378,
                                                      "mem_230606")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (slt64(q_l_203495 * (int64_t) 2,
                                      segred_group_sizze_219557)) {
                                int64_t segment_sizze_nonzzero_234885 =
                                        smax64((int64_t) 1, q_l_203495);
                                int64_t num_threads_234886 = num_groups_219558 *
                                        segred_group_sizze_219557;
                                
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n",
                                            "\n# SegRed-small");
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "num_segments",
                                            (long long) (partition_sizze_203577 *
                                                         l_n_m_203643), '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segment_size",
                                            (long long) q_l_203495, '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segments_per_group",
                                            (long long) squot64(segred_group_sizze_219557,
                                                                segment_sizze_nonzzero_234885),
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "required_groups",
                                            (long long) sext_i64_i32(sdiv_up64(partition_sizze_203577 *
                                                                               l_n_m_203643,
                                                                               squot64(segred_group_sizze_219557,
                                                                                       segment_sizze_nonzzero_234885))),
                                            '\n');
                                
                                unsigned int shared_sizze_238154 = (int64_t) 8 *
                                             segred_group_sizze_219557;
                                CUdeviceptr kernel_arg_238156 =
                                            ext_mem_229411.mem;
                                CUdeviceptr kernel_arg_238157 =
                                            ext_mem_229412.mem;
                                CUdeviceptr kernel_arg_238158 =
                                            mem_param_229493.mem;
                                CUdeviceptr kernel_arg_238159 = mem_230551.mem;
                                CUdeviceptr kernel_arg_238160 = mem_230601.mem;
                                CUdeviceptr kernel_arg_238161 = mem_230606.mem;
                                unsigned int shared_offset_238155 = 0;
                                
                                if ((((((1 && num_groups_219558 != 0) && 1 !=
                                        0) && 1 != 0) &&
                                      segred_group_sizze_219557 != 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_219558;
                                    grid[perm[1]] = 1;
                                    grid[perm[2]] = 1;
                                    
                                    void *kernel_args_238151[] =
                                         {&ctx->global_failure,
                                          &shared_offset_238155, &n_203490,
                                          &q_l_203495, &jump_t_203500,
                                          &partition_sizze_203577,
                                          &l_n_m_203643, &i_203670,
                                          &num_groups_219558,
                                          &ctx_param_ext_229488,
                                          &ctx_param_ext_229489,
                                          &ctx_param_ext_229491,
                                          &segment_sizze_nonzzero_234885,
                                          &kernel_arg_238156,
                                          &kernel_arg_238157,
                                          &kernel_arg_238158,
                                          &kernel_arg_238159,
                                          &kernel_arg_238160,
                                          &kernel_arg_238161};
                                    int64_t time_start_238152 = 0,
                                            time_end_238153 = 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_219564",
                                                (long) num_groups_219558,
                                                (long) 1, (long) 1,
                                                (long) segred_group_sizze_219557,
                                                (long) 1, (long) 1, (int) (0 +
                                                                           (shared_sizze_238154 +
                                                                            (8 -
                                                                             shared_sizze_238154 %
                                                                             8) %
                                                                            8)));
                                        time_start_238152 = get_wall_time();
                                    }
                                    
                                    cudaEvent_t *pevents = NULL;
                                    
                                    if (ctx->profiling &&
                                        !ctx->profiling_paused) {
                                        pevents = cuda_get_events(&ctx->cuda,
                                                                  &ctx->mainzisegred_small_219564_runs,
                                                                  &ctx->mainzisegred_small_219564_total_runtime);
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                           0));
                                    }
                                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_small_219564,
                                                                          grid[0],
                                                                          grid[1],
                                                                          grid[2],
                                                                          segred_group_sizze_219557,
                                                                          1, 1,
                                                                          0 +
                                                                          (shared_sizze_238154 +
                                                                           (8 -
                                                                            shared_sizze_238154 %
                                                                            8) %
                                                                           8),
                                                                          NULL,
                                                                          kernel_args_238151,
                                                                          NULL));
                                    if (pevents != NULL)
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                           0));
                                    if (ctx->debugging) {
                                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                        time_end_238153 = get_wall_time();
                                        fprintf(ctx->log,
                                                "Kernel %s runtime: %ldus\n",
                                                "main.segred_small_219564",
                                                time_end_238153 -
                                                time_start_238152);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                            } else {
                                int64_t groups_per_segment_234914 =
                                        sdiv_up64(num_groups_219558,
                                                  smax64((int64_t) 1,
                                                         partition_sizze_203577 *
                                                         l_n_m_203643));
                                int64_t elements_per_thread_234915 =
                                        sdiv_up64(q_l_203495,
                                                  segred_group_sizze_219557 *
                                                  groups_per_segment_234914);
                                int64_t virt_num_groups_234916 =
                                        groups_per_segment_234914 *
                                        (partition_sizze_203577 * l_n_m_203643);
                                int64_t num_threads_234917 = num_groups_219558 *
                                        segred_group_sizze_219557;
                                int64_t threads_per_segment_234918 =
                                        groups_per_segment_234914 *
                                        segred_group_sizze_219557;
                                
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n",
                                            "\n# SegRed-large");
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "num_segments",
                                            (long long) (partition_sizze_203577 *
                                                         l_n_m_203643), '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segment_size",
                                            (long long) q_l_203495, '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "virt_num_groups",
                                            (long long) virt_num_groups_234916,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "num_groups",
                                            (long long) num_groups_219558,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "group_size",
                                            (long long) segred_group_sizze_219557,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "elems_per_thread",
                                            (long long) elements_per_thread_234915,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "groups_per_segment",
                                            (long long) groups_per_segment_234914,
                                            '\n');
                                
                                struct memblock_device segred_tmp_mem_234919;
                                
                                segred_tmp_mem_234919.references = NULL;
                                if (memblock_alloc_device(ctx,
                                                          &segred_tmp_mem_234919,
                                                          (int64_t) 8 *
                                                          virt_num_groups_234916,
                                                          "segred_tmp_mem_234919")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mainzicounter_mem_234921
                                                       =
                                                       ctx->mainzicounter_mem_234921;
                                unsigned int shared_sizze_238166 = 1;
                                unsigned int shared_sizze_238168 = (int64_t) 8 *
                                             segred_group_sizze_219557;
                                CUdeviceptr kernel_arg_238170 =
                                            ext_mem_229411.mem;
                                CUdeviceptr kernel_arg_238171 =
                                            ext_mem_229412.mem;
                                CUdeviceptr kernel_arg_238172 =
                                            mem_param_229493.mem;
                                CUdeviceptr kernel_arg_238173 = mem_230551.mem;
                                CUdeviceptr kernel_arg_238174 = mem_230601.mem;
                                CUdeviceptr kernel_arg_238175 = mem_230606.mem;
                                CUdeviceptr kernel_arg_238176 =
                                            segred_tmp_mem_234919.mem;
                                CUdeviceptr kernel_arg_238177 =
                                            mainzicounter_mem_234921.mem;
                                unsigned int shared_offset_238167 = 0;
                                unsigned int shared_offset_238169 = 0 +
                                             (shared_sizze_238166 + (8 -
                                                                     shared_sizze_238166 %
                                                                     8) % 8);
                                
                                if ((((((1 && num_groups_219558 != 0) && 1 !=
                                        0) && 1 != 0) &&
                                      segred_group_sizze_219557 != 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_219558;
                                    grid[perm[1]] = 1;
                                    grid[perm[2]] = 1;
                                    
                                    void *kernel_args_238163[] =
                                         {&ctx->global_failure,
                                          &shared_offset_238167,
                                          &shared_offset_238169, &n_203490,
                                          &q_l_203495, &jump_t_203500,
                                          &partition_sizze_203577,
                                          &l_n_m_203643, &i_203670,
                                          &num_groups_219558,
                                          &ctx_param_ext_229488,
                                          &ctx_param_ext_229489,
                                          &ctx_param_ext_229491,
                                          &groups_per_segment_234914,
                                          &elements_per_thread_234915,
                                          &virt_num_groups_234916,
                                          &threads_per_segment_234918,
                                          &kernel_arg_238170,
                                          &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_238164 = 0,
                                            time_end_238165 = 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_219564",
                                                (long) num_groups_219558,
                                                (long) 1, (long) 1,
                                                (long) segred_group_sizze_219557,
                                                (long) 1, (long) 1, (int) (0 +
                                                                           (shared_sizze_238166 +
                                                                            (8 -
                                                                             shared_sizze_238166 %
                                                                             8) %
                                                                            8) +
                                                                           (shared_sizze_238168 +
                                                                            (8 -
                                                                             shared_sizze_238168 %
                                                                             8) %
                                                                            8)));
                                        time_start_238164 = get_wall_time();
                                    }
                                    
                                    cudaEvent_t *pevents = NULL;
                                    
                                    if (ctx->profiling &&
                                        !ctx->profiling_paused) {
                                        pevents = cuda_get_events(&ctx->cuda,
                                                                  &ctx->mainzisegred_large_219564_runs,
                                                                  &ctx->mainzisegred_large_219564_total_runtime);
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                           0));
                                    }
                                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_large_219564,
                                                                          grid[0],
                                                                          grid[1],
                                                                          grid[2],
                                                                          segred_group_sizze_219557,
                                                                          1, 1,
                                                                          0 +
                                                                          (shared_sizze_238166 +
                                                                           (8 -
                                                                            shared_sizze_238166 %
                                                                            8) %
                                                                           8) +
                                                                          (shared_sizze_238168 +
                                                                           (8 -
                                                                            shared_sizze_238168 %
                                                                            8) %
                                                                           8),
                                                                          NULL,
                                                                          kernel_args_238163,
                                                                          NULL));
                                    if (pevents != NULL)
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                           0));
                                    if (ctx->debugging) {
                                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                        time_end_238165 = get_wall_time();
                                        fprintf(ctx->log,
                                                "Kernel %s runtime: %ldus\n",
                                                "main.segred_large_219564",
                                                time_end_238165 -
                                                time_start_238164);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_unref_device(ctx,
                                                          &segred_tmp_mem_234919,
                                                          "segred_tmp_mem_234919") !=
                                    0)
                                    return 1;
                            }
                            if (memblock_unref_device(ctx, &mem_230601,
                                                      "mem_230601") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_230607,
                                                    &mem_230606,
                                                    "mem_230606") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230606,
                                                      "mem_230606") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230601,
                                                      "mem_230601") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230596,
                                                      "mem_230596") != 0)
                                return 1;
                        }
                        if (memblock_set_device(ctx, &ext_mem_230613,
                                                &ext_mem_230607,
                                                "ext_mem_230607") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230607,
                                                  "ext_mem_230607") != 0)
                            return 1;
                    }
                    if (memblock_set_device(ctx, &ext_mem_230847,
                                            &ext_mem_230613,
                                            "ext_mem_230613") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_230846, &mem_230555,
                                            "mem_230555") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230613,
                                              "ext_mem_230613") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230555, "mem_230555") !=
                        0)
                        return 1;
                } else {
                    bool match_lit_205259 = (int64_t) 1 == d_l_203498;
                    struct memblock_device ext_mem_230845;
                    
                    ext_mem_230845.references = NULL;
                    
                    struct memblock_device ext_mem_230844;
                    
                    ext_mem_230844.references = NULL;
                    if (match_lit_205259) {
                        bool suff_outer_par_219604;
                        
                        suff_outer_par_219604 =
                            *ctx->tuning_params.mainzisuff_outer_par_24 <=
                            partition_sizze_203577;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_24",
                                    (long) partition_sizze_203577,
                                    suff_outer_par_219604 ? "true" : "false");
                        
                        int64_t segmap_group_sizze_219706;
                        
                        segmap_group_sizze_219706 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_219608;
                        
                        int64_t num_groups_219707;
                        int32_t max_num_groups_234959;
                        
                        max_num_groups_234959 =
                            *ctx->tuning_params.mainzisegmap_num_groups_219610;
                        num_groups_219707 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(partition_sizze_203577,
                                                                                 segmap_group_sizze_219706),
                                                                       sext_i32_i64(max_num_groups_234959))));
                        
                        int64_t segmap_group_sizze_220222;
                        
                        segmap_group_sizze_220222 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_219808;
                        
                        bool suff_outer_par_220226;
                        
                        suff_outer_par_220226 =
                            *ctx->tuning_params.mainzisuff_outer_par_25 <=
                            nest_sizze_209492;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_25",
                                    (long) nest_sizze_209492,
                                    suff_outer_par_220226 ? "true" : "false");
                        
                        int64_t nest_sizze_220334 = q_l_203495 *
                                nest_sizze_209492;
                        int64_t segred_group_sizze_220335;
                        
                        segred_group_sizze_220335 =
                            *ctx->tuning_params.mainzisegred_group_sizze_220012;
                        
                        int64_t num_groups_220336;
                        int32_t max_num_groups_234960;
                        
                        max_num_groups_234960 =
                            *ctx->tuning_params.mainzisegred_num_groups_220014;
                        num_groups_220336 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(nest_sizze_220334,
                                                                                 segred_group_sizze_220335),
                                                                       sext_i32_i64(max_num_groups_234960))));
                        
                        int64_t segmap_group_sizze_220383;
                        
                        segmap_group_sizze_220383 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_219990;
                        
                        int64_t segred_group_sizze_220405;
                        
                        segred_group_sizze_220405 =
                            *ctx->tuning_params.mainzisegred_group_sizze_219918;
                        
                        int64_t num_groups_220406;
                        int32_t max_num_groups_234961;
                        
                        max_num_groups_234961 =
                            *ctx->tuning_params.mainzisegred_num_groups_219920;
                        num_groups_220406 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(nest_sizze_220334,
                                                                                 segred_group_sizze_220405),
                                                                       sext_i32_i64(max_num_groups_234961))));
                        
                        int64_t num_threads_232163 = segmap_group_sizze_219706 *
                                num_groups_219707;
                        int64_t total_sizze_232164 = bytes_229371 *
                                num_threads_232163;
                        int64_t total_sizze_232165 = bytes_229371 *
                                num_threads_232163;
                        struct memblock_device ext_mem_230720;
                        
                        ext_mem_230720.references = NULL;
                        
                        struct memblock_device ext_mem_230719;
                        
                        ext_mem_230719.references = NULL;
                        
                        int32_t local_memory_capacity_235208;
                        
                        local_memory_capacity_235208 =
                            ctx->cuda.max_shared_memory;
                        if ((sle64((int64_t) 0,
                                   sext_i32_i64(local_memory_capacity_235208)) &&
                             sle64((int64_t) 0,
                                   sext_i32_i64(local_memory_capacity_235208))) &&
                            suff_outer_par_219604) {
                            struct memblock_device mem_230616;
                            
                            mem_230616.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230616,
                                                      binop_y_229377,
                                                      "mem_230616")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_230616,
                                                                      (int64_t) 0,
                                                                      ext_mem_229412,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      l_n_m_203643,
                                                                      partition_sizze_203577) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230616,
                                                          "mem_230616") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230719,
                                                          "ext_mem_230719") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230720,
                                                          "ext_mem_230720") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230844,
                                                          "ext_mem_230844") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230845,
                                                          "ext_mem_230845") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230846,
                                                          "ext_mem_230846") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230847,
                                                          "ext_mem_230847") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230907,
                                                          "ext_mem_230907") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230908,
                                                          "ext_mem_230908") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230546,
                                                          "ext_mem_230546") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230529,
                                                          "ext_mem_230529") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230512,
                                                          "ext_mem_230512") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230494,
                                                          "ext_mem_230494") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230619;
                            
                            mem_230619.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230619,
                                                      binop_y_229377,
                                                      "mem_230619")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230619,
                                                                      (int64_t) 0,
                                                                      ext_mem_229411,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      l_n_m_203643,
                                                                      partition_sizze_203577) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230619,
                                                          "mem_230619") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230616,
                                                          "mem_230616") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230719,
                                                          "ext_mem_230719") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230720,
                                                          "ext_mem_230720") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230844,
                                                          "ext_mem_230844") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230845,
                                                          "ext_mem_230845") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230846,
                                                          "ext_mem_230846") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230847,
                                                          "ext_mem_230847") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230907,
                                                          "ext_mem_230907") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230908,
                                                          "ext_mem_230908") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230546,
                                                          "ext_mem_230546") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230529,
                                                          "ext_mem_230529") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230512,
                                                          "ext_mem_230512") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230494,
                                                          "ext_mem_230494") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230622;
                            
                            mem_230622.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230622,
                                                      binop_y_229176,
                                                      "mem_230622")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            int64_t group_sizze_234965;
                            
                            group_sizze_234965 =
                                *ctx->tuning_params.mainzigroup_sizze_234965;
                            
                            int64_t num_groups_234966 =
                                    sdiv_up64(partition_sizze_203577 * n_203490,
                                              group_sizze_234965);
                            CUdeviceptr kernel_arg_238181 =
                                        mem_param_229493.mem;
                            CUdeviceptr kernel_arg_238182 = mem_230622.mem;
                            
                            if ((((((1 && num_groups_234966 != 0) && 1 != 0) &&
                                   1 != 0) && group_sizze_234965 != 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_234966;
                                grid[perm[1]] = 1;
                                grid[perm[2]] = 1;
                                
                                void *kernel_args_238178[] = {&n_203490,
                                                              &partition_sizze_203577,
                                                              &ctx_param_ext_229488,
                                                              &ctx_param_ext_229489,
                                                              &ctx_param_ext_229491,
                                                              &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.copy_234962",
                                            (long) num_groups_234966, (long) 1,
                                            (long) 1, (long) group_sizze_234965,
                                            (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->mainzicopy_234962_runs,
                                                              &ctx->mainzicopy_234962_total_runtime);
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                       0));
                                }
                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzicopy_234962,
                                                                      grid[0],
                                                                      grid[1],
                                                                      grid[2],
                                                                      group_sizze_234965,
                                                                      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.copy_234962",
                                            time_end_238180 -
                                            time_start_238179);
                                }
                            }
                            
                            struct memblock_device mem_230625;
                            
                            mem_230625.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230625,
                                                      binop_y_229176,
                                                      "mem_230625")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230625,
                                                                      (int64_t) 0,
                                                                      mem_230551,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_203490,
                                                                      partition_sizze_203577) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230622,
                                                          "mem_230622") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230619,
                                                          "mem_230619") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230616,
                                                          "mem_230616") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230719,
                                                          "ext_mem_230719") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230720,
                                                          "ext_mem_230720") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230844,
                                                          "ext_mem_230844") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230845,
                                                          "ext_mem_230845") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230846,
                                                          "ext_mem_230846") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230847,
                                                          "ext_mem_230847") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230907,
                                                          "ext_mem_230907") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230908,
                                                          "ext_mem_230908") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230546,
                                                          "ext_mem_230546") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230529,
                                                          "ext_mem_230529") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230512,
                                                          "ext_mem_230512") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230494,
                                                          "ext_mem_230494") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230659;
                            
                            mem_230659.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230659,
                                                      binop_y_229377,
                                                      "mem_230659")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230662;
                            
                            mem_230662.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230662,
                                                      binop_y_229377,
                                                      "mem_230662")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232028;
                            
                            color_232028.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232028,
                                                      total_sizze_232164,
                                                      "color_232028")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232029;
                            
                            color_232029.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232029,
                                                      total_sizze_232165,
                                                      "color_232029")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            
                            CUdeviceptr kernel_arg_238186 = mem_230616.mem;
                            CUdeviceptr kernel_arg_238187 = mem_230619.mem;
                            CUdeviceptr kernel_arg_238188 = mem_230622.mem;
                            CUdeviceptr kernel_arg_238189 = mem_230625.mem;
                            CUdeviceptr kernel_arg_238190 = mem_230659.mem;
                            CUdeviceptr kernel_arg_238191 = mem_230662.mem;
                            CUdeviceptr kernel_arg_238192 = color_232028.mem;
                            CUdeviceptr kernel_arg_238193 = color_232029.mem;
                            
                            if ((((((1 && num_groups_219707 != 0) && 1 != 0) &&
                                   1 != 0) && segmap_group_sizze_219706 != 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_219707;
                                grid[perm[1]] = 1;
                                grid[perm[2]] = 1;
                                
                                void *kernel_args_238183[] =
                                     {&ctx->global_failure, &n_203490,
                                      &q_l_203495, &jump_t_203500,
                                      &partition_sizze_203577, &l_n_m_203643,
                                      &i_203670, &num_groups_219707,
                                      &num_threads_232163, &kernel_arg_238186,
                                      &kernel_arg_238187, &kernel_arg_238188,
                                      &kernel_arg_238189, &kernel_arg_238190,
                                      &kernel_arg_238191, &kernel_arg_238192,
                                      &kernel_arg_238193};
                                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.segmap_219712",
                                            (long) num_groups_219707, (long) 1,
                                            (long) 1,
                                            (long) segmap_group_sizze_219706,
                                            (long) 1, (long) 1, (int) 0);
                                    time_start_238184 = get_wall_time();
                                }
                                
                                cudaEvent_t *pevents = NULL;
                                
                                if (ctx->profiling && !ctx->profiling_paused) {
                                    pevents = cuda_get_events(&ctx->cuda,
                                                              &ctx->mainzisegmap_219712_runs,
                                                              &ctx->mainzisegmap_219712_total_runtime);
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                       0));
                                }
                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_219712,
                                                                      grid[0],
                                                                      grid[1],
                                                                      grid[2],
                                                                      segmap_group_sizze_219706,
                                                                      1, 1, 0,
                                                                      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.segmap_219712",
                                            time_end_238185 -
                                            time_start_238184);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx, &mem_230616,
                                                      "mem_230616") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230619,
                                                      "mem_230619") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230622,
                                                      "mem_230622") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230625,
                                                      "mem_230625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232028,
                                                      "color_232028") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232029,
                                                      "color_232029") != 0)
                                return 1;
                            
                            struct memblock_device mem_230712;
                            
                            mem_230712.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230712,
                                                      bytes_229378,
                                                      "mem_230712")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230712,
                                                                      (int64_t) 0,
                                                                      mem_230659,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      partition_sizze_203577,
                                                                      l_n_m_203643) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230712,
                                                          "mem_230712") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232029,
                                                          "color_232029") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232028,
                                                          "color_232028") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230662,
                                                          "mem_230662") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230622,
                                                          "mem_230622") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230619,
                                                          "mem_230619") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230616,
                                                          "mem_230616") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230719,
                                                          "ext_mem_230719") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230720,
                                                          "ext_mem_230720") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230844,
                                                          "ext_mem_230844") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230845,
                                                          "ext_mem_230845") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230846,
                                                          "ext_mem_230846") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230847,
                                                          "ext_mem_230847") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230907,
                                                          "ext_mem_230907") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230908,
                                                          "ext_mem_230908") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230546,
                                                          "ext_mem_230546") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230529,
                                                          "ext_mem_230529") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230512,
                                                          "ext_mem_230512") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230494,
                                                          "ext_mem_230494") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_230659,
                                                      "mem_230659") != 0)
                                return 1;
                            
                            struct memblock_device mem_230717;
                            
                            mem_230717.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230717,
                                                      bytes_229378,
                                                      "mem_230717")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230717,
                                                                      (int64_t) 0,
                                                                      mem_230662,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      partition_sizze_203577,
                                                                      l_n_m_203643) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230717,
                                                          "mem_230717") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230712,
                                                          "mem_230712") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232029,
                                                          "color_232029") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232028,
                                                          "color_232028") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230662,
                                                          "mem_230662") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230622,
                                                          "mem_230622") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230619,
                                                          "mem_230619") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230616,
                                                          "mem_230616") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230719,
                                                          "ext_mem_230719") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230720,
                                                          "ext_mem_230720") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230844,
                                                          "ext_mem_230844") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230845,
                                                          "ext_mem_230845") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230846,
                                                          "ext_mem_230846") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230847,
                                                          "ext_mem_230847") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230907,
                                                          "ext_mem_230907") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230908,
                                                          "ext_mem_230908") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230546,
                                                          "ext_mem_230546") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230529,
                                                          "ext_mem_230529") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230512,
                                                          "ext_mem_230512") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230494,
                                                          "ext_mem_230494") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_230662,
                                                      "mem_230662") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_230720,
                                                    &mem_230712,
                                                    "mem_230712") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_230719,
                                                    &mem_230717,
                                                    "mem_230717") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230717,
                                                      "mem_230717") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230712,
                                                      "mem_230712") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232029,
                                                      "color_232029") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232028,
                                                      "color_232028") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230662,
                                                      "mem_230662") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230659,
                                                      "mem_230659") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230625,
                                                      "mem_230625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230622,
                                                      "mem_230622") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230619,
                                                      "mem_230619") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230616,
                                                      "mem_230616") != 0)
                                return 1;
                        } else {
                            int64_t segmap_usable_groups_220223 =
                                    sdiv_up64(nest_sizze_209492,
                                              segmap_group_sizze_220222);
                            struct memblock_device ext_mem_230708;
                            
                            ext_mem_230708.references = NULL;
                            
                            struct memblock_device ext_mem_230707;
                            
                            ext_mem_230707.references = NULL;
                            
                            int32_t local_memory_capacity_235207;
                            
                            local_memory_capacity_235207 =
                                ctx->cuda.max_shared_memory;
                            if (sle64((int64_t) 0,
                                      sext_i32_i64(local_memory_capacity_235207)) &&
                                suff_outer_par_220226) {
                                struct memblock_device mem_230667;
                                
                                mem_230667.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230667,
                                                          bytes_229378,
                                                          "mem_230667")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230671;
                                
                                mem_230671.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230671,
                                                          bytes_229378,
                                                          "mem_230671")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                                
                                CUdeviceptr kernel_arg_238197 =
                                            ext_mem_229411.mem;
                                CUdeviceptr kernel_arg_238198 =
                                            ext_mem_229412.mem;
                                CUdeviceptr kernel_arg_238199 =
                                            mem_param_229493.mem;
                                CUdeviceptr kernel_arg_238200 = mem_230551.mem;
                                CUdeviceptr kernel_arg_238201 = mem_230667.mem;
                                CUdeviceptr kernel_arg_238202 = mem_230671.mem;
                                
                                if ((((((1 && segmap_usable_groups_220223 !=
                                         0) && 1 != 0) && 1 != 0) &&
                                      segmap_group_sizze_220222 != 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_220223;
                                    grid[perm[1]] = 1;
                                    grid[perm[2]] = 1;
                                    
                                    void *kernel_args_238194[] =
                                         {&ctx->global_failure, &n_203490,
                                          &q_l_203495, &jump_t_203500,
                                          &partition_sizze_203577,
                                          &l_n_m_203643, &i_203670,
                                          &ctx_param_ext_229488,
                                          &ctx_param_ext_229489,
                                          &ctx_param_ext_229491,
                                          &kernel_arg_238197,
                                          &kernel_arg_238198,
                                          &kernel_arg_238199,
                                          &kernel_arg_238200,
                                          &kernel_arg_238201,
                                          &kernel_arg_238202};
                                    int64_t time_start_238195 = 0,
                                            time_end_238196 = 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_220233",
                                                (long) segmap_usable_groups_220223,
                                                (long) 1, (long) 1,
                                                (long) segmap_group_sizze_220222,
                                                (long) 1, (long) 1, (int) 0);
                                        time_start_238195 = get_wall_time();
                                    }
                                    
                                    cudaEvent_t *pevents = NULL;
                                    
                                    if (ctx->profiling &&
                                        !ctx->profiling_paused) {
                                        pevents = cuda_get_events(&ctx->cuda,
                                                                  &ctx->mainzisegmap_220233_runs,
                                                                  &ctx->mainzisegmap_220233_total_runtime);
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                           0));
                                    }
                                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_220233,
                                                                          grid[0],
                                                                          grid[1],
                                                                          grid[2],
                                                                          segmap_group_sizze_220222,
                                                                          1, 1,
                                                                          0,
                                                                          NULL,
                                                                          kernel_args_238194,
                                                                          NULL));
                                    if (pevents != NULL)
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                           0));
                                    if (ctx->debugging) {
                                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                        time_end_238196 = get_wall_time();
                                        fprintf(ctx->log,
                                                "Kernel %s runtime: %ldus\n",
                                                "main.segmap_220233",
                                                time_end_238196 -
                                                time_start_238195);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_set_device(ctx, &ext_mem_230708,
                                                        &mem_230667,
                                                        "mem_230667") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_230707,
                                                        &mem_230671,
                                                        "mem_230671") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230671,
                                                          "mem_230671") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230667,
                                                          "mem_230667") != 0)
                                    return 1;
                            } else {
                                struct memblock_device mem_230676;
                                
                                mem_230676.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230676,
                                                          bytes_229378,
                                                          "mem_230676")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230680;
                                
                                mem_230680.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230680,
                                                          bytes_229378,
                                                          "mem_230680")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230684;
                                
                                mem_230684.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230684,
                                                          bytes_229378,
                                                          "mem_230684")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (slt64(q_l_203495 * (int64_t) 2,
                                          segred_group_sizze_220335)) {
                                    int64_t segment_sizze_nonzzero_235011 =
                                            smax64((int64_t) 1, q_l_203495);
                                    int64_t num_threads_235012 =
                                            num_groups_220336 *
                                            segred_group_sizze_220335;
                                    
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n",
                                                "\n# SegRed-small");
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_segments",
                                                (long long) (partition_sizze_203577 *
                                                             l_n_m_203643),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_l_203495, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segments_per_group",
                                                (long long) squot64(segred_group_sizze_220335,
                                                                    segment_sizze_nonzzero_235011),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "required_groups",
                                                (long long) sext_i64_i32(sdiv_up64(partition_sizze_203577 *
                                                                                   l_n_m_203643,
                                                                                   squot64(segred_group_sizze_220335,
                                                                                           segment_sizze_nonzzero_235011))),
                                                '\n');
                                    
                                    unsigned int shared_sizze_238206 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_220335;
                                    unsigned int shared_sizze_238208 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_220335;
                                    unsigned int shared_sizze_238210 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_220335;
                                    CUdeviceptr kernel_arg_238212 =
                                                ext_mem_229411.mem;
                                    CUdeviceptr kernel_arg_238213 =
                                                ext_mem_229412.mem;
                                    CUdeviceptr kernel_arg_238214 =
                                                mem_param_229493.mem;
                                    CUdeviceptr kernel_arg_238215 =
                                                mem_230676.mem;
                                    CUdeviceptr kernel_arg_238216 =
                                                mem_230680.mem;
                                    CUdeviceptr kernel_arg_238217 =
                                                mem_230684.mem;
                                    unsigned int shared_offset_238207 = 0;
                                    unsigned int shared_offset_238209 = 0 +
                                                 (shared_sizze_238206 + (8 -
                                                                         shared_sizze_238206 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_238211 = 0 +
                                                 (shared_sizze_238206 + (8 -
                                                                         shared_sizze_238206 %
                                                                         8) %
                                                  8) + (shared_sizze_238208 +
                                                        (8 -
                                                         shared_sizze_238208 %
                                                         8) % 8);
                                    
                                    if ((((((1 && num_groups_220336 != 0) &&
                                            1 != 0) && 1 != 0) &&
                                          segred_group_sizze_220335 != 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_220336;
                                        grid[perm[1]] = 1;
                                        grid[perm[2]] = 1;
                                        
                                        void *kernel_args_238203[] =
                                             {&ctx->global_failure,
                                              &shared_offset_238207,
                                              &shared_offset_238209,
                                              &shared_offset_238211, &n_203490,
                                              &q_l_203495, &jump_t_203500,
                                              &partition_sizze_203577,
                                              &l_n_m_203643, &i_203670,
                                              &num_groups_220336,
                                              &ctx_param_ext_229488,
                                              &ctx_param_ext_229489,
                                              &ctx_param_ext_229491,
                                              &segment_sizze_nonzzero_235011,
                                              &kernel_arg_238212,
                                              &kernel_arg_238213,
                                              &kernel_arg_238214,
                                              &kernel_arg_238215,
                                              &kernel_arg_238216,
                                              &kernel_arg_238217};
                                        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.segred_small_220344",
                                                    (long) num_groups_220336,
                                                    (long) 1, (long) 1,
                                                    (long) segred_group_sizze_220335,
                                                    (long) 1, (long) 1,
                                                    (int) (0 +
                                                           (shared_sizze_238206 +
                                                            (8 -
                                                             shared_sizze_238206 %
                                                             8) % 8) +
                                                           (shared_sizze_238208 +
                                                            (8 -
                                                             shared_sizze_238208 %
                                                             8) % 8) +
                                                           (shared_sizze_238210 +
                                                            (8 -
                                                             shared_sizze_238210 %
                                                             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->mainzisegred_small_220344_runs,
                                                                &ctx->mainzisegred_small_220344_total_runtime);
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                               0));
                                        }
                                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_small_220344,
                                                                              grid[0],
                                                                              grid[1],
                                                                              grid[2],
                                                                              segred_group_sizze_220335,
                                                                              1,
                                                                              1,
                                                                              0 +
                                                                              (shared_sizze_238206 +
                                                                               (8 -
                                                                                shared_sizze_238206 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238208 +
                                                                               (8 -
                                                                                shared_sizze_238208 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238210 +
                                                                               (8 -
                                                                                shared_sizze_238210 %
                                                                                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.segred_small_220344",
                                                    time_end_238205 -
                                                    time_start_238204);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                } else {
                                    int64_t groups_per_segment_235052 =
                                            sdiv_up64(num_groups_220336,
                                                      smax64((int64_t) 1,
                                                             partition_sizze_203577 *
                                                             l_n_m_203643));
                                    int64_t elements_per_thread_235053 =
                                            sdiv_up64(q_l_203495,
                                                      segred_group_sizze_220335 *
                                                      groups_per_segment_235052);
                                    int64_t virt_num_groups_235054 =
                                            groups_per_segment_235052 *
                                            (partition_sizze_203577 *
                                             l_n_m_203643);
                                    int64_t num_threads_235055 =
                                            num_groups_220336 *
                                            segred_group_sizze_220335;
                                    int64_t threads_per_segment_235056 =
                                            groups_per_segment_235052 *
                                            segred_group_sizze_220335;
                                    
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n",
                                                "\n# SegRed-large");
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_segments",
                                                (long long) (partition_sizze_203577 *
                                                             l_n_m_203643),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_l_203495, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "virt_num_groups",
                                                (long long) virt_num_groups_235054,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_groups",
                                                (long long) num_groups_220336,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "group_size",
                                                (long long) segred_group_sizze_220335,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "elems_per_thread",
                                                (long long) elements_per_thread_235053,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "groups_per_segment",
                                                (long long) groups_per_segment_235052,
                                                '\n');
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235057;
                                    
                                    segred_tmp_mem_235057.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235057,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235054,
                                                              "segred_tmp_mem_235057")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235059;
                                    
                                    segred_tmp_mem_235059.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235059,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235054,
                                                              "segred_tmp_mem_235059")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235061;
                                    
                                    segred_tmp_mem_235061.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235061,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235054,
                                                              "segred_tmp_mem_235061")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    mainzicounter_mem_235063 =
                                    ctx->mainzicounter_mem_235063;
                                    unsigned int shared_sizze_238222 = 1;
                                    unsigned int shared_sizze_238224 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_220335;
                                    unsigned int shared_sizze_238226 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_220335;
                                    unsigned int shared_sizze_238228 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_220335;
                                    CUdeviceptr kernel_arg_238230 =
                                                ext_mem_229411.mem;
                                    CUdeviceptr kernel_arg_238231 =
                                                ext_mem_229412.mem;
                                    CUdeviceptr kernel_arg_238232 =
                                                mem_param_229493.mem;
                                    CUdeviceptr kernel_arg_238233 =
                                                mem_230676.mem;
                                    CUdeviceptr kernel_arg_238234 =
                                                mem_230680.mem;
                                    CUdeviceptr kernel_arg_238235 =
                                                mem_230684.mem;
                                    CUdeviceptr kernel_arg_238236 =
                                                segred_tmp_mem_235057.mem;
                                    CUdeviceptr kernel_arg_238237 =
                                                segred_tmp_mem_235059.mem;
                                    CUdeviceptr kernel_arg_238238 =
                                                segred_tmp_mem_235061.mem;
                                    CUdeviceptr kernel_arg_238239 =
                                                mainzicounter_mem_235063.mem;
                                    unsigned int shared_offset_238223 = 0;
                                    unsigned int shared_offset_238225 = 0 +
                                                 (shared_sizze_238222 + (8 -
                                                                         shared_sizze_238222 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_238227 = 0 +
                                                 (shared_sizze_238222 + (8 -
                                                                         shared_sizze_238222 %
                                                                         8) %
                                                  8) + (shared_sizze_238224 +
                                                        (8 -
                                                         shared_sizze_238224 %
                                                         8) % 8);
                                    unsigned int shared_offset_238229 = 0 +
                                                 (shared_sizze_238222 + (8 -
                                                                         shared_sizze_238222 %
                                                                         8) %
                                                  8) + (shared_sizze_238224 +
                                                        (8 -
                                                         shared_sizze_238224 %
                                                         8) % 8) +
                                                 (shared_sizze_238226 + (8 -
                                                                         shared_sizze_238226 %
                                                                         8) %
                                                  8);
                                    
                                    if ((((((1 && num_groups_220336 != 0) &&
                                            1 != 0) && 1 != 0) &&
                                          segred_group_sizze_220335 != 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_220336;
                                        grid[perm[1]] = 1;
                                        grid[perm[2]] = 1;
                                        
                                        void *kernel_args_238219[] =
                                             {&ctx->global_failure,
                                              &shared_offset_238223,
                                              &shared_offset_238225,
                                              &shared_offset_238227,
                                              &shared_offset_238229, &n_203490,
                                              &q_l_203495, &jump_t_203500,
                                              &partition_sizze_203577,
                                              &l_n_m_203643, &i_203670,
                                              &num_groups_220336,
                                              &ctx_param_ext_229488,
                                              &ctx_param_ext_229489,
                                              &ctx_param_ext_229491,
                                              &groups_per_segment_235052,
                                              &elements_per_thread_235053,
                                              &virt_num_groups_235054,
                                              &threads_per_segment_235056,
                                              &kernel_arg_238230,
                                              &kernel_arg_238231,
                                              &kernel_arg_238232,
                                              &kernel_arg_238233,
                                              &kernel_arg_238234,
                                              &kernel_arg_238235,
                                              &kernel_arg_238236,
                                              &kernel_arg_238237,
                                              &kernel_arg_238238,
                                              &kernel_arg_238239};
                                        int64_t time_start_238220 = 0,
                                                time_end_238221 = 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_220344",
                                                    (long) num_groups_220336,
                                                    (long) 1, (long) 1,
                                                    (long) segred_group_sizze_220335,
                                                    (long) 1, (long) 1,
                                                    (int) (0 +
                                                           (shared_sizze_238222 +
                                                            (8 -
                                                             shared_sizze_238222 %
                                                             8) % 8) +
                                                           (shared_sizze_238224 +
                                                            (8 -
                                                             shared_sizze_238224 %
                                                             8) % 8) +
                                                           (shared_sizze_238226 +
                                                            (8 -
                                                             shared_sizze_238226 %
                                                             8) % 8) +
                                                           (shared_sizze_238228 +
                                                            (8 -
                                                             shared_sizze_238228 %
                                                             8) % 8)));
                                            time_start_238220 = get_wall_time();
                                        }
                                        
                                        cudaEvent_t *pevents = NULL;
                                        
                                        if (ctx->profiling &&
                                            !ctx->profiling_paused) {
                                            pevents =
                                                cuda_get_events(&ctx->cuda,
                                                                &ctx->mainzisegred_large_220344_runs,
                                                                &ctx->mainzisegred_large_220344_total_runtime);
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                               0));
                                        }
                                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_large_220344,
                                                                              grid[0],
                                                                              grid[1],
                                                                              grid[2],
                                                                              segred_group_sizze_220335,
                                                                              1,
                                                                              1,
                                                                              0 +
                                                                              (shared_sizze_238222 +
                                                                               (8 -
                                                                                shared_sizze_238222 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238224 +
                                                                               (8 -
                                                                                shared_sizze_238224 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238226 +
                                                                               (8 -
                                                                                shared_sizze_238226 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238228 +
                                                                               (8 -
                                                                                shared_sizze_238228 %
                                                                                8) %
                                                                               8),
                                                                              NULL,
                                                                              kernel_args_238219,
                                                                              NULL));
                                        if (pevents != NULL)
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                               0));
                                        if (ctx->debugging) {
                                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                            time_end_238221 = get_wall_time();
                                            fprintf(ctx->log,
                                                    "Kernel %s runtime: %ldus\n",
                                                    "main.segred_large_220344",
                                                    time_end_238221 -
                                                    time_start_238220);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235061,
                                                              "segred_tmp_mem_235061") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235059,
                                                              "segred_tmp_mem_235059") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235057,
                                                              "segred_tmp_mem_235057") !=
                                        0)
                                        return 1;
                                }
                                
                                int64_t segmap_usable_groups_220384 =
                                        sdiv_up64(nest_sizze_209492,
                                                  segmap_group_sizze_220383);
                                struct memblock_device mem_230689;
                                
                                mem_230689.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230689,
                                                          bytes_229378,
                                                          "mem_230689")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230693;
                                
                                mem_230693.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230693,
                                                          bytes_229378,
                                                          "mem_230693")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230697;
                                
                                mem_230697.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230697,
                                                          bytes_229378,
                                                          "mem_230697")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                                
                                CUdeviceptr kernel_arg_238243 = mem_230676.mem;
                                CUdeviceptr kernel_arg_238244 = mem_230680.mem;
                                CUdeviceptr kernel_arg_238245 = mem_230684.mem;
                                CUdeviceptr kernel_arg_238246 = mem_230689.mem;
                                CUdeviceptr kernel_arg_238247 = mem_230693.mem;
                                CUdeviceptr kernel_arg_238248 = mem_230697.mem;
                                
                                if ((((((1 && segmap_usable_groups_220384 !=
                                         0) && 1 != 0) && 1 != 0) &&
                                      segmap_group_sizze_220383 != 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_220384;
                                    grid[perm[1]] = 1;
                                    grid[perm[2]] = 1;
                                    
                                    void *kernel_args_238240[] =
                                         {&ctx->global_failure,
                                          &partition_sizze_203577,
                                          &l_n_m_203643, &kernel_arg_238243,
                                          &kernel_arg_238244,
                                          &kernel_arg_238245,
                                          &kernel_arg_238246,
                                          &kernel_arg_238247,
                                          &kernel_arg_238248};
                                    int64_t time_start_238241 = 0,
                                            time_end_238242 = 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_220390",
                                                (long) segmap_usable_groups_220384,
                                                (long) 1, (long) 1,
                                                (long) segmap_group_sizze_220383,
                                                (long) 1, (long) 1, (int) 0);
                                        time_start_238241 = get_wall_time();
                                    }
                                    
                                    cudaEvent_t *pevents = NULL;
                                    
                                    if (ctx->profiling &&
                                        !ctx->profiling_paused) {
                                        pevents = cuda_get_events(&ctx->cuda,
                                                                  &ctx->mainzisegmap_220390_runs,
                                                                  &ctx->mainzisegmap_220390_total_runtime);
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                           0));
                                    }
                                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_220390,
                                                                          grid[0],
                                                                          grid[1],
                                                                          grid[2],
                                                                          segmap_group_sizze_220383,
                                                                          1, 1,
                                                                          0,
                                                                          NULL,
                                                                          kernel_args_238240,
                                                                          NULL));
                                    if (pevents != NULL)
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                           0));
                                    if (ctx->debugging) {
                                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                        time_end_238242 = get_wall_time();
                                        fprintf(ctx->log,
                                                "Kernel %s runtime: %ldus\n",
                                                "main.segmap_220390",
                                                time_end_238242 -
                                                time_start_238241);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_unref_device(ctx, &mem_230676,
                                                          "mem_230676") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230680,
                                                          "mem_230680") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230684,
                                                          "mem_230684") != 0)
                                    return 1;
                                
                                struct memblock_device mem_230702;
                                
                                mem_230702.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230702,
                                                          bytes_229378,
                                                          "mem_230702")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230706;
                                
                                mem_230706.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230706,
                                                          bytes_229378,
                                                          "mem_230706")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (slt64(q_l_203495 * (int64_t) 2,
                                          segred_group_sizze_220405)) {
                                    int64_t segment_sizze_nonzzero_235121 =
                                            smax64((int64_t) 1, q_l_203495);
                                    int64_t num_threads_235122 =
                                            num_groups_220406 *
                                            segred_group_sizze_220405;
                                    
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n",
                                                "\n# SegRed-small");
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_segments",
                                                (long long) (partition_sizze_203577 *
                                                             l_n_m_203643),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_l_203495, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segments_per_group",
                                                (long long) squot64(segred_group_sizze_220405,
                                                                    segment_sizze_nonzzero_235121),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "required_groups",
                                                (long long) sext_i64_i32(sdiv_up64(partition_sizze_203577 *
                                                                                   l_n_m_203643,
                                                                                   squot64(segred_group_sizze_220405,
                                                                                           segment_sizze_nonzzero_235121))),
                                                '\n');
                                    
                                    unsigned int shared_sizze_238252 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_220405;
                                    unsigned int shared_sizze_238254 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_220405;
                                    CUdeviceptr kernel_arg_238256 =
                                                ext_mem_229411.mem;
                                    CUdeviceptr kernel_arg_238257 =
                                                ext_mem_229412.mem;
                                    CUdeviceptr kernel_arg_238258 =
                                                mem_param_229493.mem;
                                    CUdeviceptr kernel_arg_238259 =
                                                mem_230551.mem;
                                    CUdeviceptr kernel_arg_238260 =
                                                mem_230689.mem;
                                    CUdeviceptr kernel_arg_238261 =
                                                mem_230693.mem;
                                    CUdeviceptr kernel_arg_238262 =
                                                mem_230697.mem;
                                    CUdeviceptr kernel_arg_238263 =
                                                mem_230702.mem;
                                    CUdeviceptr kernel_arg_238264 =
                                                mem_230706.mem;
                                    unsigned int shared_offset_238253 = 0;
                                    unsigned int shared_offset_238255 = 0 +
                                                 (shared_sizze_238252 + (8 -
                                                                         shared_sizze_238252 %
                                                                         8) %
                                                  8);
                                    
                                    if ((((((1 && num_groups_220406 != 0) &&
                                            1 != 0) && 1 != 0) &&
                                          segred_group_sizze_220405 != 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_220406;
                                        grid[perm[1]] = 1;
                                        grid[perm[2]] = 1;
                                        
                                        void *kernel_args_238249[] =
                                             {&ctx->global_failure,
                                              &shared_offset_238253,
                                              &shared_offset_238255, &n_203490,
                                              &q_l_203495, &jump_t_203500,
                                              &partition_sizze_203577,
                                              &l_n_m_203643, &i_203670,
                                              &num_groups_220406,
                                              &ctx_param_ext_229488,
                                              &ctx_param_ext_229489,
                                              &ctx_param_ext_229491,
                                              &segment_sizze_nonzzero_235121,
                                              &kernel_arg_238256,
                                              &kernel_arg_238257,
                                              &kernel_arg_238258,
                                              &kernel_arg_238259,
                                              &kernel_arg_238260,
                                              &kernel_arg_238261,
                                              &kernel_arg_238262,
                                              &kernel_arg_238263,
                                              &kernel_arg_238264};
                                        int64_t time_start_238250 = 0,
                                                time_end_238251 = 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_220413",
                                                    (long) num_groups_220406,
                                                    (long) 1, (long) 1,
                                                    (long) segred_group_sizze_220405,
                                                    (long) 1, (long) 1,
                                                    (int) (0 +
                                                           (shared_sizze_238252 +
                                                            (8 -
                                                             shared_sizze_238252 %
                                                             8) % 8) +
                                                           (shared_sizze_238254 +
                                                            (8 -
                                                             shared_sizze_238254 %
                                                             8) % 8)));
                                            time_start_238250 = get_wall_time();
                                        }
                                        
                                        cudaEvent_t *pevents = NULL;
                                        
                                        if (ctx->profiling &&
                                            !ctx->profiling_paused) {
                                            pevents =
                                                cuda_get_events(&ctx->cuda,
                                                                &ctx->mainzisegred_small_220413_runs,
                                                                &ctx->mainzisegred_small_220413_total_runtime);
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                               0));
                                        }
                                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_small_220413,
                                                                              grid[0],
                                                                              grid[1],
                                                                              grid[2],
                                                                              segred_group_sizze_220405,
                                                                              1,
                                                                              1,
                                                                              0 +
                                                                              (shared_sizze_238252 +
                                                                               (8 -
                                                                                shared_sizze_238252 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238254 +
                                                                               (8 -
                                                                                shared_sizze_238254 %
                                                                                8) %
                                                                               8),
                                                                              NULL,
                                                                              kernel_args_238249,
                                                                              NULL));
                                        if (pevents != NULL)
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                               0));
                                        if (ctx->debugging) {
                                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                            time_end_238251 = get_wall_time();
                                            fprintf(ctx->log,
                                                    "Kernel %s runtime: %ldus\n",
                                                    "main.segred_small_220413",
                                                    time_end_238251 -
                                                    time_start_238250);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                } else {
                                    int64_t groups_per_segment_235156 =
                                            sdiv_up64(num_groups_220406,
                                                      smax64((int64_t) 1,
                                                             partition_sizze_203577 *
                                                             l_n_m_203643));
                                    int64_t elements_per_thread_235157 =
                                            sdiv_up64(q_l_203495,
                                                      segred_group_sizze_220405 *
                                                      groups_per_segment_235156);
                                    int64_t virt_num_groups_235158 =
                                            groups_per_segment_235156 *
                                            (partition_sizze_203577 *
                                             l_n_m_203643);
                                    int64_t num_threads_235159 =
                                            num_groups_220406 *
                                            segred_group_sizze_220405;
                                    int64_t threads_per_segment_235160 =
                                            groups_per_segment_235156 *
                                            segred_group_sizze_220405;
                                    
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n",
                                                "\n# SegRed-large");
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_segments",
                                                (long long) (partition_sizze_203577 *
                                                             l_n_m_203643),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_l_203495, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "virt_num_groups",
                                                (long long) virt_num_groups_235158,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_groups",
                                                (long long) num_groups_220406,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "group_size",
                                                (long long) segred_group_sizze_220405,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "elems_per_thread",
                                                (long long) elements_per_thread_235157,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "groups_per_segment",
                                                (long long) groups_per_segment_235156,
                                                '\n');
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235161;
                                    
                                    segred_tmp_mem_235161.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235161,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235158,
                                                              "segred_tmp_mem_235161")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235163;
                                    
                                    segred_tmp_mem_235163.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235163,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235158,
                                                              "segred_tmp_mem_235163")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    mainzicounter_mem_235165 =
                                    ctx->mainzicounter_mem_235165;
                                    unsigned int shared_sizze_238269 = 1;
                                    unsigned int shared_sizze_238271 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_220405;
                                    unsigned int shared_sizze_238273 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_220405;
                                    CUdeviceptr kernel_arg_238275 =
                                                ext_mem_229411.mem;
                                    CUdeviceptr kernel_arg_238276 =
                                                ext_mem_229412.mem;
                                    CUdeviceptr kernel_arg_238277 =
                                                mem_param_229493.mem;
                                    CUdeviceptr kernel_arg_238278 =
                                                mem_230551.mem;
                                    CUdeviceptr kernel_arg_238279 =
                                                mem_230689.mem;
                                    CUdeviceptr kernel_arg_238280 =
                                                mem_230693.mem;
                                    CUdeviceptr kernel_arg_238281 =
                                                mem_230697.mem;
                                    CUdeviceptr kernel_arg_238282 =
                                                mem_230702.mem;
                                    CUdeviceptr kernel_arg_238283 =
                                                mem_230706.mem;
                                    CUdeviceptr kernel_arg_238284 =
                                                segred_tmp_mem_235161.mem;
                                    CUdeviceptr kernel_arg_238285 =
                                                segred_tmp_mem_235163.mem;
                                    CUdeviceptr kernel_arg_238286 =
                                                mainzicounter_mem_235165.mem;
                                    unsigned int shared_offset_238270 = 0;
                                    unsigned int shared_offset_238272 = 0 +
                                                 (shared_sizze_238269 + (8 -
                                                                         shared_sizze_238269 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_238274 = 0 +
                                                 (shared_sizze_238269 + (8 -
                                                                         shared_sizze_238269 %
                                                                         8) %
                                                  8) + (shared_sizze_238271 +
                                                        (8 -
                                                         shared_sizze_238271 %
                                                         8) % 8);
                                    
                                    if ((((((1 && num_groups_220406 != 0) &&
                                            1 != 0) && 1 != 0) &&
                                          segred_group_sizze_220405 != 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_220406;
                                        grid[perm[1]] = 1;
                                        grid[perm[2]] = 1;
                                        
                                        void *kernel_args_238266[] =
                                             {&ctx->global_failure,
                                              &shared_offset_238270,
                                              &shared_offset_238272,
                                              &shared_offset_238274, &n_203490,
                                              &q_l_203495, &jump_t_203500,
                                              &partition_sizze_203577,
                                              &l_n_m_203643, &i_203670,
                                              &num_groups_220406,
                                              &ctx_param_ext_229488,
                                              &ctx_param_ext_229489,
                                              &ctx_param_ext_229491,
                                              &groups_per_segment_235156,
                                              &elements_per_thread_235157,
                                              &virt_num_groups_235158,
                                              &threads_per_segment_235160,
                                              &kernel_arg_238275,
                                              &kernel_arg_238276,
                                              &kernel_arg_238277,
                                              &kernel_arg_238278,
                                              &kernel_arg_238279,
                                              &kernel_arg_238280,
                                              &kernel_arg_238281,
                                              &kernel_arg_238282,
                                              &kernel_arg_238283,
                                              &kernel_arg_238284,
                                              &kernel_arg_238285,
                                              &kernel_arg_238286};
                                        int64_t time_start_238267 = 0,
                                                time_end_238268 = 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_220413",
                                                    (long) num_groups_220406,
                                                    (long) 1, (long) 1,
                                                    (long) segred_group_sizze_220405,
                                                    (long) 1, (long) 1,
                                                    (int) (0 +
                                                           (shared_sizze_238269 +
                                                            (8 -
                                                             shared_sizze_238269 %
                                                             8) % 8) +
                                                           (shared_sizze_238271 +
                                                            (8 -
                                                             shared_sizze_238271 %
                                                             8) % 8) +
                                                           (shared_sizze_238273 +
                                                            (8 -
                                                             shared_sizze_238273 %
                                                             8) % 8)));
                                            time_start_238267 = get_wall_time();
                                        }
                                        
                                        cudaEvent_t *pevents = NULL;
                                        
                                        if (ctx->profiling &&
                                            !ctx->profiling_paused) {
                                            pevents =
                                                cuda_get_events(&ctx->cuda,
                                                                &ctx->mainzisegred_large_220413_runs,
                                                                &ctx->mainzisegred_large_220413_total_runtime);
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                               0));
                                        }
                                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_large_220413,
                                                                              grid[0],
                                                                              grid[1],
                                                                              grid[2],
                                                                              segred_group_sizze_220405,
                                                                              1,
                                                                              1,
                                                                              0 +
                                                                              (shared_sizze_238269 +
                                                                               (8 -
                                                                                shared_sizze_238269 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238271 +
                                                                               (8 -
                                                                                shared_sizze_238271 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238273 +
                                                                               (8 -
                                                                                shared_sizze_238273 %
                                                                                8) %
                                                                               8),
                                                                              NULL,
                                                                              kernel_args_238266,
                                                                              NULL));
                                        if (pevents != NULL)
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                               0));
                                        if (ctx->debugging) {
                                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                            time_end_238268 = get_wall_time();
                                            fprintf(ctx->log,
                                                    "Kernel %s runtime: %ldus\n",
                                                    "main.segred_large_220413",
                                                    time_end_238268 -
                                                    time_start_238267);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235163,
                                                              "segred_tmp_mem_235163") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235161,
                                                              "segred_tmp_mem_235161") !=
                                        0)
                                        return 1;
                                }
                                if (memblock_unref_device(ctx, &mem_230689,
                                                          "mem_230689") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230693,
                                                          "mem_230693") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230697,
                                                          "mem_230697") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_230708,
                                                        &mem_230702,
                                                        "mem_230702") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_230707,
                                                        &mem_230706,
                                                        "mem_230706") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230706,
                                                          "mem_230706") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230702,
                                                          "mem_230702") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230697,
                                                          "mem_230697") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230693,
                                                          "mem_230693") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230689,
                                                          "mem_230689") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230684,
                                                          "mem_230684") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230680,
                                                          "mem_230680") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230676,
                                                          "mem_230676") != 0)
                                    return 1;
                            }
                            if (memblock_set_device(ctx, &ext_mem_230720,
                                                    &ext_mem_230708,
                                                    "ext_mem_230708") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_230719,
                                                    &ext_mem_230707,
                                                    "ext_mem_230707") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230707,
                                                      "ext_mem_230707") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230708,
                                                      "ext_mem_230708") != 0)
                                return 1;
                        }
                        if (memblock_set_device(ctx, &ext_mem_230845,
                                                &ext_mem_230720,
                                                "ext_mem_230720") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_230844,
                                                &ext_mem_230719,
                                                "ext_mem_230719") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230719,
                                                  "ext_mem_230719") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230720,
                                                  "ext_mem_230720") != 0)
                            return 1;
                    } else {
                        bool suff_outer_par_220469;
                        
                        suff_outer_par_220469 =
                            *ctx->tuning_params.mainzisuff_outer_par_26 <=
                            partition_sizze_203577;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_26",
                                    (long) partition_sizze_203577,
                                    suff_outer_par_220469 ? "true" : "false");
                        
                        int64_t segmap_group_sizze_220603;
                        
                        segmap_group_sizze_220603 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_220473;
                        
                        int64_t num_groups_220604;
                        int32_t max_num_groups_235209;
                        
                        max_num_groups_235209 =
                            *ctx->tuning_params.mainzisegmap_num_groups_220475;
                        num_groups_220604 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(partition_sizze_203577,
                                                                                 segmap_group_sizze_220603),
                                                                       sext_i32_i64(max_num_groups_235209))));
                        
                        int64_t segmap_group_sizze_221267;
                        
                        segmap_group_sizze_221267 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_220737;
                        
                        bool suff_outer_par_221271;
                        
                        suff_outer_par_221271 =
                            *ctx->tuning_params.mainzisuff_outer_par_27 <=
                            nest_sizze_209492;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_27",
                                    (long) nest_sizze_209492,
                                    suff_outer_par_221271 ? "true" : "false");
                        
                        int64_t nest_sizze_221411 = q_l_203495 *
                                nest_sizze_209492;
                        int64_t segred_group_sizze_221412;
                        
                        segred_group_sizze_221412 =
                            *ctx->tuning_params.mainzisegred_group_sizze_221009;
                        
                        int64_t num_groups_221413;
                        int32_t max_num_groups_235210;
                        
                        max_num_groups_235210 =
                            *ctx->tuning_params.mainzisegred_num_groups_221011;
                        num_groups_221413 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(nest_sizze_221411,
                                                                                 segred_group_sizze_221412),
                                                                       sext_i32_i64(max_num_groups_235210))));
                        
                        int64_t segmap_group_sizze_221470;
                        
                        segmap_group_sizze_221470 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_220968;
                        
                        int64_t segred_group_sizze_221513;
                        
                        segred_group_sizze_221513 =
                            *ctx->tuning_params.mainzisegred_group_sizze_220883;
                        
                        int64_t num_groups_221514;
                        int32_t max_num_groups_235211;
                        
                        max_num_groups_235211 =
                            *ctx->tuning_params.mainzisegred_num_groups_220885;
                        num_groups_221514 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(nest_sizze_221411,
                                                                                 segred_group_sizze_221513),
                                                                       sext_i32_i64(max_num_groups_235211))));
                        
                        int64_t num_threads_232170 = segmap_group_sizze_220603 *
                                num_groups_220604;
                        int64_t total_sizze_232171 = bytes_229371 *
                                num_threads_232170;
                        int64_t total_sizze_232172 = bytes_229371 *
                                num_threads_232170;
                        struct memblock_device ext_mem_230843;
                        
                        ext_mem_230843.references = NULL;
                        
                        struct memblock_device ext_mem_230842;
                        
                        ext_mem_230842.references = NULL;
                        
                        int32_t local_memory_capacity_235490;
                        
                        local_memory_capacity_235490 =
                            ctx->cuda.max_shared_memory;
                        if ((sle64((int64_t) 0,
                                   sext_i32_i64(local_memory_capacity_235490)) &&
                             sle64((int64_t) 0,
                                   sext_i32_i64(local_memory_capacity_235490))) &&
                            suff_outer_par_220469) {
                            struct memblock_device mem_230723;
                            
                            mem_230723.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230723,
                                                      binop_y_229377,
                                                      "mem_230723")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_230723,
                                                                      (int64_t) 0,
                                                                      ext_mem_229412,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      l_n_m_203643,
                                                                      partition_sizze_203577) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230723,
                                                          "mem_230723") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230842,
                                                          "ext_mem_230842") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230843,
                                                          "ext_mem_230843") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230844,
                                                          "ext_mem_230844") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230845,
                                                          "ext_mem_230845") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230846,
                                                          "ext_mem_230846") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230847,
                                                          "ext_mem_230847") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230907,
                                                          "ext_mem_230907") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230908,
                                                          "ext_mem_230908") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230546,
                                                          "ext_mem_230546") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230529,
                                                          "ext_mem_230529") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230512,
                                                          "ext_mem_230512") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230494,
                                                          "ext_mem_230494") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230726;
                            
                            mem_230726.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230726,
                                                      binop_y_229377,
                                                      "mem_230726")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230726,
                                                                      (int64_t) 0,
                                                                      ext_mem_229411,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      l_n_m_203643,
                                                                      partition_sizze_203577) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230726,
                                                          "mem_230726") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230723,
                                                          "mem_230723") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230842,
                                                          "ext_mem_230842") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230843,
                                                          "ext_mem_230843") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230844,
                                                          "ext_mem_230844") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230845,
                                                          "ext_mem_230845") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230846,
                                                          "ext_mem_230846") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230847,
                                                          "ext_mem_230847") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230907,
                                                          "ext_mem_230907") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230908,
                                                          "ext_mem_230908") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230546,
                                                          "ext_mem_230546") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230529,
                                                          "ext_mem_230529") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230512,
                                                          "ext_mem_230512") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230494,
                                                          "ext_mem_230494") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230729;
                            
                            mem_230729.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230729,
                                                      binop_y_229176,
                                                      "mem_230729")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            int64_t group_sizze_235215;
                            
                            group_sizze_235215 =
                                *ctx->tuning_params.mainzigroup_sizze_235215;
                            
                            int64_t num_groups_235216 =
                                    sdiv_up64(partition_sizze_203577 * n_203490,
                                              group_sizze_235215);
                            CUdeviceptr kernel_arg_238290 =
                                        mem_param_229493.mem;
                            CUdeviceptr kernel_arg_238291 = mem_230729.mem;
                            
                            if ((((((1 && num_groups_235216 != 0) && 1 != 0) &&
                                   1 != 0) && group_sizze_235215 != 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_235216;
                                grid[perm[1]] = 1;
                                grid[perm[2]] = 1;
                                
                                void *kernel_args_238287[] = {&n_203490,
                                                              &partition_sizze_203577,
                                                              &ctx_param_ext_229488,
                                                              &ctx_param_ext_229489,
                                                              &ctx_param_ext_229491,
                                                              &kernel_arg_238290,
                                                              &kernel_arg_238291};
                                int64_t time_start_238288 = 0, time_end_238289 =
                                        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_235212",
                                            (long) num_groups_235216, (long) 1,
                                            (long) 1, (long) group_sizze_235215,
                                            (long) 1, (long) 1, (int) 0);
                                    time_start_238288 = get_wall_time();
                                }
                                
                                cudaEvent_t *pevents = NULL;
                                
                                if (ctx->profiling && !ctx->profiling_paused) {
                                    pevents = cuda_get_events(&ctx->cuda,
                                                              &ctx->mainzicopy_235212_runs,
                                                              &ctx->mainzicopy_235212_total_runtime);
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                       0));
                                }
                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzicopy_235212,
                                                                      grid[0],
                                                                      grid[1],
                                                                      grid[2],
                                                                      group_sizze_235215,
                                                                      1, 1, 0,
                                                                      NULL,
                                                                      kernel_args_238287,
                                                                      NULL));
                                if (pevents != NULL)
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                       0));
                                if (ctx->debugging) {
                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                    time_end_238289 = get_wall_time();
                                    fprintf(ctx->log,
                                            "Kernel %s runtime: %ldus\n",
                                            "main.copy_235212",
                                            time_end_238289 -
                                            time_start_238288);
                                }
                            }
                            
                            struct memblock_device mem_230732;
                            
                            mem_230732.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230732,
                                                      binop_y_229176,
                                                      "mem_230732")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230732,
                                                                      (int64_t) 0,
                                                                      mem_230551,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_203490,
                                                                      partition_sizze_203577) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230732,
                                                          "mem_230732") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230729,
                                                          "mem_230729") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230726,
                                                          "mem_230726") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230723,
                                                          "mem_230723") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230842,
                                                          "ext_mem_230842") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230843,
                                                          "ext_mem_230843") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230844,
                                                          "ext_mem_230844") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230845,
                                                          "ext_mem_230845") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230846,
                                                          "ext_mem_230846") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230847,
                                                          "ext_mem_230847") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230907,
                                                          "ext_mem_230907") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230908,
                                                          "ext_mem_230908") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230546,
                                                          "ext_mem_230546") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230529,
                                                          "ext_mem_230529") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230512,
                                                          "ext_mem_230512") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230494,
                                                          "ext_mem_230494") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230766;
                            
                            mem_230766.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230766,
                                                      binop_y_229377,
                                                      "mem_230766")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230769;
                            
                            mem_230769.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230769,
                                                      binop_y_229377,
                                                      "mem_230769")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232030;
                            
                            color_232030.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232030,
                                                      total_sizze_232171,
                                                      "color_232030")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232031;
                            
                            color_232031.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232031,
                                                      total_sizze_232172,
                                                      "color_232031")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            
                            CUdeviceptr kernel_arg_238295 = mem_230723.mem;
                            CUdeviceptr kernel_arg_238296 = mem_230726.mem;
                            CUdeviceptr kernel_arg_238297 = mem_230729.mem;
                            CUdeviceptr kernel_arg_238298 = mem_230732.mem;
                            CUdeviceptr kernel_arg_238299 = mem_230766.mem;
                            CUdeviceptr kernel_arg_238300 = mem_230769.mem;
                            CUdeviceptr kernel_arg_238301 = color_232030.mem;
                            CUdeviceptr kernel_arg_238302 = color_232031.mem;
                            
                            if ((((((1 && num_groups_220604 != 0) && 1 != 0) &&
                                   1 != 0) && segmap_group_sizze_220603 != 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_220604;
                                grid[perm[1]] = 1;
                                grid[perm[2]] = 1;
                                
                                void *kernel_args_238292[] =
                                     {&ctx->global_failure, &n_203490,
                                      &q_l_203495, &jump_t_203500,
                                      &partition_sizze_203577, &l_n_m_203643,
                                      &i_203670, &num_groups_220604,
                                      &num_threads_232170, &kernel_arg_238295,
                                      &kernel_arg_238296, &kernel_arg_238297,
                                      &kernel_arg_238298, &kernel_arg_238299,
                                      &kernel_arg_238300, &kernel_arg_238301,
                                      &kernel_arg_238302};
                                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.segmap_220609",
                                            (long) num_groups_220604, (long) 1,
                                            (long) 1,
                                            (long) segmap_group_sizze_220603,
                                            (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->mainzisegmap_220609_runs,
                                                              &ctx->mainzisegmap_220609_total_runtime);
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                       0));
                                }
                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_220609,
                                                                      grid[0],
                                                                      grid[1],
                                                                      grid[2],
                                                                      segmap_group_sizze_220603,
                                                                      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.segmap_220609",
                                            time_end_238294 -
                                            time_start_238293);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx, &mem_230723,
                                                      "mem_230723") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230726,
                                                      "mem_230726") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230729,
                                                      "mem_230729") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230732,
                                                      "mem_230732") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232030,
                                                      "color_232030") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232031,
                                                      "color_232031") != 0)
                                return 1;
                            
                            struct memblock_device mem_230835;
                            
                            mem_230835.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230835,
                                                      bytes_229378,
                                                      "mem_230835")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230835,
                                                                      (int64_t) 0,
                                                                      mem_230766,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      partition_sizze_203577,
                                                                      l_n_m_203643) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230835,
                                                          "mem_230835") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232031,
                                                          "color_232031") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232030,
                                                          "color_232030") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230769,
                                                          "mem_230769") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230766,
                                                          "mem_230766") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230732,
                                                          "mem_230732") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230729,
                                                          "mem_230729") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230726,
                                                          "mem_230726") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230723,
                                                          "mem_230723") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230842,
                                                          "ext_mem_230842") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230843,
                                                          "ext_mem_230843") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230844,
                                                          "ext_mem_230844") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230845,
                                                          "ext_mem_230845") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230846,
                                                          "ext_mem_230846") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230847,
                                                          "ext_mem_230847") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230907,
                                                          "ext_mem_230907") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230908,
                                                          "ext_mem_230908") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230546,
                                                          "ext_mem_230546") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230529,
                                                          "ext_mem_230529") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230512,
                                                          "ext_mem_230512") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230494,
                                                          "ext_mem_230494") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_230766,
                                                      "mem_230766") != 0)
                                return 1;
                            
                            struct memblock_device mem_230840;
                            
                            mem_230840.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230840,
                                                      bytes_229378,
                                                      "mem_230840")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230840,
                                                                      (int64_t) 0,
                                                                      mem_230769,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      partition_sizze_203577,
                                                                      l_n_m_203643) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230840,
                                                          "mem_230840") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230835,
                                                          "mem_230835") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232031,
                                                          "color_232031") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232030,
                                                          "color_232030") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230769,
                                                          "mem_230769") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230766,
                                                          "mem_230766") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230732,
                                                          "mem_230732") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230729,
                                                          "mem_230729") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230726,
                                                          "mem_230726") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230723,
                                                          "mem_230723") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230842,
                                                          "ext_mem_230842") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230843,
                                                          "ext_mem_230843") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230844,
                                                          "ext_mem_230844") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230845,
                                                          "ext_mem_230845") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230846,
                                                          "ext_mem_230846") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230847,
                                                          "ext_mem_230847") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230907,
                                                          "ext_mem_230907") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230908,
                                                          "ext_mem_230908") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230546,
                                                          "ext_mem_230546") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230529,
                                                          "ext_mem_230529") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230512,
                                                          "ext_mem_230512") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230494,
                                                          "ext_mem_230494") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_230769,
                                                      "mem_230769") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_230843,
                                                    &mem_230835,
                                                    "mem_230835") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_230842,
                                                    &mem_230840,
                                                    "mem_230840") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230840,
                                                      "mem_230840") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230835,
                                                      "mem_230835") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232031,
                                                      "color_232031") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232030,
                                                      "color_232030") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230769,
                                                      "mem_230769") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230766,
                                                      "mem_230766") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230732,
                                                      "mem_230732") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230729,
                                                      "mem_230729") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230726,
                                                      "mem_230726") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230723,
                                                      "mem_230723") != 0)
                                return 1;
                        } else {
                            int64_t segmap_usable_groups_221268 =
                                    sdiv_up64(nest_sizze_209492,
                                              segmap_group_sizze_221267);
                            struct memblock_device ext_mem_230831;
                            
                            ext_mem_230831.references = NULL;
                            
                            struct memblock_device ext_mem_230830;
                            
                            ext_mem_230830.references = NULL;
                            
                            int32_t local_memory_capacity_235489;
                            
                            local_memory_capacity_235489 =
                                ctx->cuda.max_shared_memory;
                            if (sle64((int64_t) 0,
                                      sext_i32_i64(local_memory_capacity_235489)) &&
                                suff_outer_par_221271) {
                                struct memblock_device mem_230774;
                                
                                mem_230774.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230774,
                                                          bytes_229378,
                                                          "mem_230774")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230778;
                                
                                mem_230778.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230778,
                                                          bytes_229378,
                                                          "mem_230778")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                                
                                CUdeviceptr kernel_arg_238306 =
                                            ext_mem_229411.mem;
                                CUdeviceptr kernel_arg_238307 =
                                            ext_mem_229412.mem;
                                CUdeviceptr kernel_arg_238308 =
                                            mem_param_229493.mem;
                                CUdeviceptr kernel_arg_238309 = mem_230551.mem;
                                CUdeviceptr kernel_arg_238310 = mem_230774.mem;
                                CUdeviceptr kernel_arg_238311 = mem_230778.mem;
                                
                                if ((((((1 && segmap_usable_groups_221268 !=
                                         0) && 1 != 0) && 1 != 0) &&
                                      segmap_group_sizze_221267 != 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_221268;
                                    grid[perm[1]] = 1;
                                    grid[perm[2]] = 1;
                                    
                                    void *kernel_args_238303[] =
                                         {&ctx->global_failure, &n_203490,
                                          &q_l_203495, &jump_t_203500,
                                          &partition_sizze_203577,
                                          &l_n_m_203643, &i_203670,
                                          &ctx_param_ext_229488,
                                          &ctx_param_ext_229489,
                                          &ctx_param_ext_229491,
                                          &kernel_arg_238306,
                                          &kernel_arg_238307,
                                          &kernel_arg_238308,
                                          &kernel_arg_238309,
                                          &kernel_arg_238310,
                                          &kernel_arg_238311};
                                    int64_t time_start_238304 = 0,
                                            time_end_238305 = 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_221278",
                                                (long) segmap_usable_groups_221268,
                                                (long) 1, (long) 1,
                                                (long) segmap_group_sizze_221267,
                                                (long) 1, (long) 1, (int) 0);
                                        time_start_238304 = get_wall_time();
                                    }
                                    
                                    cudaEvent_t *pevents = NULL;
                                    
                                    if (ctx->profiling &&
                                        !ctx->profiling_paused) {
                                        pevents = cuda_get_events(&ctx->cuda,
                                                                  &ctx->mainzisegmap_221278_runs,
                                                                  &ctx->mainzisegmap_221278_total_runtime);
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                           0));
                                    }
                                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_221278,
                                                                          grid[0],
                                                                          grid[1],
                                                                          grid[2],
                                                                          segmap_group_sizze_221267,
                                                                          1, 1,
                                                                          0,
                                                                          NULL,
                                                                          kernel_args_238303,
                                                                          NULL));
                                    if (pevents != NULL)
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                           0));
                                    if (ctx->debugging) {
                                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                        time_end_238305 = get_wall_time();
                                        fprintf(ctx->log,
                                                "Kernel %s runtime: %ldus\n",
                                                "main.segmap_221278",
                                                time_end_238305 -
                                                time_start_238304);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_set_device(ctx, &ext_mem_230831,
                                                        &mem_230774,
                                                        "mem_230774") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_230830,
                                                        &mem_230778,
                                                        "mem_230778") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230778,
                                                          "mem_230778") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230774,
                                                          "mem_230774") != 0)
                                    return 1;
                            } else {
                                struct memblock_device mem_230783;
                                
                                mem_230783.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230783,
                                                          bytes_229378,
                                                          "mem_230783")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230787;
                                
                                mem_230787.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230787,
                                                          bytes_229378,
                                                          "mem_230787")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230791;
                                
                                mem_230791.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230791,
                                                          bytes_229378,
                                                          "mem_230791")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230795;
                                
                                mem_230795.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230795,
                                                          bytes_229378,
                                                          "mem_230795")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230799;
                                
                                mem_230799.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230799,
                                                          bytes_229378,
                                                          "mem_230799")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (slt64(q_l_203495 * (int64_t) 2,
                                          segred_group_sizze_221412)) {
                                    int64_t segment_sizze_nonzzero_235265 =
                                            smax64((int64_t) 1, q_l_203495);
                                    int64_t num_threads_235266 =
                                            num_groups_221413 *
                                            segred_group_sizze_221412;
                                    
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n",
                                                "\n# SegRed-small");
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_segments",
                                                (long long) (partition_sizze_203577 *
                                                             l_n_m_203643),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_l_203495, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segments_per_group",
                                                (long long) squot64(segred_group_sizze_221412,
                                                                    segment_sizze_nonzzero_235265),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "required_groups",
                                                (long long) sext_i64_i32(sdiv_up64(partition_sizze_203577 *
                                                                                   l_n_m_203643,
                                                                                   squot64(segred_group_sizze_221412,
                                                                                           segment_sizze_nonzzero_235265))),
                                                '\n');
                                    
                                    unsigned int shared_sizze_238315 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_221412;
                                    unsigned int shared_sizze_238317 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_221412;
                                    unsigned int shared_sizze_238319 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_221412;
                                    unsigned int shared_sizze_238321 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_221412;
                                    unsigned int shared_sizze_238323 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_221412;
                                    CUdeviceptr kernel_arg_238325 =
                                                ext_mem_229411.mem;
                                    CUdeviceptr kernel_arg_238326 =
                                                ext_mem_229412.mem;
                                    CUdeviceptr kernel_arg_238327 =
                                                mem_param_229493.mem;
                                    CUdeviceptr kernel_arg_238328 =
                                                mem_230783.mem;
                                    CUdeviceptr kernel_arg_238329 =
                                                mem_230787.mem;
                                    CUdeviceptr kernel_arg_238330 =
                                                mem_230791.mem;
                                    CUdeviceptr kernel_arg_238331 =
                                                mem_230795.mem;
                                    CUdeviceptr kernel_arg_238332 =
                                                mem_230799.mem;
                                    unsigned int shared_offset_238316 = 0;
                                    unsigned int shared_offset_238318 = 0 +
                                                 (shared_sizze_238315 + (8 -
                                                                         shared_sizze_238315 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_238320 = 0 +
                                                 (shared_sizze_238315 + (8 -
                                                                         shared_sizze_238315 %
                                                                         8) %
                                                  8) + (shared_sizze_238317 +
                                                        (8 -
                                                         shared_sizze_238317 %
                                                         8) % 8);
                                    unsigned int shared_offset_238322 = 0 +
                                                 (shared_sizze_238315 + (8 -
                                                                         shared_sizze_238315 %
                                                                         8) %
                                                  8) + (shared_sizze_238317 +
                                                        (8 -
                                                         shared_sizze_238317 %
                                                         8) % 8) +
                                                 (shared_sizze_238319 + (8 -
                                                                         shared_sizze_238319 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_238324 = 0 +
                                                 (shared_sizze_238315 + (8 -
                                                                         shared_sizze_238315 %
                                                                         8) %
                                                  8) + (shared_sizze_238317 +
                                                        (8 -
                                                         shared_sizze_238317 %
                                                         8) % 8) +
                                                 (shared_sizze_238319 + (8 -
                                                                         shared_sizze_238319 %
                                                                         8) %
                                                  8) + (shared_sizze_238321 +
                                                        (8 -
                                                         shared_sizze_238321 %
                                                         8) % 8);
                                    
                                    if ((((((1 && num_groups_221413 != 0) &&
                                            1 != 0) && 1 != 0) &&
                                          segred_group_sizze_221412 != 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_221413;
                                        grid[perm[1]] = 1;
                                        grid[perm[2]] = 1;
                                        
                                        void *kernel_args_238312[] =
                                             {&ctx->global_failure,
                                              &shared_offset_238316,
                                              &shared_offset_238318,
                                              &shared_offset_238320,
                                              &shared_offset_238322,
                                              &shared_offset_238324, &n_203490,
                                              &q_l_203495, &jump_t_203500,
                                              &partition_sizze_203577,
                                              &l_n_m_203643, &i_203670,
                                              &num_groups_221413,
                                              &ctx_param_ext_229488,
                                              &ctx_param_ext_229489,
                                              &ctx_param_ext_229491,
                                              &segment_sizze_nonzzero_235265,
                                              &kernel_arg_238325,
                                              &kernel_arg_238326,
                                              &kernel_arg_238327,
                                              &kernel_arg_238328,
                                              &kernel_arg_238329,
                                              &kernel_arg_238330,
                                              &kernel_arg_238331,
                                              &kernel_arg_238332};
                                        int64_t time_start_238313 = 0,
                                                time_end_238314 = 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_221423",
                                                    (long) num_groups_221413,
                                                    (long) 1, (long) 1,
                                                    (long) segred_group_sizze_221412,
                                                    (long) 1, (long) 1,
                                                    (int) (0 +
                                                           (shared_sizze_238315 +
                                                            (8 -
                                                             shared_sizze_238315 %
                                                             8) % 8) +
                                                           (shared_sizze_238317 +
                                                            (8 -
                                                             shared_sizze_238317 %
                                                             8) % 8) +
                                                           (shared_sizze_238319 +
                                                            (8 -
                                                             shared_sizze_238319 %
                                                             8) % 8) +
                                                           (shared_sizze_238321 +
                                                            (8 -
                                                             shared_sizze_238321 %
                                                             8) % 8) +
                                                           (shared_sizze_238323 +
                                                            (8 -
                                                             shared_sizze_238323 %
                                                             8) % 8)));
                                            time_start_238313 = get_wall_time();
                                        }
                                        
                                        cudaEvent_t *pevents = NULL;
                                        
                                        if (ctx->profiling &&
                                            !ctx->profiling_paused) {
                                            pevents =
                                                cuda_get_events(&ctx->cuda,
                                                                &ctx->mainzisegred_small_221423_runs,
                                                                &ctx->mainzisegred_small_221423_total_runtime);
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                               0));
                                        }
                                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_small_221423,
                                                                              grid[0],
                                                                              grid[1],
                                                                              grid[2],
                                                                              segred_group_sizze_221412,
                                                                              1,
                                                                              1,
                                                                              0 +
                                                                              (shared_sizze_238315 +
                                                                               (8 -
                                                                                shared_sizze_238315 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238317 +
                                                                               (8 -
                                                                                shared_sizze_238317 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238319 +
                                                                               (8 -
                                                                                shared_sizze_238319 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238321 +
                                                                               (8 -
                                                                                shared_sizze_238321 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238323 +
                                                                               (8 -
                                                                                shared_sizze_238323 %
                                                                                8) %
                                                                               8),
                                                                              NULL,
                                                                              kernel_args_238312,
                                                                              NULL));
                                        if (pevents != NULL)
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                               0));
                                        if (ctx->debugging) {
                                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                            time_end_238314 = get_wall_time();
                                            fprintf(ctx->log,
                                                    "Kernel %s runtime: %ldus\n",
                                                    "main.segred_small_221423",
                                                    time_end_238314 -
                                                    time_start_238313);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                } else {
                                    int64_t groups_per_segment_235318 =
                                            sdiv_up64(num_groups_221413,
                                                      smax64((int64_t) 1,
                                                             partition_sizze_203577 *
                                                             l_n_m_203643));
                                    int64_t elements_per_thread_235319 =
                                            sdiv_up64(q_l_203495,
                                                      segred_group_sizze_221412 *
                                                      groups_per_segment_235318);
                                    int64_t virt_num_groups_235320 =
                                            groups_per_segment_235318 *
                                            (partition_sizze_203577 *
                                             l_n_m_203643);
                                    int64_t num_threads_235321 =
                                            num_groups_221413 *
                                            segred_group_sizze_221412;
                                    int64_t threads_per_segment_235322 =
                                            groups_per_segment_235318 *
                                            segred_group_sizze_221412;
                                    
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n",
                                                "\n# SegRed-large");
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_segments",
                                                (long long) (partition_sizze_203577 *
                                                             l_n_m_203643),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_l_203495, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "virt_num_groups",
                                                (long long) virt_num_groups_235320,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_groups",
                                                (long long) num_groups_221413,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "group_size",
                                                (long long) segred_group_sizze_221412,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "elems_per_thread",
                                                (long long) elements_per_thread_235319,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "groups_per_segment",
                                                (long long) groups_per_segment_235318,
                                                '\n');
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235323;
                                    
                                    segred_tmp_mem_235323.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235323,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235320,
                                                              "segred_tmp_mem_235323")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235325;
                                    
                                    segred_tmp_mem_235325.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235325,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235320,
                                                              "segred_tmp_mem_235325")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235327;
                                    
                                    segred_tmp_mem_235327.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235327,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235320,
                                                              "segred_tmp_mem_235327")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235329;
                                    
                                    segred_tmp_mem_235329.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235329,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235320,
                                                              "segred_tmp_mem_235329")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235331;
                                    
                                    segred_tmp_mem_235331.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235331,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235320,
                                                              "segred_tmp_mem_235331")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    mainzicounter_mem_235333 =
                                    ctx->mainzicounter_mem_235333;
                                    unsigned int shared_sizze_238337 = 1;
                                    unsigned int shared_sizze_238339 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_221412;
                                    unsigned int shared_sizze_238341 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_221412;
                                    unsigned int shared_sizze_238343 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_221412;
                                    unsigned int shared_sizze_238345 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_221412;
                                    unsigned int shared_sizze_238347 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_221412;
                                    CUdeviceptr kernel_arg_238349 =
                                                ext_mem_229411.mem;
                                    CUdeviceptr kernel_arg_238350 =
                                                ext_mem_229412.mem;
                                    CUdeviceptr kernel_arg_238351 =
                                                mem_param_229493.mem;
                                    CUdeviceptr kernel_arg_238352 =
                                                mem_230783.mem;
                                    CUdeviceptr kernel_arg_238353 =
                                                mem_230787.mem;
                                    CUdeviceptr kernel_arg_238354 =
                                                mem_230791.mem;
                                    CUdeviceptr kernel_arg_238355 =
                                                mem_230795.mem;
                                    CUdeviceptr kernel_arg_238356 =
                                                mem_230799.mem;
                                    CUdeviceptr kernel_arg_238357 =
                                                segred_tmp_mem_235323.mem;
                                    CUdeviceptr kernel_arg_238358 =
                                                segred_tmp_mem_235325.mem;
                                    CUdeviceptr kernel_arg_238359 =
                                                segred_tmp_mem_235327.mem;
                                    CUdeviceptr kernel_arg_238360 =
                                                segred_tmp_mem_235329.mem;
                                    CUdeviceptr kernel_arg_238361 =
                                                segred_tmp_mem_235331.mem;
                                    CUdeviceptr kernel_arg_238362 =
                                                mainzicounter_mem_235333.mem;
                                    unsigned int shared_offset_238338 = 0;
                                    unsigned int shared_offset_238340 = 0 +
                                                 (shared_sizze_238337 + (8 -
                                                                         shared_sizze_238337 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_238342 = 0 +
                                                 (shared_sizze_238337 + (8 -
                                                                         shared_sizze_238337 %
                                                                         8) %
                                                  8) + (shared_sizze_238339 +
                                                        (8 -
                                                         shared_sizze_238339 %
                                                         8) % 8);
                                    unsigned int shared_offset_238344 = 0 +
                                                 (shared_sizze_238337 + (8 -
                                                                         shared_sizze_238337 %
                                                                         8) %
                                                  8) + (shared_sizze_238339 +
                                                        (8 -
                                                         shared_sizze_238339 %
                                                         8) % 8) +
                                                 (shared_sizze_238341 + (8 -
                                                                         shared_sizze_238341 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_238346 = 0 +
                                                 (shared_sizze_238337 + (8 -
                                                                         shared_sizze_238337 %
                                                                         8) %
                                                  8) + (shared_sizze_238339 +
                                                        (8 -
                                                         shared_sizze_238339 %
                                                         8) % 8) +
                                                 (shared_sizze_238341 + (8 -
                                                                         shared_sizze_238341 %
                                                                         8) %
                                                  8) + (shared_sizze_238343 +
                                                        (8 -
                                                         shared_sizze_238343 %
                                                         8) % 8);
                                    unsigned int shared_offset_238348 = 0 +
                                                 (shared_sizze_238337 + (8 -
                                                                         shared_sizze_238337 %
                                                                         8) %
                                                  8) + (shared_sizze_238339 +
                                                        (8 -
                                                         shared_sizze_238339 %
                                                         8) % 8) +
                                                 (shared_sizze_238341 + (8 -
                                                                         shared_sizze_238341 %
                                                                         8) %
                                                  8) + (shared_sizze_238343 +
                                                        (8 -
                                                         shared_sizze_238343 %
                                                         8) % 8) +
                                                 (shared_sizze_238345 + (8 -
                                                                         shared_sizze_238345 %
                                                                         8) %
                                                  8);
                                    
                                    if ((((((1 && num_groups_221413 != 0) &&
                                            1 != 0) && 1 != 0) &&
                                          segred_group_sizze_221412 != 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_221413;
                                        grid[perm[1]] = 1;
                                        grid[perm[2]] = 1;
                                        
                                        void *kernel_args_238334[] =
                                             {&ctx->global_failure,
                                              &shared_offset_238338,
                                              &shared_offset_238340,
                                              &shared_offset_238342,
                                              &shared_offset_238344,
                                              &shared_offset_238346,
                                              &shared_offset_238348, &n_203490,
                                              &q_l_203495, &jump_t_203500,
                                              &partition_sizze_203577,
                                              &l_n_m_203643, &i_203670,
                                              &num_groups_221413,
                                              &ctx_param_ext_229488,
                                              &ctx_param_ext_229489,
                                              &ctx_param_ext_229491,
                                              &groups_per_segment_235318,
                                              &elements_per_thread_235319,
                                              &virt_num_groups_235320,
                                              &threads_per_segment_235322,
                                              &kernel_arg_238349,
                                              &kernel_arg_238350,
                                              &kernel_arg_238351,
                                              &kernel_arg_238352,
                                              &kernel_arg_238353,
                                              &kernel_arg_238354,
                                              &kernel_arg_238355,
                                              &kernel_arg_238356,
                                              &kernel_arg_238357,
                                              &kernel_arg_238358,
                                              &kernel_arg_238359,
                                              &kernel_arg_238360,
                                              &kernel_arg_238361,
                                              &kernel_arg_238362};
                                        int64_t time_start_238335 = 0,
                                                time_end_238336 = 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_221423",
                                                    (long) num_groups_221413,
                                                    (long) 1, (long) 1,
                                                    (long) segred_group_sizze_221412,
                                                    (long) 1, (long) 1,
                                                    (int) (0 +
                                                           (shared_sizze_238337 +
                                                            (8 -
                                                             shared_sizze_238337 %
                                                             8) % 8) +
                                                           (shared_sizze_238339 +
                                                            (8 -
                                                             shared_sizze_238339 %
                                                             8) % 8) +
                                                           (shared_sizze_238341 +
                                                            (8 -
                                                             shared_sizze_238341 %
                                                             8) % 8) +
                                                           (shared_sizze_238343 +
                                                            (8 -
                                                             shared_sizze_238343 %
                                                             8) % 8) +
                                                           (shared_sizze_238345 +
                                                            (8 -
                                                             shared_sizze_238345 %
                                                             8) % 8) +
                                                           (shared_sizze_238347 +
                                                            (8 -
                                                             shared_sizze_238347 %
                                                             8) % 8)));
                                            time_start_238335 = get_wall_time();
                                        }
                                        
                                        cudaEvent_t *pevents = NULL;
                                        
                                        if (ctx->profiling &&
                                            !ctx->profiling_paused) {
                                            pevents =
                                                cuda_get_events(&ctx->cuda,
                                                                &ctx->mainzisegred_large_221423_runs,
                                                                &ctx->mainzisegred_large_221423_total_runtime);
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                               0));
                                        }
                                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_large_221423,
                                                                              grid[0],
                                                                              grid[1],
                                                                              grid[2],
                                                                              segred_group_sizze_221412,
                                                                              1,
                                                                              1,
                                                                              0 +
                                                                              (shared_sizze_238337 +
                                                                               (8 -
                                                                                shared_sizze_238337 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238339 +
                                                                               (8 -
                                                                                shared_sizze_238339 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238341 +
                                                                               (8 -
                                                                                shared_sizze_238341 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238343 +
                                                                               (8 -
                                                                                shared_sizze_238343 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238345 +
                                                                               (8 -
                                                                                shared_sizze_238345 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238347 +
                                                                               (8 -
                                                                                shared_sizze_238347 %
                                                                                8) %
                                                                               8),
                                                                              NULL,
                                                                              kernel_args_238334,
                                                                              NULL));
                                        if (pevents != NULL)
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                               0));
                                        if (ctx->debugging) {
                                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                            time_end_238336 = get_wall_time();
                                            fprintf(ctx->log,
                                                    "Kernel %s runtime: %ldus\n",
                                                    "main.segred_large_221423",
                                                    time_end_238336 -
                                                    time_start_238335);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235331,
                                                              "segred_tmp_mem_235331") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235329,
                                                              "segred_tmp_mem_235329") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235327,
                                                              "segred_tmp_mem_235327") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235325,
                                                              "segred_tmp_mem_235325") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235323,
                                                              "segred_tmp_mem_235323") !=
                                        0)
                                        return 1;
                                }
                                
                                int64_t segmap_usable_groups_221471 =
                                        sdiv_up64(nest_sizze_209492,
                                                  segmap_group_sizze_221470);
                                struct memblock_device mem_230804;
                                
                                mem_230804.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230804,
                                                          bytes_229378,
                                                          "mem_230804")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230808;
                                
                                mem_230808.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230808,
                                                          bytes_229378,
                                                          "mem_230808")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230812;
                                
                                mem_230812.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230812,
                                                          bytes_229378,
                                                          "mem_230812")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230816;
                                
                                mem_230816.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230816,
                                                          bytes_229378,
                                                          "mem_230816")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230820;
                                
                                mem_230820.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230820,
                                                          bytes_229378,
                                                          "mem_230820")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                                
                                CUdeviceptr kernel_arg_238366 = mem_230783.mem;
                                CUdeviceptr kernel_arg_238367 = mem_230787.mem;
                                CUdeviceptr kernel_arg_238368 = mem_230791.mem;
                                CUdeviceptr kernel_arg_238369 = mem_230795.mem;
                                CUdeviceptr kernel_arg_238370 = mem_230799.mem;
                                CUdeviceptr kernel_arg_238371 = mem_230804.mem;
                                CUdeviceptr kernel_arg_238372 = mem_230808.mem;
                                CUdeviceptr kernel_arg_238373 = mem_230812.mem;
                                CUdeviceptr kernel_arg_238374 = mem_230816.mem;
                                CUdeviceptr kernel_arg_238375 = mem_230820.mem;
                                
                                if ((((((1 && segmap_usable_groups_221471 !=
                                         0) && 1 != 0) && 1 != 0) &&
                                      segmap_group_sizze_221470 != 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_221471;
                                    grid[perm[1]] = 1;
                                    grid[perm[2]] = 1;
                                    
                                    void *kernel_args_238363[] =
                                         {&ctx->global_failure,
                                          &partition_sizze_203577,
                                          &l_n_m_203643, &kernel_arg_238366,
                                          &kernel_arg_238367,
                                          &kernel_arg_238368,
                                          &kernel_arg_238369,
                                          &kernel_arg_238370,
                                          &kernel_arg_238371,
                                          &kernel_arg_238372,
                                          &kernel_arg_238373,
                                          &kernel_arg_238374,
                                          &kernel_arg_238375};
                                    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.segmap_221479",
                                                (long) segmap_usable_groups_221471,
                                                (long) 1, (long) 1,
                                                (long) segmap_group_sizze_221470,
                                                (long) 1, (long) 1, (int) 0);
                                        time_start_238364 = get_wall_time();
                                    }
                                    
                                    cudaEvent_t *pevents = NULL;
                                    
                                    if (ctx->profiling &&
                                        !ctx->profiling_paused) {
                                        pevents = cuda_get_events(&ctx->cuda,
                                                                  &ctx->mainzisegmap_221479_runs,
                                                                  &ctx->mainzisegmap_221479_total_runtime);
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                           0));
                                    }
                                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_221479,
                                                                          grid[0],
                                                                          grid[1],
                                                                          grid[2],
                                                                          segmap_group_sizze_221470,
                                                                          1, 1,
                                                                          0,
                                                                          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.segmap_221479",
                                                time_end_238365 -
                                                time_start_238364);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_unref_device(ctx, &mem_230783,
                                                          "mem_230783") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230787,
                                                          "mem_230787") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230791,
                                                          "mem_230791") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230795,
                                                          "mem_230795") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230799,
                                                          "mem_230799") != 0)
                                    return 1;
                                
                                struct memblock_device mem_230825;
                                
                                mem_230825.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230825,
                                                          bytes_229378,
                                                          "mem_230825")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230829;
                                
                                mem_230829.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230829,
                                                          bytes_229378,
                                                          "mem_230829")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (slt64(q_l_203495 * (int64_t) 2,
                                          segred_group_sizze_221513)) {
                                    int64_t segment_sizze_nonzzero_235403 =
                                            smax64((int64_t) 1, q_l_203495);
                                    int64_t num_threads_235404 =
                                            num_groups_221514 *
                                            segred_group_sizze_221513;
                                    
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n",
                                                "\n# SegRed-small");
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_segments",
                                                (long long) (partition_sizze_203577 *
                                                             l_n_m_203643),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_l_203495, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segments_per_group",
                                                (long long) squot64(segred_group_sizze_221513,
                                                                    segment_sizze_nonzzero_235403),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "required_groups",
                                                (long long) sext_i64_i32(sdiv_up64(partition_sizze_203577 *
                                                                                   l_n_m_203643,
                                                                                   squot64(segred_group_sizze_221513,
                                                                                           segment_sizze_nonzzero_235403))),
                                                '\n');
                                    
                                    unsigned int shared_sizze_238379 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_221513;
                                    unsigned int shared_sizze_238381 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_221513;
                                    CUdeviceptr kernel_arg_238383 =
                                                ext_mem_229411.mem;
                                    CUdeviceptr kernel_arg_238384 =
                                                ext_mem_229412.mem;
                                    CUdeviceptr kernel_arg_238385 =
                                                mem_param_229493.mem;
                                    CUdeviceptr kernel_arg_238386 =
                                                mem_230551.mem;
                                    CUdeviceptr kernel_arg_238387 =
                                                mem_230804.mem;
                                    CUdeviceptr kernel_arg_238388 =
                                                mem_230808.mem;
                                    CUdeviceptr kernel_arg_238389 =
                                                mem_230812.mem;
                                    CUdeviceptr kernel_arg_238390 =
                                                mem_230816.mem;
                                    CUdeviceptr kernel_arg_238391 =
                                                mem_230820.mem;
                                    CUdeviceptr kernel_arg_238392 =
                                                mem_230825.mem;
                                    CUdeviceptr kernel_arg_238393 =
                                                mem_230829.mem;
                                    unsigned int shared_offset_238380 = 0;
                                    unsigned int shared_offset_238382 = 0 +
                                                 (shared_sizze_238379 + (8 -
                                                                         shared_sizze_238379 %
                                                                         8) %
                                                  8);
                                    
                                    if ((((((1 && num_groups_221514 != 0) &&
                                            1 != 0) && 1 != 0) &&
                                          segred_group_sizze_221513 != 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_221514;
                                        grid[perm[1]] = 1;
                                        grid[perm[2]] = 1;
                                        
                                        void *kernel_args_238376[] =
                                             {&ctx->global_failure,
                                              &shared_offset_238380,
                                              &shared_offset_238382, &n_203490,
                                              &q_l_203495, &jump_t_203500,
                                              &partition_sizze_203577,
                                              &l_n_m_203643, &i_203670,
                                              &num_groups_221514,
                                              &ctx_param_ext_229488,
                                              &ctx_param_ext_229489,
                                              &ctx_param_ext_229491,
                                              &segment_sizze_nonzzero_235403,
                                              &kernel_arg_238383,
                                              &kernel_arg_238384,
                                              &kernel_arg_238385,
                                              &kernel_arg_238386,
                                              &kernel_arg_238387,
                                              &kernel_arg_238388,
                                              &kernel_arg_238389,
                                              &kernel_arg_238390,
                                              &kernel_arg_238391,
                                              &kernel_arg_238392,
                                              &kernel_arg_238393};
                                        int64_t time_start_238377 = 0,
                                                time_end_238378 = 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_221521",
                                                    (long) num_groups_221514,
                                                    (long) 1, (long) 1,
                                                    (long) segred_group_sizze_221513,
                                                    (long) 1, (long) 1,
                                                    (int) (0 +
                                                           (shared_sizze_238379 +
                                                            (8 -
                                                             shared_sizze_238379 %
                                                             8) % 8) +
                                                           (shared_sizze_238381 +
                                                            (8 -
                                                             shared_sizze_238381 %
                                                             8) % 8)));
                                            time_start_238377 = get_wall_time();
                                        }
                                        
                                        cudaEvent_t *pevents = NULL;
                                        
                                        if (ctx->profiling &&
                                            !ctx->profiling_paused) {
                                            pevents =
                                                cuda_get_events(&ctx->cuda,
                                                                &ctx->mainzisegred_small_221521_runs,
                                                                &ctx->mainzisegred_small_221521_total_runtime);
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                               0));
                                        }
                                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_small_221521,
                                                                              grid[0],
                                                                              grid[1],
                                                                              grid[2],
                                                                              segred_group_sizze_221513,
                                                                              1,
                                                                              1,
                                                                              0 +
                                                                              (shared_sizze_238379 +
                                                                               (8 -
                                                                                shared_sizze_238379 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238381 +
                                                                               (8 -
                                                                                shared_sizze_238381 %
                                                                                8) %
                                                                               8),
                                                                              NULL,
                                                                              kernel_args_238376,
                                                                              NULL));
                                        if (pevents != NULL)
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                               0));
                                        if (ctx->debugging) {
                                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                            time_end_238378 = get_wall_time();
                                            fprintf(ctx->log,
                                                    "Kernel %s runtime: %ldus\n",
                                                    "main.segred_small_221521",
                                                    time_end_238378 -
                                                    time_start_238377);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                } else {
                                    int64_t groups_per_segment_235438 =
                                            sdiv_up64(num_groups_221514,
                                                      smax64((int64_t) 1,
                                                             partition_sizze_203577 *
                                                             l_n_m_203643));
                                    int64_t elements_per_thread_235439 =
                                            sdiv_up64(q_l_203495,
                                                      segred_group_sizze_221513 *
                                                      groups_per_segment_235438);
                                    int64_t virt_num_groups_235440 =
                                            groups_per_segment_235438 *
                                            (partition_sizze_203577 *
                                             l_n_m_203643);
                                    int64_t num_threads_235441 =
                                            num_groups_221514 *
                                            segred_group_sizze_221513;
                                    int64_t threads_per_segment_235442 =
                                            groups_per_segment_235438 *
                                            segred_group_sizze_221513;
                                    
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n",
                                                "\n# SegRed-large");
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_segments",
                                                (long long) (partition_sizze_203577 *
                                                             l_n_m_203643),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_l_203495, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "virt_num_groups",
                                                (long long) virt_num_groups_235440,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_groups",
                                                (long long) num_groups_221514,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "group_size",
                                                (long long) segred_group_sizze_221513,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "elems_per_thread",
                                                (long long) elements_per_thread_235439,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "groups_per_segment",
                                                (long long) groups_per_segment_235438,
                                                '\n');
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235443;
                                    
                                    segred_tmp_mem_235443.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235443,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235440,
                                                              "segred_tmp_mem_235443")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235445;
                                    
                                    segred_tmp_mem_235445.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235445,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235440,
                                                              "segred_tmp_mem_235445")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    mainzicounter_mem_235447 =
                                    ctx->mainzicounter_mem_235447;
                                    unsigned int shared_sizze_238398 = 1;
                                    unsigned int shared_sizze_238400 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_221513;
                                    unsigned int shared_sizze_238402 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_221513;
                                    CUdeviceptr kernel_arg_238404 =
                                                ext_mem_229411.mem;
                                    CUdeviceptr kernel_arg_238405 =
                                                ext_mem_229412.mem;
                                    CUdeviceptr kernel_arg_238406 =
                                                mem_param_229493.mem;
                                    CUdeviceptr kernel_arg_238407 =
                                                mem_230551.mem;
                                    CUdeviceptr kernel_arg_238408 =
                                                mem_230804.mem;
                                    CUdeviceptr kernel_arg_238409 =
                                                mem_230808.mem;
                                    CUdeviceptr kernel_arg_238410 =
                                                mem_230812.mem;
                                    CUdeviceptr kernel_arg_238411 =
                                                mem_230816.mem;
                                    CUdeviceptr kernel_arg_238412 =
                                                mem_230820.mem;
                                    CUdeviceptr kernel_arg_238413 =
                                                mem_230825.mem;
                                    CUdeviceptr kernel_arg_238414 =
                                                mem_230829.mem;
                                    CUdeviceptr kernel_arg_238415 =
                                                segred_tmp_mem_235443.mem;
                                    CUdeviceptr kernel_arg_238416 =
                                                segred_tmp_mem_235445.mem;
                                    CUdeviceptr kernel_arg_238417 =
                                                mainzicounter_mem_235447.mem;
                                    unsigned int shared_offset_238399 = 0;
                                    unsigned int shared_offset_238401 = 0 +
                                                 (shared_sizze_238398 + (8 -
                                                                         shared_sizze_238398 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_238403 = 0 +
                                                 (shared_sizze_238398 + (8 -
                                                                         shared_sizze_238398 %
                                                                         8) %
                                                  8) + (shared_sizze_238400 +
                                                        (8 -
                                                         shared_sizze_238400 %
                                                         8) % 8);
                                    
                                    if ((((((1 && num_groups_221514 != 0) &&
                                            1 != 0) && 1 != 0) &&
                                          segred_group_sizze_221513 != 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_221514;
                                        grid[perm[1]] = 1;
                                        grid[perm[2]] = 1;
                                        
                                        void *kernel_args_238395[] =
                                             {&ctx->global_failure,
                                              &shared_offset_238399,
                                              &shared_offset_238401,
                                              &shared_offset_238403, &n_203490,
                                              &q_l_203495, &jump_t_203500,
                                              &partition_sizze_203577,
                                              &l_n_m_203643, &i_203670,
                                              &num_groups_221514,
                                              &ctx_param_ext_229488,
                                              &ctx_param_ext_229489,
                                              &ctx_param_ext_229491,
                                              &groups_per_segment_235438,
                                              &elements_per_thread_235439,
                                              &virt_num_groups_235440,
                                              &threads_per_segment_235442,
                                              &kernel_arg_238404,
                                              &kernel_arg_238405,
                                              &kernel_arg_238406,
                                              &kernel_arg_238407,
                                              &kernel_arg_238408,
                                              &kernel_arg_238409,
                                              &kernel_arg_238410,
                                              &kernel_arg_238411,
                                              &kernel_arg_238412,
                                              &kernel_arg_238413,
                                              &kernel_arg_238414,
                                              &kernel_arg_238415,
                                              &kernel_arg_238416,
                                              &kernel_arg_238417};
                                        int64_t time_start_238396 = 0,
                                                time_end_238397 = 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_221521",
                                                    (long) num_groups_221514,
                                                    (long) 1, (long) 1,
                                                    (long) segred_group_sizze_221513,
                                                    (long) 1, (long) 1,
                                                    (int) (0 +
                                                           (shared_sizze_238398 +
                                                            (8 -
                                                             shared_sizze_238398 %
                                                             8) % 8) +
                                                           (shared_sizze_238400 +
                                                            (8 -
                                                             shared_sizze_238400 %
                                                             8) % 8) +
                                                           (shared_sizze_238402 +
                                                            (8 -
                                                             shared_sizze_238402 %
                                                             8) % 8)));
                                            time_start_238396 = get_wall_time();
                                        }
                                        
                                        cudaEvent_t *pevents = NULL;
                                        
                                        if (ctx->profiling &&
                                            !ctx->profiling_paused) {
                                            pevents =
                                                cuda_get_events(&ctx->cuda,
                                                                &ctx->mainzisegred_large_221521_runs,
                                                                &ctx->mainzisegred_large_221521_total_runtime);
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                               0));
                                        }
                                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_large_221521,
                                                                              grid[0],
                                                                              grid[1],
                                                                              grid[2],
                                                                              segred_group_sizze_221513,
                                                                              1,
                                                                              1,
                                                                              0 +
                                                                              (shared_sizze_238398 +
                                                                               (8 -
                                                                                shared_sizze_238398 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238400 +
                                                                               (8 -
                                                                                shared_sizze_238400 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238402 +
                                                                               (8 -
                                                                                shared_sizze_238402 %
                                                                                8) %
                                                                               8),
                                                                              NULL,
                                                                              kernel_args_238395,
                                                                              NULL));
                                        if (pevents != NULL)
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                               0));
                                        if (ctx->debugging) {
                                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                            time_end_238397 = get_wall_time();
                                            fprintf(ctx->log,
                                                    "Kernel %s runtime: %ldus\n",
                                                    "main.segred_large_221521",
                                                    time_end_238397 -
                                                    time_start_238396);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235445,
                                                              "segred_tmp_mem_235445") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235443,
                                                              "segred_tmp_mem_235443") !=
                                        0)
                                        return 1;
                                }
                                if (memblock_unref_device(ctx, &mem_230804,
                                                          "mem_230804") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230808,
                                                          "mem_230808") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230812,
                                                          "mem_230812") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230816,
                                                          "mem_230816") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230820,
                                                          "mem_230820") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_230831,
                                                        &mem_230825,
                                                        "mem_230825") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_230830,
                                                        &mem_230829,
                                                        "mem_230829") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230829,
                                                          "mem_230829") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230825,
                                                          "mem_230825") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230820,
                                                          "mem_230820") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230816,
                                                          "mem_230816") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230812,
                                                          "mem_230812") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230808,
                                                          "mem_230808") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230804,
                                                          "mem_230804") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230799,
                                                          "mem_230799") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230795,
                                                          "mem_230795") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230791,
                                                          "mem_230791") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230787,
                                                          "mem_230787") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230783,
                                                          "mem_230783") != 0)
                                    return 1;
                            }
                            if (memblock_set_device(ctx, &ext_mem_230843,
                                                    &ext_mem_230831,
                                                    "ext_mem_230831") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_230842,
                                                    &ext_mem_230830,
                                                    "ext_mem_230830") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230830,
                                                      "ext_mem_230830") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230831,
                                                      "ext_mem_230831") != 0)
                                return 1;
                        }
                        if (memblock_set_device(ctx, &ext_mem_230845,
                                                &ext_mem_230843,
                                                "ext_mem_230843") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_230844,
                                                &ext_mem_230842,
                                                "ext_mem_230842") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230842,
                                                  "ext_mem_230842") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230843,
                                                  "ext_mem_230843") != 0)
                            return 1;
                    }
                    if (memblock_set_device(ctx, &ext_mem_230847,
                                            &ext_mem_230845,
                                            "ext_mem_230845") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_230846,
                                            &ext_mem_230844,
                                            "ext_mem_230844") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230844,
                                              "ext_mem_230844") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230845,
                                              "ext_mem_230845") != 0)
                        return 1;
                }
                if (memblock_set_device(ctx, &ext_mem_230908, &ext_mem_230847,
                                        "ext_mem_230847") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_230907, &ext_mem_230846,
                                        "ext_mem_230846") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_230846,
                                          "ext_mem_230846") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_230847,
                                          "ext_mem_230847") != 0)
                    return 1;
            } else {
                bool match_lit_205484 = (int64_t) 0 == d_l_203498;
                int64_t binop_y_230854 = (int64_t) 8 * q_l_203495;
                int64_t bytes_230855 = smax64((int64_t) 0, binop_y_230854);
                struct memblock_device ext_mem_230906;
                
                ext_mem_230906.references = NULL;
                
                struct memblock_device ext_mem_230905;
                
                ext_mem_230905.references = NULL;
                if (match_lit_205484) {
                    struct memblock_device mem_230851;
                    
                    mem_230851.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_230851, bytes_229378,
                                              "mem_230851")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (futrts_builtinzhreplicate_f64(ctx, mem_230851,
                                                      partition_sizze_203577 *
                                                      l_n_m_203643, 0.0) != 0) {
                        if (memblock_unref_device(ctx, &mem_230851,
                                                  "mem_230851") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230905,
                                                  "ext_mem_230905") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230906,
                                                  "ext_mem_230906") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230907,
                                                  "ext_mem_230907") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230908,
                                                  "ext_mem_230908") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230546,
                                                  "ext_mem_230546") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230529,
                                                  "ext_mem_230529") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230512,
                                                  "ext_mem_230512") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230494,
                                                  "ext_mem_230494") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230486,
                                                  "ext_mem_230486") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230487,
                                                  "ext_mem_230487") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229515,
                                                  "mem_param_229515") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229507,
                                                  "mem_param_229507") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231517,
                                                  "ext_mem_231517") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231518,
                                                  "ext_mem_231518") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229493,
                                                  "mem_param_229493") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229485,
                                                  "mem_param_229485") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229477,
                                                  "mem_param_229477") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231860,
                                                  "ext_mem_231860") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231861,
                                                  "ext_mem_231861") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231862,
                                                  "ext_mem_231862") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230551,
                                                  "mem_230551") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230534,
                                                  "mem_230534") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230517,
                                                  "mem_230517") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230500,
                                                  "mem_230500") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229531,
                                                  "mem_229531") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229526,
                                                  "mem_229526") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229520,
                                                  "mem_229520") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229469,
                                                  "mem_229469") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229465,
                                                  "mem_229465") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229460,
                                                  "ext_mem_229460") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229461,
                                                  "ext_mem_229461") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229411,
                                                  "ext_mem_229411") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229412,
                                                  "ext_mem_229412") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229362,
                                                  "ext_mem_229362") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229363,
                                                  "ext_mem_229363") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229264,
                                                  "ext_mem_229264") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229265,
                                                  "ext_mem_229265") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229206,
                                                  "mem_229206") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229200,
                                                  "mem_229200") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229196,
                                                  "ext_mem_229196") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229197,
                                                  "ext_mem_229197") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229164,
                                                  "mem_229164") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229161,
                                                  "mem_229161") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229157,
                                                  "mem_229157") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229155,
                                                  "mem_229155") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229152,
                                                  "mem_229152") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229148,
                                                  "mem_229148") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232249,
                                                  "mem_out_232249") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232248,
                                                  "mem_out_232248") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232247,
                                                  "mem_out_232247") != 0)
                            return 1;
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mem_230861;
                    
                    mem_230861.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_230861, bytes_229378,
                                              "mem_230861")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                    
                    unsigned int shared_sizze_238421 = (int64_t) 8 * q_l_203495;
                    unsigned int shared_sizze_238423 = (int64_t) 8 * q_l_203495;
                    unsigned int shared_sizze_238425 = bytes_230855;
                    CUdeviceptr kernel_arg_238427 = ext_mem_229411.mem;
                    CUdeviceptr kernel_arg_238428 = ext_mem_229412.mem;
                    CUdeviceptr kernel_arg_238429 = mem_param_229493.mem;
                    CUdeviceptr kernel_arg_238430 = mem_230551.mem;
                    CUdeviceptr kernel_arg_238431 = mem_230861.mem;
                    unsigned int shared_offset_238422 = 0;
                    unsigned int shared_offset_238424 = 0 +
                                 (shared_sizze_238421 + (8 -
                                                         shared_sizze_238421 %
                                                         8) % 8);
                    unsigned int shared_offset_238426 = 0 +
                                 (shared_sizze_238421 + (8 -
                                                         shared_sizze_238421 %
                                                         8) % 8) +
                                 (shared_sizze_238423 + (8 -
                                                         shared_sizze_238423 %
                                                         8) % 8);
                    
                    if ((((((1 && nest_sizze_209492 != 0) && 1 != 0) && 1 !=
                           0) && q_l_203495 != 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_209492;
                        grid[perm[1]] = 1;
                        grid[perm[2]] = 1;
                        
                        void *kernel_args_238418[] = {&ctx->global_failure,
                                                      &shared_offset_238422,
                                                      &shared_offset_238424,
                                                      &shared_offset_238426,
                                                      &n_203490, &q_l_203495,
                                                      &jump_t_203500,
                                                      &partition_sizze_203577,
                                                      &l_n_m_203643, &i_203670,
                                                      &ctx_param_ext_229488,
                                                      &ctx_param_ext_229489,
                                                      &ctx_param_ext_229491,
                                                      &kernel_arg_238427,
                                                      &kernel_arg_238428,
                                                      &kernel_arg_238429,
                                                      &kernel_arg_238430,
                                                      &kernel_arg_238431};
                        int64_t time_start_238419 = 0, time_end_238420 = 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_221669",
                                    (long) nest_sizze_209492, (long) 1,
                                    (long) 1, (long) q_l_203495, (long) 1,
                                    (long) 1, (int) (0 + (shared_sizze_238421 +
                                                          (8 -
                                                           shared_sizze_238421 %
                                                           8) % 8) +
                                                     (shared_sizze_238423 + (8 -
                                                                             shared_sizze_238423 %
                                                                             8) %
                                                      8) +
                                                     (shared_sizze_238425 + (8 -
                                                                             shared_sizze_238425 %
                                                                             8) %
                                                      8)));
                            time_start_238419 = get_wall_time();
                        }
                        
                        cudaEvent_t *pevents = NULL;
                        
                        if (ctx->profiling && !ctx->profiling_paused) {
                            pevents = cuda_get_events(&ctx->cuda,
                                                      &ctx->mainzisegmap_intragroup_221669_runs,
                                                      &ctx->mainzisegmap_intragroup_221669_total_runtime);
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                        }
                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_intragroup_221669,
                                                              grid[0], grid[1],
                                                              grid[2],
                                                              q_l_203495, 1, 1,
                                                              0 +
                                                              (shared_sizze_238421 +
                                                               (8 -
                                                                shared_sizze_238421 %
                                                                8) % 8) +
                                                              (shared_sizze_238423 +
                                                               (8 -
                                                                shared_sizze_238423 %
                                                                8) % 8) +
                                                              (shared_sizze_238425 +
                                                               (8 -
                                                                shared_sizze_238425 %
                                                                8) % 8), NULL,
                                                              kernel_args_238418,
                                                              NULL));
                        if (pevents != NULL)
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                        if (ctx->debugging) {
                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                            time_end_238420 = get_wall_time();
                            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                    "main.segmap_intragroup_221669",
                                    time_end_238420 - time_start_238419);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    if (memblock_set_device(ctx, &ext_mem_230906, &mem_230861,
                                            "mem_230861") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_230905, &mem_230851,
                                            "mem_230851") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230861, "mem_230861") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230851, "mem_230851") !=
                        0)
                        return 1;
                } else {
                    bool match_lit_205539 = (int64_t) 1 == d_l_203498;
                    struct memblock_device ext_mem_230904;
                    
                    ext_mem_230904.references = NULL;
                    
                    struct memblock_device ext_mem_230903;
                    
                    ext_mem_230903.references = NULL;
                    if (match_lit_205539) {
                        struct memblock_device mem_230874;
                        
                        mem_230874.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230874,
                                                  bytes_229378, "mem_230874")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_230878;
                        
                        mem_230878.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230878,
                                                  bytes_229378, "mem_230878")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        
                        unsigned int shared_sizze_238435 = (int64_t) 8 *
                                     q_l_203495;
                        unsigned int shared_sizze_238437 = (int64_t) 8 *
                                     q_l_203495;
                        unsigned int shared_sizze_238439 = (int64_t) 8 *
                                     q_l_203495;
                        unsigned int shared_sizze_238441 = (int64_t) 8 *
                                     q_l_203495;
                        unsigned int shared_sizze_238443 = (int64_t) 8 *
                                     q_l_203495;
                        unsigned int shared_sizze_238445 = bytes_230855;
                        unsigned int shared_sizze_238447 = bytes_230855;
                        CUdeviceptr kernel_arg_238449 = ext_mem_229411.mem;
                        CUdeviceptr kernel_arg_238450 = ext_mem_229412.mem;
                        CUdeviceptr kernel_arg_238451 = mem_param_229493.mem;
                        CUdeviceptr kernel_arg_238452 = mem_230551.mem;
                        CUdeviceptr kernel_arg_238453 = mem_230874.mem;
                        CUdeviceptr kernel_arg_238454 = mem_230878.mem;
                        unsigned int shared_offset_238436 = 0;
                        unsigned int shared_offset_238438 = 0 +
                                     (shared_sizze_238435 + (8 -
                                                             shared_sizze_238435 %
                                                             8) % 8);
                        unsigned int shared_offset_238440 = 0 +
                                     (shared_sizze_238435 + (8 -
                                                             shared_sizze_238435 %
                                                             8) % 8) +
                                     (shared_sizze_238437 + (8 -
                                                             shared_sizze_238437 %
                                                             8) % 8);
                        unsigned int shared_offset_238442 = 0 +
                                     (shared_sizze_238435 + (8 -
                                                             shared_sizze_238435 %
                                                             8) % 8) +
                                     (shared_sizze_238437 + (8 -
                                                             shared_sizze_238437 %
                                                             8) % 8) +
                                     (shared_sizze_238439 + (8 -
                                                             shared_sizze_238439 %
                                                             8) % 8);
                        unsigned int shared_offset_238444 = 0 +
                                     (shared_sizze_238435 + (8 -
                                                             shared_sizze_238435 %
                                                             8) % 8) +
                                     (shared_sizze_238437 + (8 -
                                                             shared_sizze_238437 %
                                                             8) % 8) +
                                     (shared_sizze_238439 + (8 -
                                                             shared_sizze_238439 %
                                                             8) % 8) +
                                     (shared_sizze_238441 + (8 -
                                                             shared_sizze_238441 %
                                                             8) % 8);
                        unsigned int shared_offset_238446 = 0 +
                                     (shared_sizze_238435 + (8 -
                                                             shared_sizze_238435 %
                                                             8) % 8) +
                                     (shared_sizze_238437 + (8 -
                                                             shared_sizze_238437 %
                                                             8) % 8) +
                                     (shared_sizze_238439 + (8 -
                                                             shared_sizze_238439 %
                                                             8) % 8) +
                                     (shared_sizze_238441 + (8 -
                                                             shared_sizze_238441 %
                                                             8) % 8) +
                                     (shared_sizze_238443 + (8 -
                                                             shared_sizze_238443 %
                                                             8) % 8);
                        unsigned int shared_offset_238448 = 0 +
                                     (shared_sizze_238435 + (8 -
                                                             shared_sizze_238435 %
                                                             8) % 8) +
                                     (shared_sizze_238437 + (8 -
                                                             shared_sizze_238437 %
                                                             8) % 8) +
                                     (shared_sizze_238439 + (8 -
                                                             shared_sizze_238439 %
                                                             8) % 8) +
                                     (shared_sizze_238441 + (8 -
                                                             shared_sizze_238441 %
                                                             8) % 8) +
                                     (shared_sizze_238443 + (8 -
                                                             shared_sizze_238443 %
                                                             8) % 8) +
                                     (shared_sizze_238445 + (8 -
                                                             shared_sizze_238445 %
                                                             8) % 8);
                        
                        if ((((((1 && nest_sizze_209492 != 0) && 1 != 0) && 1 !=
                               0) && q_l_203495 != 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_209492;
                            grid[perm[1]] = 1;
                            grid[perm[2]] = 1;
                            
                            void *kernel_args_238432[] = {&ctx->global_failure,
                                                          &shared_offset_238436,
                                                          &shared_offset_238438,
                                                          &shared_offset_238440,
                                                          &shared_offset_238442,
                                                          &shared_offset_238444,
                                                          &shared_offset_238446,
                                                          &shared_offset_238448,
                                                          &n_203490,
                                                          &q_l_203495,
                                                          &jump_t_203500,
                                                          &partition_sizze_203577,
                                                          &l_n_m_203643,
                                                          &i_203670,
                                                          &ctx_param_ext_229488,
                                                          &ctx_param_ext_229489,
                                                          &ctx_param_ext_229491,
                                                          &kernel_arg_238449,
                                                          &kernel_arg_238450,
                                                          &kernel_arg_238451,
                                                          &kernel_arg_238452,
                                                          &kernel_arg_238453,
                                                          &kernel_arg_238454};
                            int64_t time_start_238433 = 0, time_end_238434 = 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_221836",
                                        (long) nest_sizze_209492, (long) 1,
                                        (long) 1, (long) q_l_203495, (long) 1,
                                        (long) 1, (int) (0 +
                                                         (shared_sizze_238435 +
                                                          (8 -
                                                           shared_sizze_238435 %
                                                           8) % 8) +
                                                         (shared_sizze_238437 +
                                                          (8 -
                                                           shared_sizze_238437 %
                                                           8) % 8) +
                                                         (shared_sizze_238439 +
                                                          (8 -
                                                           shared_sizze_238439 %
                                                           8) % 8) +
                                                         (shared_sizze_238441 +
                                                          (8 -
                                                           shared_sizze_238441 %
                                                           8) % 8) +
                                                         (shared_sizze_238443 +
                                                          (8 -
                                                           shared_sizze_238443 %
                                                           8) % 8) +
                                                         (shared_sizze_238445 +
                                                          (8 -
                                                           shared_sizze_238445 %
                                                           8) % 8) +
                                                         (shared_sizze_238447 +
                                                          (8 -
                                                           shared_sizze_238447 %
                                                           8) % 8)));
                                time_start_238433 = get_wall_time();
                            }
                            
                            cudaEvent_t *pevents = NULL;
                            
                            if (ctx->profiling && !ctx->profiling_paused) {
                                pevents = cuda_get_events(&ctx->cuda,
                                                          &ctx->mainzisegmap_intragroup_221836_runs,
                                                          &ctx->mainzisegmap_intragroup_221836_total_runtime);
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                   0));
                            }
                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_intragroup_221836,
                                                                  grid[0],
                                                                  grid[1],
                                                                  grid[2],
                                                                  q_l_203495, 1,
                                                                  1, 0 +
                                                                  (shared_sizze_238435 +
                                                                   (8 -
                                                                    shared_sizze_238435 %
                                                                    8) % 8) +
                                                                  (shared_sizze_238437 +
                                                                   (8 -
                                                                    shared_sizze_238437 %
                                                                    8) % 8) +
                                                                  (shared_sizze_238439 +
                                                                   (8 -
                                                                    shared_sizze_238439 %
                                                                    8) % 8) +
                                                                  (shared_sizze_238441 +
                                                                   (8 -
                                                                    shared_sizze_238441 %
                                                                    8) % 8) +
                                                                  (shared_sizze_238443 +
                                                                   (8 -
                                                                    shared_sizze_238443 %
                                                                    8) % 8) +
                                                                  (shared_sizze_238445 +
                                                                   (8 -
                                                                    shared_sizze_238445 %
                                                                    8) % 8) +
                                                                  (shared_sizze_238447 +
                                                                   (8 -
                                                                    shared_sizze_238447 %
                                                                    8) % 8),
                                                                  NULL,
                                                                  kernel_args_238432,
                                                                  NULL));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                            if (ctx->debugging) {
                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                time_end_238434 = get_wall_time();
                                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                        "main.segmap_intragroup_221836",
                                        time_end_238434 - time_start_238433);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_set_device(ctx, &ext_mem_230904,
                                                &mem_230874, "mem_230874") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_230903,
                                                &mem_230878, "mem_230878") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230878,
                                                  "mem_230878") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230874,
                                                  "mem_230874") != 0)
                            return 1;
                    } else {
                        struct memblock_device mem_230898;
                        
                        mem_230898.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230898,
                                                  bytes_229378, "mem_230898")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_230902;
                        
                        mem_230902.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230902,
                                                  bytes_229378, "mem_230902")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        
                        unsigned int shared_sizze_238458 = (int64_t) 8 *
                                     q_l_203495;
                        unsigned int shared_sizze_238460 = (int64_t) 8 *
                                     q_l_203495;
                        unsigned int shared_sizze_238462 = (int64_t) 8 *
                                     q_l_203495;
                        unsigned int shared_sizze_238464 = (int64_t) 8 *
                                     q_l_203495;
                        unsigned int shared_sizze_238466 = (int64_t) 8 *
                                     q_l_203495;
                        unsigned int shared_sizze_238468 = (int64_t) 8 *
                                     q_l_203495;
                        unsigned int shared_sizze_238470 = (int64_t) 8 *
                                     q_l_203495;
                        unsigned int shared_sizze_238472 = bytes_230855;
                        unsigned int shared_sizze_238474 = bytes_230855;
                        unsigned int shared_sizze_238476 = bytes_230855;
                        unsigned int shared_sizze_238478 = bytes_230855;
                        CUdeviceptr kernel_arg_238480 = ext_mem_229411.mem;
                        CUdeviceptr kernel_arg_238481 = ext_mem_229412.mem;
                        CUdeviceptr kernel_arg_238482 = mem_param_229493.mem;
                        CUdeviceptr kernel_arg_238483 = mem_230551.mem;
                        CUdeviceptr kernel_arg_238484 = mem_230898.mem;
                        CUdeviceptr kernel_arg_238485 = mem_230902.mem;
                        unsigned int shared_offset_238459 = 0;
                        unsigned int shared_offset_238461 = 0 +
                                     (shared_sizze_238458 + (8 -
                                                             shared_sizze_238458 %
                                                             8) % 8);
                        unsigned int shared_offset_238463 = 0 +
                                     (shared_sizze_238458 + (8 -
                                                             shared_sizze_238458 %
                                                             8) % 8) +
                                     (shared_sizze_238460 + (8 -
                                                             shared_sizze_238460 %
                                                             8) % 8);
                        unsigned int shared_offset_238465 = 0 +
                                     (shared_sizze_238458 + (8 -
                                                             shared_sizze_238458 %
                                                             8) % 8) +
                                     (shared_sizze_238460 + (8 -
                                                             shared_sizze_238460 %
                                                             8) % 8) +
                                     (shared_sizze_238462 + (8 -
                                                             shared_sizze_238462 %
                                                             8) % 8);
                        unsigned int shared_offset_238467 = 0 +
                                     (shared_sizze_238458 + (8 -
                                                             shared_sizze_238458 %
                                                             8) % 8) +
                                     (shared_sizze_238460 + (8 -
                                                             shared_sizze_238460 %
                                                             8) % 8) +
                                     (shared_sizze_238462 + (8 -
                                                             shared_sizze_238462 %
                                                             8) % 8) +
                                     (shared_sizze_238464 + (8 -
                                                             shared_sizze_238464 %
                                                             8) % 8);
                        unsigned int shared_offset_238469 = 0 +
                                     (shared_sizze_238458 + (8 -
                                                             shared_sizze_238458 %
                                                             8) % 8) +
                                     (shared_sizze_238460 + (8 -
                                                             shared_sizze_238460 %
                                                             8) % 8) +
                                     (shared_sizze_238462 + (8 -
                                                             shared_sizze_238462 %
                                                             8) % 8) +
                                     (shared_sizze_238464 + (8 -
                                                             shared_sizze_238464 %
                                                             8) % 8) +
                                     (shared_sizze_238466 + (8 -
                                                             shared_sizze_238466 %
                                                             8) % 8);
                        unsigned int shared_offset_238471 = 0 +
                                     (shared_sizze_238458 + (8 -
                                                             shared_sizze_238458 %
                                                             8) % 8) +
                                     (shared_sizze_238460 + (8 -
                                                             shared_sizze_238460 %
                                                             8) % 8) +
                                     (shared_sizze_238462 + (8 -
                                                             shared_sizze_238462 %
                                                             8) % 8) +
                                     (shared_sizze_238464 + (8 -
                                                             shared_sizze_238464 %
                                                             8) % 8) +
                                     (shared_sizze_238466 + (8 -
                                                             shared_sizze_238466 %
                                                             8) % 8) +
                                     (shared_sizze_238468 + (8 -
                                                             shared_sizze_238468 %
                                                             8) % 8);
                        unsigned int shared_offset_238473 = 0 +
                                     (shared_sizze_238458 + (8 -
                                                             shared_sizze_238458 %
                                                             8) % 8) +
                                     (shared_sizze_238460 + (8 -
                                                             shared_sizze_238460 %
                                                             8) % 8) +
                                     (shared_sizze_238462 + (8 -
                                                             shared_sizze_238462 %
                                                             8) % 8) +
                                     (shared_sizze_238464 + (8 -
                                                             shared_sizze_238464 %
                                                             8) % 8) +
                                     (shared_sizze_238466 + (8 -
                                                             shared_sizze_238466 %
                                                             8) % 8) +
                                     (shared_sizze_238468 + (8 -
                                                             shared_sizze_238468 %
                                                             8) % 8) +
                                     (shared_sizze_238470 + (8 -
                                                             shared_sizze_238470 %
                                                             8) % 8);
                        unsigned int shared_offset_238475 = 0 +
                                     (shared_sizze_238458 + (8 -
                                                             shared_sizze_238458 %
                                                             8) % 8) +
                                     (shared_sizze_238460 + (8 -
                                                             shared_sizze_238460 %
                                                             8) % 8) +
                                     (shared_sizze_238462 + (8 -
                                                             shared_sizze_238462 %
                                                             8) % 8) +
                                     (shared_sizze_238464 + (8 -
                                                             shared_sizze_238464 %
                                                             8) % 8) +
                                     (shared_sizze_238466 + (8 -
                                                             shared_sizze_238466 %
                                                             8) % 8) +
                                     (shared_sizze_238468 + (8 -
                                                             shared_sizze_238468 %
                                                             8) % 8) +
                                     (shared_sizze_238470 + (8 -
                                                             shared_sizze_238470 %
                                                             8) % 8) +
                                     (shared_sizze_238472 + (8 -
                                                             shared_sizze_238472 %
                                                             8) % 8);
                        unsigned int shared_offset_238477 = 0 +
                                     (shared_sizze_238458 + (8 -
                                                             shared_sizze_238458 %
                                                             8) % 8) +
                                     (shared_sizze_238460 + (8 -
                                                             shared_sizze_238460 %
                                                             8) % 8) +
                                     (shared_sizze_238462 + (8 -
                                                             shared_sizze_238462 %
                                                             8) % 8) +
                                     (shared_sizze_238464 + (8 -
                                                             shared_sizze_238464 %
                                                             8) % 8) +
                                     (shared_sizze_238466 + (8 -
                                                             shared_sizze_238466 %
                                                             8) % 8) +
                                     (shared_sizze_238468 + (8 -
                                                             shared_sizze_238468 %
                                                             8) % 8) +
                                     (shared_sizze_238470 + (8 -
                                                             shared_sizze_238470 %
                                                             8) % 8) +
                                     (shared_sizze_238472 + (8 -
                                                             shared_sizze_238472 %
                                                             8) % 8) +
                                     (shared_sizze_238474 + (8 -
                                                             shared_sizze_238474 %
                                                             8) % 8);
                        unsigned int shared_offset_238479 = 0 +
                                     (shared_sizze_238458 + (8 -
                                                             shared_sizze_238458 %
                                                             8) % 8) +
                                     (shared_sizze_238460 + (8 -
                                                             shared_sizze_238460 %
                                                             8) % 8) +
                                     (shared_sizze_238462 + (8 -
                                                             shared_sizze_238462 %
                                                             8) % 8) +
                                     (shared_sizze_238464 + (8 -
                                                             shared_sizze_238464 %
                                                             8) % 8) +
                                     (shared_sizze_238466 + (8 -
                                                             shared_sizze_238466 %
                                                             8) % 8) +
                                     (shared_sizze_238468 + (8 -
                                                             shared_sizze_238468 %
                                                             8) % 8) +
                                     (shared_sizze_238470 + (8 -
                                                             shared_sizze_238470 %
                                                             8) % 8) +
                                     (shared_sizze_238472 + (8 -
                                                             shared_sizze_238472 %
                                                             8) % 8) +
                                     (shared_sizze_238474 + (8 -
                                                             shared_sizze_238474 %
                                                             8) % 8) +
                                     (shared_sizze_238476 + (8 -
                                                             shared_sizze_238476 %
                                                             8) % 8);
                        
                        if ((((((1 && nest_sizze_209492 != 0) && 1 != 0) && 1 !=
                               0) && q_l_203495 != 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_209492;
                            grid[perm[1]] = 1;
                            grid[perm[2]] = 1;
                            
                            void *kernel_args_238455[] = {&ctx->global_failure,
                                                          &shared_offset_238459,
                                                          &shared_offset_238461,
                                                          &shared_offset_238463,
                                                          &shared_offset_238465,
                                                          &shared_offset_238467,
                                                          &shared_offset_238469,
                                                          &shared_offset_238471,
                                                          &shared_offset_238473,
                                                          &shared_offset_238475,
                                                          &shared_offset_238477,
                                                          &shared_offset_238479,
                                                          &n_203490,
                                                          &q_l_203495,
                                                          &jump_t_203500,
                                                          &partition_sizze_203577,
                                                          &l_n_m_203643,
                                                          &i_203670,
                                                          &ctx_param_ext_229488,
                                                          &ctx_param_ext_229489,
                                                          &ctx_param_ext_229491,
                                                          &kernel_arg_238480,
                                                          &kernel_arg_238481,
                                                          &kernel_arg_238482,
                                                          &kernel_arg_238483,
                                                          &kernel_arg_238484,
                                                          &kernel_arg_238485};
                            int64_t time_start_238456 = 0, time_end_238457 = 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_222093",
                                        (long) nest_sizze_209492, (long) 1,
                                        (long) 1, (long) q_l_203495, (long) 1,
                                        (long) 1, (int) (0 +
                                                         (shared_sizze_238458 +
                                                          (8 -
                                                           shared_sizze_238458 %
                                                           8) % 8) +
                                                         (shared_sizze_238460 +
                                                          (8 -
                                                           shared_sizze_238460 %
                                                           8) % 8) +
                                                         (shared_sizze_238462 +
                                                          (8 -
                                                           shared_sizze_238462 %
                                                           8) % 8) +
                                                         (shared_sizze_238464 +
                                                          (8 -
                                                           shared_sizze_238464 %
                                                           8) % 8) +
                                                         (shared_sizze_238466 +
                                                          (8 -
                                                           shared_sizze_238466 %
                                                           8) % 8) +
                                                         (shared_sizze_238468 +
                                                          (8 -
                                                           shared_sizze_238468 %
                                                           8) % 8) +
                                                         (shared_sizze_238470 +
                                                          (8 -
                                                           shared_sizze_238470 %
                                                           8) % 8) +
                                                         (shared_sizze_238472 +
                                                          (8 -
                                                           shared_sizze_238472 %
                                                           8) % 8) +
                                                         (shared_sizze_238474 +
                                                          (8 -
                                                           shared_sizze_238474 %
                                                           8) % 8) +
                                                         (shared_sizze_238476 +
                                                          (8 -
                                                           shared_sizze_238476 %
                                                           8) % 8) +
                                                         (shared_sizze_238478 +
                                                          (8 -
                                                           shared_sizze_238478 %
                                                           8) % 8)));
                                time_start_238456 = get_wall_time();
                            }
                            
                            cudaEvent_t *pevents = NULL;
                            
                            if (ctx->profiling && !ctx->profiling_paused) {
                                pevents = cuda_get_events(&ctx->cuda,
                                                          &ctx->mainzisegmap_intragroup_222093_runs,
                                                          &ctx->mainzisegmap_intragroup_222093_total_runtime);
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                   0));
                            }
                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_intragroup_222093,
                                                                  grid[0],
                                                                  grid[1],
                                                                  grid[2],
                                                                  q_l_203495, 1,
                                                                  1, 0 +
                                                                  (shared_sizze_238458 +
                                                                   (8 -
                                                                    shared_sizze_238458 %
                                                                    8) % 8) +
                                                                  (shared_sizze_238460 +
                                                                   (8 -
                                                                    shared_sizze_238460 %
                                                                    8) % 8) +
                                                                  (shared_sizze_238462 +
                                                                   (8 -
                                                                    shared_sizze_238462 %
                                                                    8) % 8) +
                                                                  (shared_sizze_238464 +
                                                                   (8 -
                                                                    shared_sizze_238464 %
                                                                    8) % 8) +
                                                                  (shared_sizze_238466 +
                                                                   (8 -
                                                                    shared_sizze_238466 %
                                                                    8) % 8) +
                                                                  (shared_sizze_238468 +
                                                                   (8 -
                                                                    shared_sizze_238468 %
                                                                    8) % 8) +
                                                                  (shared_sizze_238470 +
                                                                   (8 -
                                                                    shared_sizze_238470 %
                                                                    8) % 8) +
                                                                  (shared_sizze_238472 +
                                                                   (8 -
                                                                    shared_sizze_238472 %
                                                                    8) % 8) +
                                                                  (shared_sizze_238474 +
                                                                   (8 -
                                                                    shared_sizze_238474 %
                                                                    8) % 8) +
                                                                  (shared_sizze_238476 +
                                                                   (8 -
                                                                    shared_sizze_238476 %
                                                                    8) % 8) +
                                                                  (shared_sizze_238478 +
                                                                   (8 -
                                                                    shared_sizze_238478 %
                                                                    8) % 8),
                                                                  NULL,
                                                                  kernel_args_238455,
                                                                  NULL));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                            if (ctx->debugging) {
                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                time_end_238457 = get_wall_time();
                                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                        "main.segmap_intragroup_222093",
                                        time_end_238457 - time_start_238456);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_set_device(ctx, &ext_mem_230904,
                                                &mem_230898, "mem_230898") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_230903,
                                                &mem_230902, "mem_230902") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230902,
                                                  "mem_230902") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230898,
                                                  "mem_230898") != 0)
                            return 1;
                    }
                    if (memblock_set_device(ctx, &ext_mem_230906,
                                            &ext_mem_230904,
                                            "ext_mem_230904") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_230905,
                                            &ext_mem_230903,
                                            "ext_mem_230903") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230903,
                                              "ext_mem_230903") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230904,
                                              "ext_mem_230904") != 0)
                        return 1;
                }
                if (memblock_set_device(ctx, &ext_mem_230908, &ext_mem_230906,
                                        "ext_mem_230906") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_230907, &ext_mem_230905,
                                        "ext_mem_230905") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_230905,
                                          "ext_mem_230905") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_230906,
                                          "ext_mem_230906") != 0)
                    return 1;
            }
            
            struct memblock_device ext_mem_230914;
            
            ext_mem_230914.references = NULL;
            if (cond_204107) {
                bool zzero_205783 = jump_l_203501 == (int64_t) 0;
                bool nonzzero_205784 = !zzero_205783;
                bool nonzzero_cert_205785;
                
                if (!nonzzero_205784) {
                    ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                                           "division by zero",
                                           "-> #0  loess.fut:547:20-27\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:546:3-550:9\n   #5  stl.fut:252:23-75\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:250:15-253:43\n   #9  stl.fut:415:61-429:75\n   #10 stl.fut:455:3-469:34\n   #11 stl.fut:439:1-469:34\n");
                    if (memblock_unref_device(ctx, &ext_mem_230914,
                                              "ext_mem_230914") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230907,
                                              "ext_mem_230907") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230908,
                                              "ext_mem_230908") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230546,
                                              "ext_mem_230546") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230529,
                                              "ext_mem_230529") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230512,
                                              "ext_mem_230512") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230494,
                                              "ext_mem_230494") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230486,
                                              "ext_mem_230486") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230487,
                                              "ext_mem_230487") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229515,
                                              "mem_param_229515") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229507,
                                              "mem_param_229507") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231517,
                                              "ext_mem_231517") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231518,
                                              "ext_mem_231518") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229493,
                                              "mem_param_229493") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229485,
                                              "mem_param_229485") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229477,
                                              "mem_param_229477") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231860,
                                              "ext_mem_231860") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231861,
                                              "ext_mem_231861") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231862,
                                              "ext_mem_231862") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230551, "mem_230551") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230534, "mem_230534") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230517, "mem_230517") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230500, "mem_230500") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229531, "mem_229531") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229526, "mem_229526") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229520, "mem_229520") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229469, "mem_229469") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229465, "mem_229465") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229460,
                                              "ext_mem_229460") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229461,
                                              "ext_mem_229461") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229411,
                                              "ext_mem_229411") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229412,
                                              "ext_mem_229412") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229362,
                                              "ext_mem_229362") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229363,
                                              "ext_mem_229363") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229264,
                                              "ext_mem_229264") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229265,
                                              "ext_mem_229265") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229206, "mem_229206") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229200, "mem_229200") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229196,
                                              "ext_mem_229196") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229197,
                                              "ext_mem_229197") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229164, "mem_229164") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229161, "mem_229161") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229157, "mem_229157") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229155, "mem_229155") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229152, "mem_229152") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229148, "mem_229148") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232249,
                                              "mem_out_232249") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232248,
                                              "mem_out_232248") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232247,
                                              "mem_out_232247") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                int64_t y_205786 = sub64(l_n_m_203643, (int64_t) 1);
                int64_t segmap_group_sizze_222344;
                
                segmap_group_sizze_222344 =
                    *ctx->tuning_params.mainzisegmap_group_sizze_222226;
                
                int64_t segmap_usable_groups_222345 =
                        sdiv_up64(nest_sizze_207000, segmap_group_sizze_222344);
                struct memblock_device mem_230913;
                
                mem_230913.references = NULL;
                if (memblock_alloc_device(ctx, &mem_230913, bytes_229177,
                                          "mem_230913")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                
                CUdeviceptr kernel_arg_238489 = ext_mem_230907.mem;
                CUdeviceptr kernel_arg_238490 = ext_mem_230908.mem;
                CUdeviceptr kernel_arg_238491 = mem_230913.mem;
                
                if ((((((1 && segmap_usable_groups_222345 != 0) && 1 != 0) &&
                       1 != 0) && segmap_group_sizze_222344 != 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_222345;
                    grid[perm[1]] = 1;
                    grid[perm[2]] = 1;
                    
                    void *kernel_args_238486[] = {&ctx->global_failure,
                                                  &ctx->failure_is_an_option,
                                                  &ctx->global_failure_args,
                                                  &n_203490, &jump_l_203501,
                                                  &partition_sizze_203577,
                                                  &l_n_m_203643, &i_203670,
                                                  &y_205786, &kernel_arg_238489,
                                                  &kernel_arg_238490,
                                                  &kernel_arg_238491};
                    int64_t time_start_238487 = 0, time_end_238488 = 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_222349",
                                (long) segmap_usable_groups_222345, (long) 1,
                                (long) 1, (long) segmap_group_sizze_222344,
                                (long) 1, (long) 1, (int) 0);
                        time_start_238487 = get_wall_time();
                    }
                    
                    cudaEvent_t *pevents = NULL;
                    
                    if (ctx->profiling && !ctx->profiling_paused) {
                        pevents = cuda_get_events(&ctx->cuda,
                                                  &ctx->mainzisegmap_222349_runs,
                                                  &ctx->mainzisegmap_222349_total_runtime);
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                    }
                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_222349,
                                                          grid[0], grid[1],
                                                          grid[2],
                                                          segmap_group_sizze_222344,
                                                          1, 1, 0, NULL,
                                                          kernel_args_238486,
                                                          NULL));
                    if (pevents != NULL)
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                    if (ctx->debugging) {
                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                        time_end_238488 = get_wall_time();
                        fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                "main.segmap_222349", time_end_238488 -
                                time_start_238487);
                    }
                }
                ctx->failure_is_an_option = 1;
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_set_device(ctx, &ext_mem_230914, &mem_230913,
                                        "mem_230913") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230913, "mem_230913") != 0)
                    return 1;
            } else {
                bool dim_match_205838 = n_203490 == l_n_m_203643;
                bool empty_or_match_cert_205839;
                
                if (!dim_match_205838) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Value of (core language) shape (",
                                  (long long) partition_sizze_203577, ", ",
                                  (long long) l_n_m_203643,
                                  ") cannot match shape of type `[",
                                  (long long) partition_sizze_203577, "][",
                                  (long long) n_203490, "]t`.",
                                  "-> #0  stl.fut:255:15-36\n   #1  stl.fut:415:61-429:75\n   #2  stl.fut:455:3-469:34\n   #3  stl.fut:439:1-469:34\n");
                    if (memblock_unref_device(ctx, &ext_mem_230914,
                                              "ext_mem_230914") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230907,
                                              "ext_mem_230907") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230908,
                                              "ext_mem_230908") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230546,
                                              "ext_mem_230546") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230529,
                                              "ext_mem_230529") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230512,
                                              "ext_mem_230512") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230494,
                                              "ext_mem_230494") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230486,
                                              "ext_mem_230486") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230487,
                                              "ext_mem_230487") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229515,
                                              "mem_param_229515") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229507,
                                              "mem_param_229507") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231517,
                                              "ext_mem_231517") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231518,
                                              "ext_mem_231518") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229493,
                                              "mem_param_229493") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229485,
                                              "mem_param_229485") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229477,
                                              "mem_param_229477") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231860,
                                              "ext_mem_231860") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231861,
                                              "ext_mem_231861") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231862,
                                              "ext_mem_231862") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230551, "mem_230551") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230534, "mem_230534") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230517, "mem_230517") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230500, "mem_230500") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229531, "mem_229531") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229526, "mem_229526") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229520, "mem_229520") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229469, "mem_229469") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229465, "mem_229465") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229460,
                                              "ext_mem_229460") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229461,
                                              "ext_mem_229461") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229411,
                                              "ext_mem_229411") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229412,
                                              "ext_mem_229412") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229362,
                                              "ext_mem_229362") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229363,
                                              "ext_mem_229363") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229264,
                                              "ext_mem_229264") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229265,
                                              "ext_mem_229265") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229206, "mem_229206") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229200, "mem_229200") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229196,
                                              "ext_mem_229196") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229197,
                                              "ext_mem_229197") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229164, "mem_229164") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229161, "mem_229161") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229157, "mem_229157") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229155, "mem_229155") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229152, "mem_229152") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229148, "mem_229148") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232249,
                                              "mem_out_232249") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232248,
                                              "mem_out_232248") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232247,
                                              "mem_out_232247") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                if (memblock_set_device(ctx, &ext_mem_230914, &ext_mem_230908,
                                        "ext_mem_230908") != 0)
                    return 1;
            }
            if (memblock_unref_device(ctx, &ext_mem_230907, "ext_mem_230907") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_230908, "ext_mem_230908") !=
                0)
                return 1;
            
            struct memblock_device mem_230920;
            
            mem_230920.references = NULL;
            if (memblock_alloc_device(ctx, &mem_230920, bytes_229177,
                                      "mem_230920")) {
                err = 1;
                goto cleanup;
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            
            CUdeviceptr kernel_arg_238495 = mem_230500.mem;
            CUdeviceptr kernel_arg_238496 = ext_mem_230914.mem;
            CUdeviceptr kernel_arg_238497 = mem_230920.mem;
            
            if ((((((1 && segmap_usable_groups_222440 != 0) && 1 != 0) && 1 !=
                   0) && segmap_group_sizze_222439 != 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_222440;
                grid[perm[1]] = 1;
                grid[perm[2]] = 1;
                
                void *kernel_args_238492[] = {&ctx->global_failure, &n_203490,
                                              &n_p_203492,
                                              &partition_sizze_203577,
                                              &C_len_203634, &ext_230915,
                                              &kernel_arg_238495,
                                              &kernel_arg_238496,
                                              &kernel_arg_238497};
                int64_t time_start_238493 = 0, time_end_238494 = 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_222444",
                            (long) segmap_usable_groups_222440, (long) 1,
                            (long) 1, (long) segmap_group_sizze_222439,
                            (long) 1, (long) 1, (int) 0);
                    time_start_238493 = get_wall_time();
                }
                
                cudaEvent_t *pevents = NULL;
                
                if (ctx->profiling && !ctx->profiling_paused) {
                    pevents = cuda_get_events(&ctx->cuda,
                                              &ctx->mainzisegmap_222444_runs,
                                              &ctx->mainzisegmap_222444_total_runtime);
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                }
                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_222444,
                                                      grid[0], grid[1], grid[2],
                                                      segmap_group_sizze_222439,
                                                      1, 1, 0, NULL,
                                                      kernel_args_238492,
                                                      NULL));
                if (pevents != NULL)
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                if (ctx->debugging) {
                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                    time_end_238494 = get_wall_time();
                    fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                            "main.segmap_222444", time_end_238494 -
                            time_start_238493);
                }
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            if (memblock_unref_device(ctx, &ext_mem_230914, "ext_mem_230914") !=
                0)
                return 1;
            
            struct memblock_device ext_mem_231505;
            
            ext_mem_231505.references = NULL;
            
            struct memblock_device ext_mem_231504;
            
            ext_mem_231504.references = NULL;
            if (cond_204165) {
                bool match_lit_205851 = (int64_t) 0 == d_t_203497;
                struct memblock_device ext_mem_231402;
                
                ext_mem_231402.references = NULL;
                
                struct memblock_device ext_mem_231401;
                
                ext_mem_231401.references = NULL;
                if (match_lit_205851) {
                    struct memblock_device mem_230924;
                    
                    mem_230924.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_230924, bytes_229427,
                                              "mem_230924")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (futrts_builtinzhreplicate_f64(ctx, mem_230924,
                                                      partition_sizze_203577 *
                                                      t_n_m_203650, 0.0) != 0) {
                        if (memblock_unref_device(ctx, &mem_230924,
                                                  "mem_230924") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231401,
                                                  "ext_mem_231401") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231402,
                                                  "ext_mem_231402") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231504,
                                                  "ext_mem_231504") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231505,
                                                  "ext_mem_231505") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230920,
                                                  "mem_230920") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230914,
                                                  "ext_mem_230914") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230907,
                                                  "ext_mem_230907") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230908,
                                                  "ext_mem_230908") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230546,
                                                  "ext_mem_230546") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230529,
                                                  "ext_mem_230529") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230512,
                                                  "ext_mem_230512") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230494,
                                                  "ext_mem_230494") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230486,
                                                  "ext_mem_230486") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230487,
                                                  "ext_mem_230487") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229515,
                                                  "mem_param_229515") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229507,
                                                  "mem_param_229507") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231517,
                                                  "ext_mem_231517") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231518,
                                                  "ext_mem_231518") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229493,
                                                  "mem_param_229493") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229485,
                                                  "mem_param_229485") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229477,
                                                  "mem_param_229477") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231860,
                                                  "ext_mem_231860") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231861,
                                                  "ext_mem_231861") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231862,
                                                  "ext_mem_231862") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230551,
                                                  "mem_230551") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230534,
                                                  "mem_230534") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230517,
                                                  "mem_230517") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230500,
                                                  "mem_230500") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229531,
                                                  "mem_229531") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229526,
                                                  "mem_229526") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229520,
                                                  "mem_229520") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229469,
                                                  "mem_229469") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229465,
                                                  "mem_229465") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229460,
                                                  "ext_mem_229460") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229461,
                                                  "ext_mem_229461") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229411,
                                                  "ext_mem_229411") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229412,
                                                  "ext_mem_229412") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229362,
                                                  "ext_mem_229362") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229363,
                                                  "ext_mem_229363") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229264,
                                                  "ext_mem_229264") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229265,
                                                  "ext_mem_229265") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229206,
                                                  "mem_229206") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229200,
                                                  "mem_229200") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229196,
                                                  "ext_mem_229196") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229197,
                                                  "ext_mem_229197") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229164,
                                                  "mem_229164") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229161,
                                                  "mem_229161") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229157,
                                                  "mem_229157") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229155,
                                                  "mem_229155") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229152,
                                                  "mem_229152") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229148,
                                                  "mem_229148") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232249,
                                                  "mem_out_232249") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232248,
                                                  "mem_out_232248") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232247,
                                                  "mem_out_232247") != 0)
                            return 1;
                        err = 1;
                        goto cleanup;
                    }
                    
                    bool suff_outer_par_222450;
                    
                    suff_outer_par_222450 =
                        *ctx->tuning_params.mainzisuff_outer_par_28 <=
                        partition_sizze_203577;
                    if (ctx->logging)
                        fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                "main.suff_outer_par_28",
                                (long) partition_sizze_203577,
                                suff_outer_par_222450 ? "true" : "false");
                    
                    int64_t segmap_group_sizze_222546;
                    
                    segmap_group_sizze_222546 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_222454;
                    
                    int64_t num_groups_222547;
                    int32_t max_num_groups_235587;
                    
                    max_num_groups_235587 =
                        *ctx->tuning_params.mainzisegmap_num_groups_222456;
                    num_groups_222547 = sext_i64_i32(smax64((int64_t) 1,
                                                            smin64(sdiv_up64(partition_sizze_203577,
                                                                             segmap_group_sizze_222546),
                                                                   sext_i32_i64(max_num_groups_235587))));
                    
                    int64_t segmap_group_sizze_223062;
                    
                    segmap_group_sizze_223062 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_223036;
                    
                    int64_t segmap_group_sizze_223078;
                    
                    segmap_group_sizze_223078 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_222980;
                    
                    int64_t segmap_group_sizze_223103;
                    
                    segmap_group_sizze_223103 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_222643;
                    
                    bool suff_outer_par_223107;
                    
                    suff_outer_par_223107 =
                        *ctx->tuning_params.mainzisuff_outer_par_29 <=
                        nest_sizze_210118;
                    if (ctx->logging)
                        fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                "main.suff_outer_par_29",
                                (long) nest_sizze_210118,
                                suff_outer_par_223107 ? "true" : "false");
                    
                    int64_t nest_sizze_223189 = q_t_203494 * nest_sizze_210118;
                    int64_t segred_group_sizze_223190;
                    
                    segred_group_sizze_223190 =
                        *ctx->tuning_params.mainzisegred_group_sizze_222794;
                    
                    int64_t num_groups_223191;
                    int32_t max_num_groups_235588;
                    
                    max_num_groups_235588 =
                        *ctx->tuning_params.mainzisegred_num_groups_222796;
                    num_groups_223191 = sext_i64_i32(smax64((int64_t) 1,
                                                            smin64(sdiv_up64(nest_sizze_223189,
                                                                             segred_group_sizze_223190),
                                                                   sext_i32_i64(max_num_groups_235588))));
                    
                    int64_t segmap_group_sizze_223231;
                    
                    segmap_group_sizze_223231 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_222781;
                    
                    int64_t segred_group_sizze_223242;
                    
                    segred_group_sizze_223242 =
                        *ctx->tuning_params.mainzisegred_group_sizze_222724;
                    
                    int64_t num_groups_223243;
                    int32_t max_num_groups_235589;
                    
                    max_num_groups_235589 =
                        *ctx->tuning_params.mainzisegred_num_groups_222726;
                    num_groups_223243 = sext_i64_i32(smax64((int64_t) 1,
                                                            smin64(sdiv_up64(nest_sizze_223189,
                                                                             segred_group_sizze_223242),
                                                                   sext_i32_i64(max_num_groups_235589))));
                    
                    int64_t maxSubHelper_232039 = umax64(bytes_229169,
                                                         bytes_229420);
                    int64_t num_threads_232182 = segmap_group_sizze_222546 *
                            num_groups_222547;
                    int64_t total_sizze_232183 = maxSubHelper_232039 *
                            num_threads_232182;
                    int64_t total_sizze_232184 = bytes_229169 *
                            num_threads_232182;
                    int64_t total_sizze_232185 = bytes_229169 *
                            num_threads_232182;
                    struct memblock_device ext_mem_231044;
                    
                    ext_mem_231044.references = NULL;
                    
                    int32_t local_memory_capacity_235808;
                    
                    local_memory_capacity_235808 = ctx->cuda.max_shared_memory;
                    if ((sle64((int64_t) 0,
                               sext_i32_i64(local_memory_capacity_235808)) &&
                         sle64((int64_t) 0,
                               sext_i32_i64(local_memory_capacity_235808))) &&
                        suff_outer_par_222450) {
                        struct memblock_device mem_230927;
                        
                        mem_230927.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230927,
                                                  binop_y_229176,
                                                  "mem_230927")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                  mem_230927,
                                                                  (int64_t) 0,
                                                                  mem_230920,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  n_203490,
                                                                  partition_sizze_203577) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_230927,
                                                      "mem_230927") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231044,
                                                      "ext_mem_231044") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230924,
                                                      "mem_230924") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231401,
                                                      "ext_mem_231401") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231402,
                                                      "ext_mem_231402") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231504,
                                                      "ext_mem_231504") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231505,
                                                      "ext_mem_231505") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230920,
                                                      "mem_230920") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230914,
                                                      "ext_mem_230914") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230907,
                                                      "ext_mem_230907") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230908,
                                                      "ext_mem_230908") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230546,
                                                      "ext_mem_230546") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230529,
                                                      "ext_mem_230529") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230512,
                                                      "ext_mem_230512") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230494,
                                                      "ext_mem_230494") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230486,
                                                      "ext_mem_230486") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230487,
                                                      "ext_mem_230487") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229515,
                                                      "mem_param_229515") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229507,
                                                      "mem_param_229507") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231517,
                                                      "ext_mem_231517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231518,
                                                      "ext_mem_231518") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229493,
                                                      "mem_param_229493") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229485,
                                                      "mem_param_229485") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229477,
                                                      "mem_param_229477") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231860,
                                                      "ext_mem_231860") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231861,
                                                      "ext_mem_231861") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231862,
                                                      "ext_mem_231862") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230551,
                                                      "mem_230551") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230534,
                                                      "mem_230534") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230517,
                                                      "mem_230517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230500,
                                                      "mem_230500") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229531,
                                                      "mem_229531") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229526,
                                                      "mem_229526") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229520,
                                                      "mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229469,
                                                      "mem_229469") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229465,
                                                      "mem_229465") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229460,
                                                      "ext_mem_229460") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229461,
                                                      "ext_mem_229461") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229411,
                                                      "ext_mem_229411") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229412,
                                                      "ext_mem_229412") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229362,
                                                      "ext_mem_229362") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229363,
                                                      "ext_mem_229363") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229264,
                                                      "ext_mem_229264") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229265,
                                                      "ext_mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229206,
                                                      "mem_229206") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229200,
                                                      "mem_229200") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229196,
                                                      "ext_mem_229196") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229197,
                                                      "ext_mem_229197") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229164,
                                                      "mem_229164") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229161,
                                                      "mem_229161") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229157,
                                                      "mem_229157") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229155,
                                                      "mem_229155") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229152,
                                                      "mem_229152") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229148,
                                                      "mem_229148") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232249,
                                                      "mem_out_232249") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232248,
                                                      "mem_out_232248") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232247,
                                                      "mem_out_232247") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_230930;
                        
                        mem_230930.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230930,
                                                  binop_y_229176,
                                                  "mem_230930")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                  mem_230930,
                                                                  (int64_t) 0,
                                                                  ext_mem_229197,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  n_203490,
                                                                  partition_sizze_203577) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_230930,
                                                      "mem_230930") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230927,
                                                      "mem_230927") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231044,
                                                      "ext_mem_231044") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230924,
                                                      "mem_230924") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231401,
                                                      "ext_mem_231401") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231402,
                                                      "ext_mem_231402") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231504,
                                                      "ext_mem_231504") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231505,
                                                      "ext_mem_231505") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230920,
                                                      "mem_230920") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230914,
                                                      "ext_mem_230914") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230907,
                                                      "ext_mem_230907") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230908,
                                                      "ext_mem_230908") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230546,
                                                      "ext_mem_230546") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230529,
                                                      "ext_mem_230529") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230512,
                                                      "ext_mem_230512") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230494,
                                                      "ext_mem_230494") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230486,
                                                      "ext_mem_230486") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230487,
                                                      "ext_mem_230487") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229515,
                                                      "mem_param_229515") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229507,
                                                      "mem_param_229507") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231517,
                                                      "ext_mem_231517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231518,
                                                      "ext_mem_231518") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229493,
                                                      "mem_param_229493") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229485,
                                                      "mem_param_229485") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229477,
                                                      "mem_param_229477") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231860,
                                                      "ext_mem_231860") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231861,
                                                      "ext_mem_231861") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231862,
                                                      "ext_mem_231862") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230551,
                                                      "mem_230551") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230534,
                                                      "mem_230534") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230517,
                                                      "mem_230517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230500,
                                                      "mem_230500") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229531,
                                                      "mem_229531") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229526,
                                                      "mem_229526") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229520,
                                                      "mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229469,
                                                      "mem_229469") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229465,
                                                      "mem_229465") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229460,
                                                      "ext_mem_229460") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229461,
                                                      "ext_mem_229461") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229411,
                                                      "ext_mem_229411") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229412,
                                                      "ext_mem_229412") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229362,
                                                      "ext_mem_229362") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229363,
                                                      "ext_mem_229363") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229264,
                                                      "ext_mem_229264") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229265,
                                                      "ext_mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229206,
                                                      "mem_229206") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229200,
                                                      "mem_229200") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229196,
                                                      "ext_mem_229196") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229197,
                                                      "ext_mem_229197") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229164,
                                                      "mem_229164") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229161,
                                                      "mem_229161") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229157,
                                                      "mem_229157") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229155,
                                                      "mem_229155") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229152,
                                                      "mem_229152") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229148,
                                                      "mem_229148") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232249,
                                                      "mem_out_232249") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232248,
                                                      "mem_out_232248") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232247,
                                                      "mem_out_232247") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_230933;
                        
                        mem_230933.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230933,
                                                  binop_y_229426,
                                                  "mem_230933")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                  mem_230933,
                                                                  (int64_t) 0,
                                                                  ext_mem_229461,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  t_n_m_203650,
                                                                  partition_sizze_203577) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_230933,
                                                      "mem_230933") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230930,
                                                      "mem_230930") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230927,
                                                      "mem_230927") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231044,
                                                      "ext_mem_231044") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230924,
                                                      "mem_230924") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231401,
                                                      "ext_mem_231401") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231402,
                                                      "ext_mem_231402") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231504,
                                                      "ext_mem_231504") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231505,
                                                      "ext_mem_231505") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230920,
                                                      "mem_230920") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230914,
                                                      "ext_mem_230914") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230907,
                                                      "ext_mem_230907") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230908,
                                                      "ext_mem_230908") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230546,
                                                      "ext_mem_230546") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230529,
                                                      "ext_mem_230529") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230512,
                                                      "ext_mem_230512") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230494,
                                                      "ext_mem_230494") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230486,
                                                      "ext_mem_230486") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230487,
                                                      "ext_mem_230487") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229515,
                                                      "mem_param_229515") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229507,
                                                      "mem_param_229507") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231517,
                                                      "ext_mem_231517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231518,
                                                      "ext_mem_231518") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229493,
                                                      "mem_param_229493") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229485,
                                                      "mem_param_229485") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229477,
                                                      "mem_param_229477") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231860,
                                                      "ext_mem_231860") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231861,
                                                      "ext_mem_231861") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231862,
                                                      "ext_mem_231862") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230551,
                                                      "mem_230551") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230534,
                                                      "mem_230534") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230517,
                                                      "mem_230517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230500,
                                                      "mem_230500") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229531,
                                                      "mem_229531") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229526,
                                                      "mem_229526") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229520,
                                                      "mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229469,
                                                      "mem_229469") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229465,
                                                      "mem_229465") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229460,
                                                      "ext_mem_229460") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229461,
                                                      "ext_mem_229461") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229411,
                                                      "ext_mem_229411") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229412,
                                                      "ext_mem_229412") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229362,
                                                      "ext_mem_229362") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229363,
                                                      "ext_mem_229363") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229264,
                                                      "ext_mem_229264") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229265,
                                                      "ext_mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229206,
                                                      "mem_229206") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229200,
                                                      "mem_229200") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229196,
                                                      "ext_mem_229196") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229197,
                                                      "ext_mem_229197") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229164,
                                                      "mem_229164") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229161,
                                                      "mem_229161") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229157,
                                                      "mem_229157") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229155,
                                                      "mem_229155") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229152,
                                                      "mem_229152") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229148,
                                                      "mem_229148") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232249,
                                                      "mem_out_232249") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232248,
                                                      "mem_out_232248") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232247,
                                                      "mem_out_232247") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_230936;
                        
                        mem_230936.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230936,
                                                  binop_y_229426,
                                                  "mem_230936")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                  mem_230936,
                                                                  (int64_t) 0,
                                                                  ext_mem_229460,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  t_n_m_203650,
                                                                  partition_sizze_203577) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_230936,
                                                      "mem_230936") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230933,
                                                      "mem_230933") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230930,
                                                      "mem_230930") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230927,
                                                      "mem_230927") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231044,
                                                      "ext_mem_231044") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230924,
                                                      "mem_230924") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231401,
                                                      "ext_mem_231401") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231402,
                                                      "ext_mem_231402") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231504,
                                                      "ext_mem_231504") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231505,
                                                      "ext_mem_231505") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230920,
                                                      "mem_230920") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230914,
                                                      "ext_mem_230914") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230907,
                                                      "ext_mem_230907") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230908,
                                                      "ext_mem_230908") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230546,
                                                      "ext_mem_230546") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230529,
                                                      "ext_mem_230529") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230512,
                                                      "ext_mem_230512") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230494,
                                                      "ext_mem_230494") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230486,
                                                      "ext_mem_230486") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230487,
                                                      "ext_mem_230487") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229515,
                                                      "mem_param_229515") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229507,
                                                      "mem_param_229507") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231517,
                                                      "ext_mem_231517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231518,
                                                      "ext_mem_231518") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229493,
                                                      "mem_param_229493") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229485,
                                                      "mem_param_229485") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229477,
                                                      "mem_param_229477") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231860,
                                                      "ext_mem_231860") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231861,
                                                      "ext_mem_231861") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231862,
                                                      "ext_mem_231862") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230551,
                                                      "mem_230551") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230534,
                                                      "mem_230534") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230517,
                                                      "mem_230517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230500,
                                                      "mem_230500") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229531,
                                                      "mem_229531") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229526,
                                                      "mem_229526") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229520,
                                                      "mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229469,
                                                      "mem_229469") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229465,
                                                      "mem_229465") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229460,
                                                      "ext_mem_229460") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229461,
                                                      "ext_mem_229461") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229411,
                                                      "ext_mem_229411") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229412,
                                                      "ext_mem_229412") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229362,
                                                      "ext_mem_229362") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229363,
                                                      "ext_mem_229363") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229264,
                                                      "ext_mem_229264") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229265,
                                                      "ext_mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229206,
                                                      "mem_229206") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229200,
                                                      "mem_229200") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229196,
                                                      "ext_mem_229196") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229197,
                                                      "ext_mem_229197") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229164,
                                                      "mem_229164") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229161,
                                                      "mem_229161") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229157,
                                                      "mem_229157") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229155,
                                                      "mem_229155") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229152,
                                                      "mem_229152") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229148,
                                                      "mem_229148") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232249,
                                                      "mem_out_232249") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232248,
                                                      "mem_out_232248") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232247,
                                                      "mem_out_232247") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_230939;
                        
                        mem_230939.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230939,
                                                  binop_y_229176,
                                                  "mem_230939")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        int64_t group_sizze_235593;
                        
                        group_sizze_235593 =
                            *ctx->tuning_params.mainzigroup_sizze_235593;
                        
                        int64_t num_groups_235594 =
                                sdiv_up64(partition_sizze_203577 * n_203490,
                                          group_sizze_235593);
                        CUdeviceptr kernel_arg_238501 = mem_param_229493.mem;
                        CUdeviceptr kernel_arg_238502 = mem_230939.mem;
                        
                        if ((((((1 && num_groups_235594 != 0) && 1 != 0) && 1 !=
                               0) && group_sizze_235593 != 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_235594;
                            grid[perm[1]] = 1;
                            grid[perm[2]] = 1;
                            
                            void *kernel_args_238498[] = {&n_203490,
                                                          &partition_sizze_203577,
                                                          &ctx_param_ext_229488,
                                                          &ctx_param_ext_229489,
                                                          &ctx_param_ext_229491,
                                                          &kernel_arg_238501,
                                                          &kernel_arg_238502};
                            int64_t time_start_238499 = 0, time_end_238500 = 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_235590",
                                        (long) num_groups_235594, (long) 1,
                                        (long) 1, (long) group_sizze_235593,
                                        (long) 1, (long) 1, (int) 0);
                                time_start_238499 = get_wall_time();
                            }
                            
                            cudaEvent_t *pevents = NULL;
                            
                            if (ctx->profiling && !ctx->profiling_paused) {
                                pevents = cuda_get_events(&ctx->cuda,
                                                          &ctx->mainzicopy_235590_runs,
                                                          &ctx->mainzicopy_235590_total_runtime);
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                   0));
                            }
                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzicopy_235590,
                                                                  grid[0],
                                                                  grid[1],
                                                                  grid[2],
                                                                  group_sizze_235593,
                                                                  1, 1, 0, NULL,
                                                                  kernel_args_238498,
                                                                  NULL));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                            if (ctx->debugging) {
                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                time_end_238500 = get_wall_time();
                                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                        "main.copy_235590", time_end_238500 -
                                        time_start_238499);
                            }
                        }
                        
                        struct memblock_device mem_231003;
                        
                        mem_231003.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231003,
                                                  binop_y_229426,
                                                  "mem_231003")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device color_232040;
                        
                        color_232040.references = NULL;
                        if (memblock_alloc_device(ctx, &color_232040,
                                                  total_sizze_232183,
                                                  "color_232040")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device color_232041;
                        
                        color_232041.references = NULL;
                        if (memblock_alloc_device(ctx, &color_232041,
                                                  total_sizze_232184,
                                                  "color_232041")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device color_232042;
                        
                        color_232042.references = NULL;
                        if (memblock_alloc_device(ctx, &color_232042,
                                                  total_sizze_232185,
                                                  "color_232042")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        
                        CUdeviceptr kernel_arg_238506 = mem_229161.mem;
                        CUdeviceptr kernel_arg_238507 = ext_mem_229196.mem;
                        CUdeviceptr kernel_arg_238508 = mem_230927.mem;
                        CUdeviceptr kernel_arg_238509 = mem_230930.mem;
                        CUdeviceptr kernel_arg_238510 = mem_230933.mem;
                        CUdeviceptr kernel_arg_238511 = mem_230936.mem;
                        CUdeviceptr kernel_arg_238512 = mem_230939.mem;
                        CUdeviceptr kernel_arg_238513 = mem_231003.mem;
                        CUdeviceptr kernel_arg_238514 = color_232040.mem;
                        CUdeviceptr kernel_arg_238515 = color_232041.mem;
                        CUdeviceptr kernel_arg_238516 = color_232042.mem;
                        
                        if ((((((1 && num_groups_222547 != 0) && 1 != 0) && 1 !=
                               0) && segmap_group_sizze_222546 != 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_222547;
                            grid[perm[1]] = 1;
                            grid[perm[2]] = 1;
                            
                            void *kernel_args_238503[] = {&ctx->global_failure,
                                                          &ctx->failure_is_an_option,
                                                          &ctx->global_failure_args,
                                                          &n_203490,
                                                          &q_t_203494,
                                                          &jump_t_203500,
                                                          &partition_sizze_203577,
                                                          &t_n_m_203650,
                                                          &i_203670,
                                                          &num_groups_222547,
                                                          &num_threads_232182,
                                                          &kernel_arg_238506,
                                                          &kernel_arg_238507,
                                                          &kernel_arg_238508,
                                                          &kernel_arg_238509,
                                                          &kernel_arg_238510,
                                                          &kernel_arg_238511,
                                                          &kernel_arg_238512,
                                                          &kernel_arg_238513,
                                                          &kernel_arg_238514,
                                                          &kernel_arg_238515,
                                                          &kernel_arg_238516};
                            int64_t time_start_238504 = 0, time_end_238505 = 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_222551",
                                        (long) num_groups_222547, (long) 1,
                                        (long) 1,
                                        (long) segmap_group_sizze_222546,
                                        (long) 1, (long) 1, (int) 0);
                                time_start_238504 = get_wall_time();
                            }
                            
                            cudaEvent_t *pevents = NULL;
                            
                            if (ctx->profiling && !ctx->profiling_paused) {
                                pevents = cuda_get_events(&ctx->cuda,
                                                          &ctx->mainzisegmap_222551_runs,
                                                          &ctx->mainzisegmap_222551_total_runtime);
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                   0));
                            }
                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_222551,
                                                                  grid[0],
                                                                  grid[1],
                                                                  grid[2],
                                                                  segmap_group_sizze_222546,
                                                                  1, 1, 0, NULL,
                                                                  kernel_args_238503,
                                                                  NULL));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                            if (ctx->debugging) {
                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                time_end_238505 = get_wall_time();
                                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                        "main.segmap_222551", time_end_238505 -
                                        time_start_238504);
                            }
                        }
                        ctx->failure_is_an_option = 1;
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_unref_device(ctx, &mem_230927,
                                                  "mem_230927") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230930,
                                                  "mem_230930") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230933,
                                                  "mem_230933") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230936,
                                                  "mem_230936") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230939,
                                                  "mem_230939") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_232040,
                                                  "color_232040") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_232041,
                                                  "color_232041") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_232042,
                                                  "color_232042") != 0)
                            return 1;
                        
                        struct memblock_device mem_231042;
                        
                        mem_231042.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231042,
                                                  bytes_229427, "mem_231042")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                  mem_231042,
                                                                  (int64_t) 0,
                                                                  mem_231003,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  partition_sizze_203577,
                                                                  t_n_m_203650) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_231042,
                                                      "mem_231042") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232042,
                                                      "color_232042") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232041,
                                                      "color_232041") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232040,
                                                      "color_232040") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231003,
                                                      "mem_231003") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230939,
                                                      "mem_230939") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230936,
                                                      "mem_230936") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230933,
                                                      "mem_230933") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230930,
                                                      "mem_230930") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230927,
                                                      "mem_230927") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231044,
                                                      "ext_mem_231044") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230924,
                                                      "mem_230924") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231401,
                                                      "ext_mem_231401") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231402,
                                                      "ext_mem_231402") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231504,
                                                      "ext_mem_231504") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231505,
                                                      "ext_mem_231505") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230920,
                                                      "mem_230920") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230914,
                                                      "ext_mem_230914") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230907,
                                                      "ext_mem_230907") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230908,
                                                      "ext_mem_230908") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230546,
                                                      "ext_mem_230546") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230529,
                                                      "ext_mem_230529") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230512,
                                                      "ext_mem_230512") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230494,
                                                      "ext_mem_230494") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230486,
                                                      "ext_mem_230486") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230487,
                                                      "ext_mem_230487") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229515,
                                                      "mem_param_229515") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229507,
                                                      "mem_param_229507") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231517,
                                                      "ext_mem_231517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231518,
                                                      "ext_mem_231518") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229493,
                                                      "mem_param_229493") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229485,
                                                      "mem_param_229485") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229477,
                                                      "mem_param_229477") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231860,
                                                      "ext_mem_231860") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231861,
                                                      "ext_mem_231861") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231862,
                                                      "ext_mem_231862") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230551,
                                                      "mem_230551") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230534,
                                                      "mem_230534") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230517,
                                                      "mem_230517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230500,
                                                      "mem_230500") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229531,
                                                      "mem_229531") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229526,
                                                      "mem_229526") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229520,
                                                      "mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229469,
                                                      "mem_229469") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229465,
                                                      "mem_229465") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229460,
                                                      "ext_mem_229460") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229461,
                                                      "ext_mem_229461") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229411,
                                                      "ext_mem_229411") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229412,
                                                      "ext_mem_229412") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229362,
                                                      "ext_mem_229362") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229363,
                                                      "ext_mem_229363") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229264,
                                                      "ext_mem_229264") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229265,
                                                      "ext_mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229206,
                                                      "mem_229206") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229200,
                                                      "mem_229200") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229196,
                                                      "ext_mem_229196") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229197,
                                                      "ext_mem_229197") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229164,
                                                      "mem_229164") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229161,
                                                      "mem_229161") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229157,
                                                      "mem_229157") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229155,
                                                      "mem_229155") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229152,
                                                      "mem_229152") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229148,
                                                      "mem_229148") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232249,
                                                      "mem_out_232249") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232248,
                                                      "mem_out_232248") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232247,
                                                      "mem_out_232247") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        if (memblock_unref_device(ctx, &mem_231003,
                                                  "mem_231003") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_231044,
                                                &mem_231042, "mem_231042") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231042,
                                                  "mem_231042") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_232042,
                                                  "color_232042") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_232041,
                                                  "color_232041") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_232040,
                                                  "color_232040") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231003,
                                                  "mem_231003") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230939,
                                                  "mem_230939") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230936,
                                                  "mem_230936") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230933,
                                                  "mem_230933") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230930,
                                                  "mem_230930") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230927,
                                                  "mem_230927") != 0)
                            return 1;
                    } else {
                        int64_t segmap_usable_groups_223063 =
                                sdiv_up64(nest_sizze_207000,
                                          segmap_group_sizze_223062);
                        struct memblock_device mem_231008;
                        
                        mem_231008.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231008,
                                                  bytes_229177, "mem_231008")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        
                        CUdeviceptr kernel_arg_238520 = mem_229161.mem;
                        CUdeviceptr kernel_arg_238521 = mem_230920.mem;
                        CUdeviceptr kernel_arg_238522 = mem_231008.mem;
                        
                        if ((((((1 && segmap_usable_groups_223063 != 0) && 1 !=
                                0) && 1 != 0) && segmap_group_sizze_223062 !=
                              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_223063;
                            grid[perm[1]] = 1;
                            grid[perm[2]] = 1;
                            
                            void *kernel_args_238517[] = {&ctx->global_failure,
                                                          &n_203490,
                                                          &partition_sizze_203577,
                                                          &kernel_arg_238520,
                                                          &kernel_arg_238521,
                                                          &kernel_arg_238522};
                            int64_t time_start_238518 = 0, time_end_238519 = 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_223067",
                                        (long) segmap_usable_groups_223063,
                                        (long) 1, (long) 1,
                                        (long) segmap_group_sizze_223062,
                                        (long) 1, (long) 1, (int) 0);
                                time_start_238518 = get_wall_time();
                            }
                            
                            cudaEvent_t *pevents = NULL;
                            
                            if (ctx->profiling && !ctx->profiling_paused) {
                                pevents = cuda_get_events(&ctx->cuda,
                                                          &ctx->mainzisegmap_223067_runs,
                                                          &ctx->mainzisegmap_223067_total_runtime);
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                   0));
                            }
                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_223067,
                                                                  grid[0],
                                                                  grid[1],
                                                                  grid[2],
                                                                  segmap_group_sizze_223062,
                                                                  1, 1, 0, NULL,
                                                                  kernel_args_238517,
                                                                  NULL));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                            if (ctx->debugging) {
                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                time_end_238519 = get_wall_time();
                                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                        "main.segmap_223067", time_end_238519 -
                                        time_start_238518);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        
                        int64_t segmap_usable_groups_223079 =
                                sdiv_up64(nest_sizze_207000,
                                          segmap_group_sizze_223078);
                        struct memblock_device mem_231013;
                        
                        mem_231013.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231013,
                                                  bytes_229177, "mem_231013")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_231017;
                        
                        mem_231017.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231017,
                                                  bytes_229177, "mem_231017")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        
                        CUdeviceptr kernel_arg_238526 = ext_mem_229197.mem;
                        CUdeviceptr kernel_arg_238527 = mem_param_229493.mem;
                        CUdeviceptr kernel_arg_238528 = mem_231008.mem;
                        CUdeviceptr kernel_arg_238529 = mem_231013.mem;
                        CUdeviceptr kernel_arg_238530 = mem_231017.mem;
                        
                        if ((((((1 && segmap_usable_groups_223079 != 0) && 1 !=
                                0) && 1 != 0) && segmap_group_sizze_223078 !=
                              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_223079;
                            grid[perm[1]] = 1;
                            grid[perm[2]] = 1;
                            
                            void *kernel_args_238523[] = {&ctx->global_failure,
                                                          &ctx->failure_is_an_option,
                                                          &ctx->global_failure_args,
                                                          &n_203490,
                                                          &partition_sizze_203577,
                                                          &ctx_param_ext_229488,
                                                          &ctx_param_ext_229489,
                                                          &ctx_param_ext_229491,
                                                          &kernel_arg_238526,
                                                          &kernel_arg_238527,
                                                          &kernel_arg_238528,
                                                          &kernel_arg_238529,
                                                          &kernel_arg_238530};
                            int64_t time_start_238524 = 0, time_end_238525 = 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_223084",
                                        (long) segmap_usable_groups_223079,
                                        (long) 1, (long) 1,
                                        (long) segmap_group_sizze_223078,
                                        (long) 1, (long) 1, (int) 0);
                                time_start_238524 = get_wall_time();
                            }
                            
                            cudaEvent_t *pevents = NULL;
                            
                            if (ctx->profiling && !ctx->profiling_paused) {
                                pevents = cuda_get_events(&ctx->cuda,
                                                          &ctx->mainzisegmap_223084_runs,
                                                          &ctx->mainzisegmap_223084_total_runtime);
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                   0));
                            }
                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_223084,
                                                                  grid[0],
                                                                  grid[1],
                                                                  grid[2],
                                                                  segmap_group_sizze_223078,
                                                                  1, 1, 0, NULL,
                                                                  kernel_args_238523,
                                                                  NULL));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                            if (ctx->debugging) {
                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                time_end_238525 = get_wall_time();
                                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                        "main.segmap_223084", time_end_238525 -
                                        time_start_238524);
                            }
                        }
                        ctx->failure_is_an_option = 1;
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_unref_device(ctx, &mem_231008,
                                                  "mem_231008") != 0)
                            return 1;
                        
                        int64_t segmap_usable_groups_223104 =
                                sdiv_up64(nest_sizze_210118,
                                          segmap_group_sizze_223103);
                        struct memblock_device ext_mem_231038;
                        
                        ext_mem_231038.references = NULL;
                        
                        int32_t local_memory_capacity_235807;
                        
                        local_memory_capacity_235807 =
                            ctx->cuda.max_shared_memory;
                        if (sle64((int64_t) 0,
                                  sext_i32_i64(local_memory_capacity_235807)) &&
                            suff_outer_par_223107) {
                            struct memblock_device mem_231022;
                            
                            mem_231022.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231022,
                                                      bytes_229427,
                                                      "mem_231022")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            
                            CUdeviceptr kernel_arg_238534 = ext_mem_229196.mem;
                            CUdeviceptr kernel_arg_238535 = ext_mem_229197.mem;
                            CUdeviceptr kernel_arg_238536 = ext_mem_229460.mem;
                            CUdeviceptr kernel_arg_238537 = ext_mem_229461.mem;
                            CUdeviceptr kernel_arg_238538 = mem_231013.mem;
                            CUdeviceptr kernel_arg_238539 = mem_231017.mem;
                            CUdeviceptr kernel_arg_238540 = mem_231022.mem;
                            
                            if ((((((1 && segmap_usable_groups_223104 != 0) &&
                                    1 != 0) && 1 != 0) &&
                                  segmap_group_sizze_223103 != 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_223104;
                                grid[perm[1]] = 1;
                                grid[perm[2]] = 1;
                                
                                void *kernel_args_238531[] =
                                     {&ctx->global_failure, &n_203490,
                                      &q_t_203494, &jump_t_203500,
                                      &partition_sizze_203577, &t_n_m_203650,
                                      &i_203670, &kernel_arg_238534,
                                      &kernel_arg_238535, &kernel_arg_238536,
                                      &kernel_arg_238537, &kernel_arg_238538,
                                      &kernel_arg_238539, &kernel_arg_238540};
                                int64_t time_start_238532 = 0, time_end_238533 =
                                        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_223112",
                                            (long) segmap_usable_groups_223104,
                                            (long) 1, (long) 1,
                                            (long) segmap_group_sizze_223103,
                                            (long) 1, (long) 1, (int) 0);
                                    time_start_238532 = get_wall_time();
                                }
                                
                                cudaEvent_t *pevents = NULL;
                                
                                if (ctx->profiling && !ctx->profiling_paused) {
                                    pevents = cuda_get_events(&ctx->cuda,
                                                              &ctx->mainzisegmap_223112_runs,
                                                              &ctx->mainzisegmap_223112_total_runtime);
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                       0));
                                }
                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_223112,
                                                                      grid[0],
                                                                      grid[1],
                                                                      grid[2],
                                                                      segmap_group_sizze_223103,
                                                                      1, 1, 0,
                                                                      NULL,
                                                                      kernel_args_238531,
                                                                      NULL));
                                if (pevents != NULL)
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                       0));
                                if (ctx->debugging) {
                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                    time_end_238533 = get_wall_time();
                                    fprintf(ctx->log,
                                            "Kernel %s runtime: %ldus\n",
                                            "main.segmap_223112",
                                            time_end_238533 -
                                            time_start_238532);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_set_device(ctx, &ext_mem_231038,
                                                    &mem_231022,
                                                    "mem_231022") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231022,
                                                      "mem_231022") != 0)
                                return 1;
                        } else {
                            struct memblock_device mem_231027;
                            
                            mem_231027.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231027,
                                                      bytes_229427,
                                                      "mem_231027")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (slt64(q_t_203494 * (int64_t) 2,
                                      segred_group_sizze_223190)) {
                                int64_t segment_sizze_nonzzero_235653 =
                                        smax64((int64_t) 1, q_t_203494);
                                int64_t num_threads_235654 = num_groups_223191 *
                                        segred_group_sizze_223190;
                                
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n",
                                            "\n# SegRed-small");
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "num_segments",
                                            (long long) (partition_sizze_203577 *
                                                         t_n_m_203650), '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segment_size",
                                            (long long) q_t_203494, '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segments_per_group",
                                            (long long) squot64(segred_group_sizze_223190,
                                                                segment_sizze_nonzzero_235653),
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "required_groups",
                                            (long long) sext_i64_i32(sdiv_up64(partition_sizze_203577 *
                                                                               t_n_m_203650,
                                                                               squot64(segred_group_sizze_223190,
                                                                                       segment_sizze_nonzzero_235653))),
                                            '\n');
                                
                                unsigned int shared_sizze_238544 = (int64_t) 8 *
                                             segred_group_sizze_223190;
                                CUdeviceptr kernel_arg_238546 =
                                            ext_mem_229196.mem;
                                CUdeviceptr kernel_arg_238547 =
                                            ext_mem_229197.mem;
                                CUdeviceptr kernel_arg_238548 =
                                            ext_mem_229460.mem;
                                CUdeviceptr kernel_arg_238549 =
                                            ext_mem_229461.mem;
                                CUdeviceptr kernel_arg_238550 = mem_231013.mem;
                                CUdeviceptr kernel_arg_238551 = mem_231027.mem;
                                unsigned int shared_offset_238545 = 0;
                                
                                if ((((((1 && num_groups_223191 != 0) && 1 !=
                                        0) && 1 != 0) &&
                                      segred_group_sizze_223190 != 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_223191;
                                    grid[perm[1]] = 1;
                                    grid[perm[2]] = 1;
                                    
                                    void *kernel_args_238541[] =
                                         {&ctx->global_failure,
                                          &shared_offset_238545, &n_203490,
                                          &q_t_203494, &jump_t_203500,
                                          &partition_sizze_203577,
                                          &t_n_m_203650, &i_203670,
                                          &num_groups_223191,
                                          &segment_sizze_nonzzero_235653,
                                          &kernel_arg_238546,
                                          &kernel_arg_238547,
                                          &kernel_arg_238548,
                                          &kernel_arg_238549,
                                          &kernel_arg_238550,
                                          &kernel_arg_238551};
                                    int64_t time_start_238542 = 0,
                                            time_end_238543 = 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_223197",
                                                (long) num_groups_223191,
                                                (long) 1, (long) 1,
                                                (long) segred_group_sizze_223190,
                                                (long) 1, (long) 1, (int) (0 +
                                                                           (shared_sizze_238544 +
                                                                            (8 -
                                                                             shared_sizze_238544 %
                                                                             8) %
                                                                            8)));
                                        time_start_238542 = get_wall_time();
                                    }
                                    
                                    cudaEvent_t *pevents = NULL;
                                    
                                    if (ctx->profiling &&
                                        !ctx->profiling_paused) {
                                        pevents = cuda_get_events(&ctx->cuda,
                                                                  &ctx->mainzisegred_small_223197_runs,
                                                                  &ctx->mainzisegred_small_223197_total_runtime);
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                           0));
                                    }
                                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_small_223197,
                                                                          grid[0],
                                                                          grid[1],
                                                                          grid[2],
                                                                          segred_group_sizze_223190,
                                                                          1, 1,
                                                                          0 +
                                                                          (shared_sizze_238544 +
                                                                           (8 -
                                                                            shared_sizze_238544 %
                                                                            8) %
                                                                           8),
                                                                          NULL,
                                                                          kernel_args_238541,
                                                                          NULL));
                                    if (pevents != NULL)
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                           0));
                                    if (ctx->debugging) {
                                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                        time_end_238543 = get_wall_time();
                                        fprintf(ctx->log,
                                                "Kernel %s runtime: %ldus\n",
                                                "main.segred_small_223197",
                                                time_end_238543 -
                                                time_start_238542);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                            } else {
                                int64_t groups_per_segment_235682 =
                                        sdiv_up64(num_groups_223191,
                                                  smax64((int64_t) 1,
                                                         partition_sizze_203577 *
                                                         t_n_m_203650));
                                int64_t elements_per_thread_235683 =
                                        sdiv_up64(q_t_203494,
                                                  segred_group_sizze_223190 *
                                                  groups_per_segment_235682);
                                int64_t virt_num_groups_235684 =
                                        groups_per_segment_235682 *
                                        (partition_sizze_203577 * t_n_m_203650);
                                int64_t num_threads_235685 = num_groups_223191 *
                                        segred_group_sizze_223190;
                                int64_t threads_per_segment_235686 =
                                        groups_per_segment_235682 *
                                        segred_group_sizze_223190;
                                
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n",
                                            "\n# SegRed-large");
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "num_segments",
                                            (long long) (partition_sizze_203577 *
                                                         t_n_m_203650), '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segment_size",
                                            (long long) q_t_203494, '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "virt_num_groups",
                                            (long long) virt_num_groups_235684,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "num_groups",
                                            (long long) num_groups_223191,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "group_size",
                                            (long long) segred_group_sizze_223190,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "elems_per_thread",
                                            (long long) elements_per_thread_235683,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "groups_per_segment",
                                            (long long) groups_per_segment_235682,
                                            '\n');
                                
                                struct memblock_device segred_tmp_mem_235687;
                                
                                segred_tmp_mem_235687.references = NULL;
                                if (memblock_alloc_device(ctx,
                                                          &segred_tmp_mem_235687,
                                                          (int64_t) 8 *
                                                          virt_num_groups_235684,
                                                          "segred_tmp_mem_235687")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mainzicounter_mem_235689
                                                       =
                                                       ctx->mainzicounter_mem_235689;
                                unsigned int shared_sizze_238556 = 1;
                                unsigned int shared_sizze_238558 = (int64_t) 8 *
                                             segred_group_sizze_223190;
                                CUdeviceptr kernel_arg_238560 =
                                            ext_mem_229196.mem;
                                CUdeviceptr kernel_arg_238561 =
                                            ext_mem_229197.mem;
                                CUdeviceptr kernel_arg_238562 =
                                            ext_mem_229460.mem;
                                CUdeviceptr kernel_arg_238563 =
                                            ext_mem_229461.mem;
                                CUdeviceptr kernel_arg_238564 = mem_231013.mem;
                                CUdeviceptr kernel_arg_238565 = mem_231027.mem;
                                CUdeviceptr kernel_arg_238566 =
                                            segred_tmp_mem_235687.mem;
                                CUdeviceptr kernel_arg_238567 =
                                            mainzicounter_mem_235689.mem;
                                unsigned int shared_offset_238557 = 0;
                                unsigned int shared_offset_238559 = 0 +
                                             (shared_sizze_238556 + (8 -
                                                                     shared_sizze_238556 %
                                                                     8) % 8);
                                
                                if ((((((1 && num_groups_223191 != 0) && 1 !=
                                        0) && 1 != 0) &&
                                      segred_group_sizze_223190 != 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_223191;
                                    grid[perm[1]] = 1;
                                    grid[perm[2]] = 1;
                                    
                                    void *kernel_args_238553[] =
                                         {&ctx->global_failure,
                                          &shared_offset_238557,
                                          &shared_offset_238559, &n_203490,
                                          &q_t_203494, &jump_t_203500,
                                          &partition_sizze_203577,
                                          &t_n_m_203650, &i_203670,
                                          &num_groups_223191,
                                          &groups_per_segment_235682,
                                          &elements_per_thread_235683,
                                          &virt_num_groups_235684,
                                          &threads_per_segment_235686,
                                          &kernel_arg_238560,
                                          &kernel_arg_238561,
                                          &kernel_arg_238562,
                                          &kernel_arg_238563,
                                          &kernel_arg_238564,
                                          &kernel_arg_238565,
                                          &kernel_arg_238566,
                                          &kernel_arg_238567};
                                    int64_t time_start_238554 = 0,
                                            time_end_238555 = 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_223197",
                                                (long) num_groups_223191,
                                                (long) 1, (long) 1,
                                                (long) segred_group_sizze_223190,
                                                (long) 1, (long) 1, (int) (0 +
                                                                           (shared_sizze_238556 +
                                                                            (8 -
                                                                             shared_sizze_238556 %
                                                                             8) %
                                                                            8) +
                                                                           (shared_sizze_238558 +
                                                                            (8 -
                                                                             shared_sizze_238558 %
                                                                             8) %
                                                                            8)));
                                        time_start_238554 = get_wall_time();
                                    }
                                    
                                    cudaEvent_t *pevents = NULL;
                                    
                                    if (ctx->profiling &&
                                        !ctx->profiling_paused) {
                                        pevents = cuda_get_events(&ctx->cuda,
                                                                  &ctx->mainzisegred_large_223197_runs,
                                                                  &ctx->mainzisegred_large_223197_total_runtime);
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                           0));
                                    }
                                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_large_223197,
                                                                          grid[0],
                                                                          grid[1],
                                                                          grid[2],
                                                                          segred_group_sizze_223190,
                                                                          1, 1,
                                                                          0 +
                                                                          (shared_sizze_238556 +
                                                                           (8 -
                                                                            shared_sizze_238556 %
                                                                            8) %
                                                                           8) +
                                                                          (shared_sizze_238558 +
                                                                           (8 -
                                                                            shared_sizze_238558 %
                                                                            8) %
                                                                           8),
                                                                          NULL,
                                                                          kernel_args_238553,
                                                                          NULL));
                                    if (pevents != NULL)
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                           0));
                                    if (ctx->debugging) {
                                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                        time_end_238555 = get_wall_time();
                                        fprintf(ctx->log,
                                                "Kernel %s runtime: %ldus\n",
                                                "main.segred_large_223197",
                                                time_end_238555 -
                                                time_start_238554);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_unref_device(ctx,
                                                          &segred_tmp_mem_235687,
                                                          "segred_tmp_mem_235687") !=
                                    0)
                                    return 1;
                            }
                            
                            int64_t segmap_usable_groups_223232 =
                                    sdiv_up64(nest_sizze_210118,
                                              segmap_group_sizze_223231);
                            struct memblock_device mem_231032;
                            
                            mem_231032.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231032,
                                                      bytes_229427,
                                                      "mem_231032")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            
                            CUdeviceptr kernel_arg_238571 = mem_231027.mem;
                            CUdeviceptr kernel_arg_238572 = mem_231032.mem;
                            
                            if ((((((1 && segmap_usable_groups_223232 != 0) &&
                                    1 != 0) && 1 != 0) &&
                                  segmap_group_sizze_223231 != 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_223232;
                                grid[perm[1]] = 1;
                                grid[perm[2]] = 1;
                                
                                void *kernel_args_238568[] =
                                     {&ctx->global_failure,
                                      &partition_sizze_203577, &t_n_m_203650,
                                      &kernel_arg_238571, &kernel_arg_238572};
                                int64_t time_start_238569 = 0, time_end_238570 =
                                        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_223236",
                                            (long) segmap_usable_groups_223232,
                                            (long) 1, (long) 1,
                                            (long) segmap_group_sizze_223231,
                                            (long) 1, (long) 1, (int) 0);
                                    time_start_238569 = get_wall_time();
                                }
                                
                                cudaEvent_t *pevents = NULL;
                                
                                if (ctx->profiling && !ctx->profiling_paused) {
                                    pevents = cuda_get_events(&ctx->cuda,
                                                              &ctx->mainzisegmap_223236_runs,
                                                              &ctx->mainzisegmap_223236_total_runtime);
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                       0));
                                }
                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_223236,
                                                                      grid[0],
                                                                      grid[1],
                                                                      grid[2],
                                                                      segmap_group_sizze_223231,
                                                                      1, 1, 0,
                                                                      NULL,
                                                                      kernel_args_238568,
                                                                      NULL));
                                if (pevents != NULL)
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                       0));
                                if (ctx->debugging) {
                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                    time_end_238570 = get_wall_time();
                                    fprintf(ctx->log,
                                            "Kernel %s runtime: %ldus\n",
                                            "main.segmap_223236",
                                            time_end_238570 -
                                            time_start_238569);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx, &mem_231027,
                                                      "mem_231027") != 0)
                                return 1;
                            
                            struct memblock_device mem_231037;
                            
                            mem_231037.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231037,
                                                      bytes_229427,
                                                      "mem_231037")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (slt64(q_t_203494 * (int64_t) 2,
                                      segred_group_sizze_223242)) {
                                int64_t segment_sizze_nonzzero_235735 =
                                        smax64((int64_t) 1, q_t_203494);
                                int64_t num_threads_235736 = num_groups_223243 *
                                        segred_group_sizze_223242;
                                
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n",
                                            "\n# SegRed-small");
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "num_segments",
                                            (long long) (partition_sizze_203577 *
                                                         t_n_m_203650), '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segment_size",
                                            (long long) q_t_203494, '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segments_per_group",
                                            (long long) squot64(segred_group_sizze_223242,
                                                                segment_sizze_nonzzero_235735),
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "required_groups",
                                            (long long) sext_i64_i32(sdiv_up64(partition_sizze_203577 *
                                                                               t_n_m_203650,
                                                                               squot64(segred_group_sizze_223242,
                                                                                       segment_sizze_nonzzero_235735))),
                                            '\n');
                                
                                unsigned int shared_sizze_238576 = (int64_t) 8 *
                                             segred_group_sizze_223242;
                                CUdeviceptr kernel_arg_238578 =
                                            ext_mem_229196.mem;
                                CUdeviceptr kernel_arg_238579 =
                                            ext_mem_229197.mem;
                                CUdeviceptr kernel_arg_238580 =
                                            ext_mem_229460.mem;
                                CUdeviceptr kernel_arg_238581 =
                                            ext_mem_229461.mem;
                                CUdeviceptr kernel_arg_238582 = mem_231013.mem;
                                CUdeviceptr kernel_arg_238583 = mem_231017.mem;
                                CUdeviceptr kernel_arg_238584 = mem_231032.mem;
                                CUdeviceptr kernel_arg_238585 = mem_231037.mem;
                                unsigned int shared_offset_238577 = 0;
                                
                                if ((((((1 && num_groups_223243 != 0) && 1 !=
                                        0) && 1 != 0) &&
                                      segred_group_sizze_223242 != 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_223243;
                                    grid[perm[1]] = 1;
                                    grid[perm[2]] = 1;
                                    
                                    void *kernel_args_238573[] =
                                         {&ctx->global_failure,
                                          &shared_offset_238577, &n_203490,
                                          &q_t_203494, &jump_t_203500,
                                          &partition_sizze_203577,
                                          &t_n_m_203650, &i_203670,
                                          &num_groups_223243,
                                          &segment_sizze_nonzzero_235735,
                                          &kernel_arg_238578,
                                          &kernel_arg_238579,
                                          &kernel_arg_238580,
                                          &kernel_arg_238581,
                                          &kernel_arg_238582,
                                          &kernel_arg_238583,
                                          &kernel_arg_238584,
                                          &kernel_arg_238585};
                                    int64_t time_start_238574 = 0,
                                            time_end_238575 = 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_223249",
                                                (long) num_groups_223243,
                                                (long) 1, (long) 1,
                                                (long) segred_group_sizze_223242,
                                                (long) 1, (long) 1, (int) (0 +
                                                                           (shared_sizze_238576 +
                                                                            (8 -
                                                                             shared_sizze_238576 %
                                                                             8) %
                                                                            8)));
                                        time_start_238574 = get_wall_time();
                                    }
                                    
                                    cudaEvent_t *pevents = NULL;
                                    
                                    if (ctx->profiling &&
                                        !ctx->profiling_paused) {
                                        pevents = cuda_get_events(&ctx->cuda,
                                                                  &ctx->mainzisegred_small_223249_runs,
                                                                  &ctx->mainzisegred_small_223249_total_runtime);
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                           0));
                                    }
                                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_small_223249,
                                                                          grid[0],
                                                                          grid[1],
                                                                          grid[2],
                                                                          segred_group_sizze_223242,
                                                                          1, 1,
                                                                          0 +
                                                                          (shared_sizze_238576 +
                                                                           (8 -
                                                                            shared_sizze_238576 %
                                                                            8) %
                                                                           8),
                                                                          NULL,
                                                                          kernel_args_238573,
                                                                          NULL));
                                    if (pevents != NULL)
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                           0));
                                    if (ctx->debugging) {
                                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                        time_end_238575 = get_wall_time();
                                        fprintf(ctx->log,
                                                "Kernel %s runtime: %ldus\n",
                                                "main.segred_small_223249",
                                                time_end_238575 -
                                                time_start_238574);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                            } else {
                                int64_t groups_per_segment_235764 =
                                        sdiv_up64(num_groups_223243,
                                                  smax64((int64_t) 1,
                                                         partition_sizze_203577 *
                                                         t_n_m_203650));
                                int64_t elements_per_thread_235765 =
                                        sdiv_up64(q_t_203494,
                                                  segred_group_sizze_223242 *
                                                  groups_per_segment_235764);
                                int64_t virt_num_groups_235766 =
                                        groups_per_segment_235764 *
                                        (partition_sizze_203577 * t_n_m_203650);
                                int64_t num_threads_235767 = num_groups_223243 *
                                        segred_group_sizze_223242;
                                int64_t threads_per_segment_235768 =
                                        groups_per_segment_235764 *
                                        segred_group_sizze_223242;
                                
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n",
                                            "\n# SegRed-large");
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "num_segments",
                                            (long long) (partition_sizze_203577 *
                                                         t_n_m_203650), '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segment_size",
                                            (long long) q_t_203494, '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "virt_num_groups",
                                            (long long) virt_num_groups_235766,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "num_groups",
                                            (long long) num_groups_223243,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "group_size",
                                            (long long) segred_group_sizze_223242,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "elems_per_thread",
                                            (long long) elements_per_thread_235765,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "groups_per_segment",
                                            (long long) groups_per_segment_235764,
                                            '\n');
                                
                                struct memblock_device segred_tmp_mem_235769;
                                
                                segred_tmp_mem_235769.references = NULL;
                                if (memblock_alloc_device(ctx,
                                                          &segred_tmp_mem_235769,
                                                          (int64_t) 8 *
                                                          virt_num_groups_235766,
                                                          "segred_tmp_mem_235769")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mainzicounter_mem_235771
                                                       =
                                                       ctx->mainzicounter_mem_235771;
                                unsigned int shared_sizze_238590 = 1;
                                unsigned int shared_sizze_238592 = (int64_t) 8 *
                                             segred_group_sizze_223242;
                                CUdeviceptr kernel_arg_238594 =
                                            ext_mem_229196.mem;
                                CUdeviceptr kernel_arg_238595 =
                                            ext_mem_229197.mem;
                                CUdeviceptr kernel_arg_238596 =
                                            ext_mem_229460.mem;
                                CUdeviceptr kernel_arg_238597 =
                                            ext_mem_229461.mem;
                                CUdeviceptr kernel_arg_238598 = mem_231013.mem;
                                CUdeviceptr kernel_arg_238599 = mem_231017.mem;
                                CUdeviceptr kernel_arg_238600 = mem_231032.mem;
                                CUdeviceptr kernel_arg_238601 = mem_231037.mem;
                                CUdeviceptr kernel_arg_238602 =
                                            segred_tmp_mem_235769.mem;
                                CUdeviceptr kernel_arg_238603 =
                                            mainzicounter_mem_235771.mem;
                                unsigned int shared_offset_238591 = 0;
                                unsigned int shared_offset_238593 = 0 +
                                             (shared_sizze_238590 + (8 -
                                                                     shared_sizze_238590 %
                                                                     8) % 8);
                                
                                if ((((((1 && num_groups_223243 != 0) && 1 !=
                                        0) && 1 != 0) &&
                                      segred_group_sizze_223242 != 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_223243;
                                    grid[perm[1]] = 1;
                                    grid[perm[2]] = 1;
                                    
                                    void *kernel_args_238587[] =
                                         {&ctx->global_failure,
                                          &shared_offset_238591,
                                          &shared_offset_238593, &n_203490,
                                          &q_t_203494, &jump_t_203500,
                                          &partition_sizze_203577,
                                          &t_n_m_203650, &i_203670,
                                          &num_groups_223243,
                                          &groups_per_segment_235764,
                                          &elements_per_thread_235765,
                                          &virt_num_groups_235766,
                                          &threads_per_segment_235768,
                                          &kernel_arg_238594,
                                          &kernel_arg_238595,
                                          &kernel_arg_238596,
                                          &kernel_arg_238597,
                                          &kernel_arg_238598,
                                          &kernel_arg_238599,
                                          &kernel_arg_238600,
                                          &kernel_arg_238601,
                                          &kernel_arg_238602,
                                          &kernel_arg_238603};
                                    int64_t time_start_238588 = 0,
                                            time_end_238589 = 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_223249",
                                                (long) num_groups_223243,
                                                (long) 1, (long) 1,
                                                (long) segred_group_sizze_223242,
                                                (long) 1, (long) 1, (int) (0 +
                                                                           (shared_sizze_238590 +
                                                                            (8 -
                                                                             shared_sizze_238590 %
                                                                             8) %
                                                                            8) +
                                                                           (shared_sizze_238592 +
                                                                            (8 -
                                                                             shared_sizze_238592 %
                                                                             8) %
                                                                            8)));
                                        time_start_238588 = get_wall_time();
                                    }
                                    
                                    cudaEvent_t *pevents = NULL;
                                    
                                    if (ctx->profiling &&
                                        !ctx->profiling_paused) {
                                        pevents = cuda_get_events(&ctx->cuda,
                                                                  &ctx->mainzisegred_large_223249_runs,
                                                                  &ctx->mainzisegred_large_223249_total_runtime);
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                           0));
                                    }
                                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_large_223249,
                                                                          grid[0],
                                                                          grid[1],
                                                                          grid[2],
                                                                          segred_group_sizze_223242,
                                                                          1, 1,
                                                                          0 +
                                                                          (shared_sizze_238590 +
                                                                           (8 -
                                                                            shared_sizze_238590 %
                                                                            8) %
                                                                           8) +
                                                                          (shared_sizze_238592 +
                                                                           (8 -
                                                                            shared_sizze_238592 %
                                                                            8) %
                                                                           8),
                                                                          NULL,
                                                                          kernel_args_238587,
                                                                          NULL));
                                    if (pevents != NULL)
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                           0));
                                    if (ctx->debugging) {
                                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                        time_end_238589 = get_wall_time();
                                        fprintf(ctx->log,
                                                "Kernel %s runtime: %ldus\n",
                                                "main.segred_large_223249",
                                                time_end_238589 -
                                                time_start_238588);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_unref_device(ctx,
                                                          &segred_tmp_mem_235769,
                                                          "segred_tmp_mem_235769") !=
                                    0)
                                    return 1;
                            }
                            if (memblock_unref_device(ctx, &mem_231032,
                                                      "mem_231032") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_231038,
                                                    &mem_231037,
                                                    "mem_231037") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231037,
                                                      "mem_231037") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231032,
                                                      "mem_231032") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231027,
                                                      "mem_231027") != 0)
                                return 1;
                        }
                        if (memblock_unref_device(ctx, &mem_231013,
                                                  "mem_231013") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231017,
                                                  "mem_231017") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_231044,
                                                &ext_mem_231038,
                                                "ext_mem_231038") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231038,
                                                  "ext_mem_231038") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231017,
                                                  "mem_231017") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231013,
                                                  "mem_231013") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231008,
                                                  "mem_231008") != 0)
                            return 1;
                    }
                    if (memblock_set_device(ctx, &ext_mem_231402,
                                            &ext_mem_231044,
                                            "ext_mem_231044") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_231401, &mem_230924,
                                            "mem_230924") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231044,
                                              "ext_mem_231044") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230924, "mem_230924") !=
                        0)
                        return 1;
                } else {
                    bool match_lit_205943 = (int64_t) 1 == d_t_203497;
                    struct memblock_device ext_mem_231400;
                    
                    ext_mem_231400.references = NULL;
                    
                    struct memblock_device ext_mem_231399;
                    
                    ext_mem_231399.references = NULL;
                    if (match_lit_205943) {
                        bool suff_outer_par_223292;
                        
                        suff_outer_par_223292 =
                            *ctx->tuning_params.mainzisuff_outer_par_30 <=
                            partition_sizze_203577;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_30",
                                    (long) partition_sizze_203577,
                                    suff_outer_par_223292 ? "true" : "false");
                        
                        int64_t segmap_group_sizze_223417;
                        
                        segmap_group_sizze_223417 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_223296;
                        
                        int64_t num_groups_223418;
                        int32_t max_num_groups_235809;
                        
                        max_num_groups_235809 =
                            *ctx->tuning_params.mainzisegmap_num_groups_223298;
                        num_groups_223418 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(partition_sizze_203577,
                                                                                 segmap_group_sizze_223417),
                                                                       sext_i32_i64(max_num_groups_235809))));
                        
                        int64_t segmap_group_sizze_224068;
                        
                        segmap_group_sizze_224068 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_224042;
                        
                        int64_t segmap_group_sizze_224084;
                        
                        segmap_group_sizze_224084 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_223986;
                        
                        int64_t segmap_group_sizze_224109;
                        
                        segmap_group_sizze_224109 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_223544;
                        
                        bool suff_outer_par_224113;
                        
                        suff_outer_par_224113 =
                            *ctx->tuning_params.mainzisuff_outer_par_31 <=
                            nest_sizze_210118;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_31",
                                    (long) nest_sizze_210118,
                                    suff_outer_par_224113 ? "true" : "false");
                        
                        int64_t nest_sizze_224225 = q_t_203494 *
                                nest_sizze_210118;
                        int64_t segred_group_sizze_224226;
                        
                        segred_group_sizze_224226 =
                            *ctx->tuning_params.mainzisegred_group_sizze_223755;
                        
                        int64_t num_groups_224227;
                        int32_t max_num_groups_235810;
                        
                        max_num_groups_235810 =
                            *ctx->tuning_params.mainzisegred_num_groups_223757;
                        num_groups_224227 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(nest_sizze_224225,
                                                                                 segred_group_sizze_224226),
                                                                       sext_i32_i64(max_num_groups_235810))));
                        
                        int64_t segmap_group_sizze_224277;
                        
                        segmap_group_sizze_224277 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_223733;
                        
                        int64_t segred_group_sizze_224299;
                        
                        segred_group_sizze_224299 =
                            *ctx->tuning_params.mainzisegred_group_sizze_223658;
                        
                        int64_t num_groups_224300;
                        int32_t max_num_groups_235811;
                        
                        max_num_groups_235811 =
                            *ctx->tuning_params.mainzisegred_num_groups_223660;
                        num_groups_224300 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(nest_sizze_224225,
                                                                                 segred_group_sizze_224299),
                                                                       sext_i32_i64(max_num_groups_235811))));
                        
                        int64_t maxSubHelper_232043 = umax64(bytes_229169,
                                                             bytes_229420);
                        int64_t num_threads_232192 = segmap_group_sizze_223417 *
                                num_groups_223418;
                        int64_t total_sizze_232193 = maxSubHelper_232043 *
                                num_threads_232192;
                        int64_t total_sizze_232194 = bytes_229420 *
                                num_threads_232192;
                        int64_t total_sizze_232195 = bytes_229169 *
                                num_threads_232192;
                        int64_t total_sizze_232196 = bytes_229169 *
                                num_threads_232192;
                        struct memblock_device ext_mem_231213;
                        
                        ext_mem_231213.references = NULL;
                        
                        struct memblock_device ext_mem_231212;
                        
                        ext_mem_231212.references = NULL;
                        
                        int32_t local_memory_capacity_236081;
                        
                        local_memory_capacity_236081 =
                            ctx->cuda.max_shared_memory;
                        if ((sle64((int64_t) 0,
                                   sext_i32_i64(local_memory_capacity_236081)) &&
                             sle64((int64_t) 0,
                                   sext_i32_i64(local_memory_capacity_236081))) &&
                            suff_outer_par_223292) {
                            struct memblock_device mem_231047;
                            
                            mem_231047.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231047,
                                                      binop_y_229176,
                                                      "mem_231047")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_231047,
                                                                      (int64_t) 0,
                                                                      mem_230920,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_203490,
                                                                      partition_sizze_203577) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_231047,
                                                          "mem_231047") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231212,
                                                          "ext_mem_231212") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231213,
                                                          "ext_mem_231213") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231399,
                                                          "ext_mem_231399") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231400,
                                                          "ext_mem_231400") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231401,
                                                          "ext_mem_231401") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231402,
                                                          "ext_mem_231402") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231504,
                                                          "ext_mem_231504") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231505,
                                                          "ext_mem_231505") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230920,
                                                          "mem_230920") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230914,
                                                          "ext_mem_230914") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230907,
                                                          "ext_mem_230907") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230908,
                                                          "ext_mem_230908") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230546,
                                                          "ext_mem_230546") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230529,
                                                          "ext_mem_230529") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230512,
                                                          "ext_mem_230512") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230494,
                                                          "ext_mem_230494") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231050;
                            
                            mem_231050.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231050,
                                                      binop_y_229176,
                                                      "mem_231050")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_231050,
                                                                      (int64_t) 0,
                                                                      ext_mem_229197,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_203490,
                                                                      partition_sizze_203577) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_231050,
                                                          "mem_231050") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231047,
                                                          "mem_231047") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231212,
                                                          "ext_mem_231212") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231213,
                                                          "ext_mem_231213") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231399,
                                                          "ext_mem_231399") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231400,
                                                          "ext_mem_231400") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231401,
                                                          "ext_mem_231401") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231402,
                                                          "ext_mem_231402") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231504,
                                                          "ext_mem_231504") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231505,
                                                          "ext_mem_231505") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230920,
                                                          "mem_230920") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230914,
                                                          "ext_mem_230914") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230907,
                                                          "ext_mem_230907") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230908,
                                                          "ext_mem_230908") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230546,
                                                          "ext_mem_230546") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230529,
                                                          "ext_mem_230529") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230512,
                                                          "ext_mem_230512") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230494,
                                                          "ext_mem_230494") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231053;
                            
                            mem_231053.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231053,
                                                      binop_y_229426,
                                                      "mem_231053")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_231053,
                                                                      (int64_t) 0,
                                                                      ext_mem_229461,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      t_n_m_203650,
                                                                      partition_sizze_203577) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_231053,
                                                          "mem_231053") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231050,
                                                          "mem_231050") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231047,
                                                          "mem_231047") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231212,
                                                          "ext_mem_231212") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231213,
                                                          "ext_mem_231213") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231399,
                                                          "ext_mem_231399") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231400,
                                                          "ext_mem_231400") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231401,
                                                          "ext_mem_231401") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231402,
                                                          "ext_mem_231402") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231504,
                                                          "ext_mem_231504") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231505,
                                                          "ext_mem_231505") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230920,
                                                          "mem_230920") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230914,
                                                          "ext_mem_230914") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230907,
                                                          "ext_mem_230907") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230908,
                                                          "ext_mem_230908") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230546,
                                                          "ext_mem_230546") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230529,
                                                          "ext_mem_230529") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230512,
                                                          "ext_mem_230512") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230494,
                                                          "ext_mem_230494") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231056;
                            
                            mem_231056.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231056,
                                                      binop_y_229426,
                                                      "mem_231056")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_231056,
                                                                      (int64_t) 0,
                                                                      ext_mem_229460,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      t_n_m_203650,
                                                                      partition_sizze_203577) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_231056,
                                                          "mem_231056") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231053,
                                                          "mem_231053") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231050,
                                                          "mem_231050") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231047,
                                                          "mem_231047") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231212,
                                                          "ext_mem_231212") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231213,
                                                          "ext_mem_231213") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231399,
                                                          "ext_mem_231399") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231400,
                                                          "ext_mem_231400") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231401,
                                                          "ext_mem_231401") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231402,
                                                          "ext_mem_231402") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231504,
                                                          "ext_mem_231504") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231505,
                                                          "ext_mem_231505") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230920,
                                                          "mem_230920") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230914,
                                                          "ext_mem_230914") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230907,
                                                          "ext_mem_230907") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230908,
                                                          "ext_mem_230908") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230546,
                                                          "ext_mem_230546") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230529,
                                                          "ext_mem_230529") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230512,
                                                          "ext_mem_230512") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230494,
                                                          "ext_mem_230494") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231059;
                            
                            mem_231059.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231059,
                                                      binop_y_229176,
                                                      "mem_231059")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            int64_t group_sizze_235815;
                            
                            group_sizze_235815 =
                                *ctx->tuning_params.mainzigroup_sizze_235815;
                            
                            int64_t num_groups_235816 =
                                    sdiv_up64(partition_sizze_203577 * n_203490,
                                              group_sizze_235815);
                            CUdeviceptr kernel_arg_238607 =
                                        mem_param_229493.mem;
                            CUdeviceptr kernel_arg_238608 = mem_231059.mem;
                            
                            if ((((((1 && num_groups_235816 != 0) && 1 != 0) &&
                                   1 != 0) && group_sizze_235815 != 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_235816;
                                grid[perm[1]] = 1;
                                grid[perm[2]] = 1;
                                
                                void *kernel_args_238604[] = {&n_203490,
                                                              &partition_sizze_203577,
                                                              &ctx_param_ext_229488,
                                                              &ctx_param_ext_229489,
                                                              &ctx_param_ext_229491,
                                                              &kernel_arg_238607,
                                                              &kernel_arg_238608};
                                int64_t time_start_238605 = 0, time_end_238606 =
                                        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_235812",
                                            (long) num_groups_235816, (long) 1,
                                            (long) 1, (long) group_sizze_235815,
                                            (long) 1, (long) 1, (int) 0);
                                    time_start_238605 = get_wall_time();
                                }
                                
                                cudaEvent_t *pevents = NULL;
                                
                                if (ctx->profiling && !ctx->profiling_paused) {
                                    pevents = cuda_get_events(&ctx->cuda,
                                                              &ctx->mainzicopy_235812_runs,
                                                              &ctx->mainzicopy_235812_total_runtime);
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                       0));
                                }
                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzicopy_235812,
                                                                      grid[0],
                                                                      grid[1],
                                                                      grid[2],
                                                                      group_sizze_235815,
                                                                      1, 1, 0,
                                                                      NULL,
                                                                      kernel_args_238604,
                                                                      NULL));
                                if (pevents != NULL)
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                       0));
                                if (ctx->debugging) {
                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                    time_end_238606 = get_wall_time();
                                    fprintf(ctx->log,
                                            "Kernel %s runtime: %ldus\n",
                                            "main.copy_235812",
                                            time_end_238606 -
                                            time_start_238605);
                                }
                            }
                            
                            struct memblock_device mem_231138;
                            
                            mem_231138.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231138,
                                                      binop_y_229426,
                                                      "mem_231138")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231141;
                            
                            mem_231141.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231141,
                                                      binop_y_229426,
                                                      "mem_231141")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232044;
                            
                            color_232044.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232044,
                                                      total_sizze_232193,
                                                      "color_232044")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232045;
                            
                            color_232045.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232045,
                                                      total_sizze_232194,
                                                      "color_232045")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232046;
                            
                            color_232046.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232046,
                                                      total_sizze_232195,
                                                      "color_232046")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232047;
                            
                            color_232047.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232047,
                                                      total_sizze_232196,
                                                      "color_232047")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            
                            CUdeviceptr kernel_arg_238612 = mem_229161.mem;
                            CUdeviceptr kernel_arg_238613 = ext_mem_229196.mem;
                            CUdeviceptr kernel_arg_238614 = mem_231047.mem;
                            CUdeviceptr kernel_arg_238615 = mem_231050.mem;
                            CUdeviceptr kernel_arg_238616 = mem_231053.mem;
                            CUdeviceptr kernel_arg_238617 = mem_231056.mem;
                            CUdeviceptr kernel_arg_238618 = mem_231059.mem;
                            CUdeviceptr kernel_arg_238619 = mem_231138.mem;
                            CUdeviceptr kernel_arg_238620 = mem_231141.mem;
                            CUdeviceptr kernel_arg_238621 = color_232044.mem;
                            CUdeviceptr kernel_arg_238622 = color_232045.mem;
                            CUdeviceptr kernel_arg_238623 = color_232046.mem;
                            CUdeviceptr kernel_arg_238624 = color_232047.mem;
                            
                            if ((((((1 && num_groups_223418 != 0) && 1 != 0) &&
                                   1 != 0) && segmap_group_sizze_223417 != 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_223418;
                                grid[perm[1]] = 1;
                                grid[perm[2]] = 1;
                                
                                void *kernel_args_238609[] =
                                     {&ctx->global_failure,
                                      &ctx->failure_is_an_option,
                                      &ctx->global_failure_args, &n_203490,
                                      &q_t_203494, &jump_t_203500,
                                      &partition_sizze_203577, &t_n_m_203650,
                                      &i_203670, &num_groups_223418,
                                      &num_threads_232192, &kernel_arg_238612,
                                      &kernel_arg_238613, &kernel_arg_238614,
                                      &kernel_arg_238615, &kernel_arg_238616,
                                      &kernel_arg_238617, &kernel_arg_238618,
                                      &kernel_arg_238619, &kernel_arg_238620,
                                      &kernel_arg_238621, &kernel_arg_238622,
                                      &kernel_arg_238623, &kernel_arg_238624};
                                int64_t time_start_238610 = 0, time_end_238611 =
                                        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_223423",
                                            (long) num_groups_223418, (long) 1,
                                            (long) 1,
                                            (long) segmap_group_sizze_223417,
                                            (long) 1, (long) 1, (int) 0);
                                    time_start_238610 = get_wall_time();
                                }
                                
                                cudaEvent_t *pevents = NULL;
                                
                                if (ctx->profiling && !ctx->profiling_paused) {
                                    pevents = cuda_get_events(&ctx->cuda,
                                                              &ctx->mainzisegmap_223423_runs,
                                                              &ctx->mainzisegmap_223423_total_runtime);
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                       0));
                                }
                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_223423,
                                                                      grid[0],
                                                                      grid[1],
                                                                      grid[2],
                                                                      segmap_group_sizze_223417,
                                                                      1, 1, 0,
                                                                      NULL,
                                                                      kernel_args_238609,
                                                                      NULL));
                                if (pevents != NULL)
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                       0));
                                if (ctx->debugging) {
                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                    time_end_238611 = get_wall_time();
                                    fprintf(ctx->log,
                                            "Kernel %s runtime: %ldus\n",
                                            "main.segmap_223423",
                                            time_end_238611 -
                                            time_start_238610);
                                }
                            }
                            ctx->failure_is_an_option = 1;
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx, &mem_231047,
                                                      "mem_231047") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231050,
                                                      "mem_231050") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231053,
                                                      "mem_231053") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231056,
                                                      "mem_231056") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231059,
                                                      "mem_231059") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232044,
                                                      "color_232044") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232045,
                                                      "color_232045") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232046,
                                                      "color_232046") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232047,
                                                      "color_232047") != 0)
                                return 1;
                            
                            struct memblock_device mem_231205;
                            
                            mem_231205.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231205,
                                                      bytes_229427,
                                                      "mem_231205")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_231205,
                                                                      (int64_t) 0,
                                                                      mem_231138,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      partition_sizze_203577,
                                                                      t_n_m_203650) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_231205,
                                                          "mem_231205") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232047,
                                                          "color_232047") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232046,
                                                          "color_232046") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232045,
                                                          "color_232045") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232044,
                                                          "color_232044") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231141,
                                                          "mem_231141") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231138,
                                                          "mem_231138") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231059,
                                                          "mem_231059") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231056,
                                                          "mem_231056") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231053,
                                                          "mem_231053") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231050,
                                                          "mem_231050") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231047,
                                                          "mem_231047") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231212,
                                                          "ext_mem_231212") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231213,
                                                          "ext_mem_231213") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231399,
                                                          "ext_mem_231399") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231400,
                                                          "ext_mem_231400") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231401,
                                                          "ext_mem_231401") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231402,
                                                          "ext_mem_231402") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231504,
                                                          "ext_mem_231504") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231505,
                                                          "ext_mem_231505") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230920,
                                                          "mem_230920") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230914,
                                                          "ext_mem_230914") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230907,
                                                          "ext_mem_230907") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230908,
                                                          "ext_mem_230908") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230546,
                                                          "ext_mem_230546") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230529,
                                                          "ext_mem_230529") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230512,
                                                          "ext_mem_230512") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230494,
                                                          "ext_mem_230494") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_231138,
                                                      "mem_231138") != 0)
                                return 1;
                            
                            struct memblock_device mem_231210;
                            
                            mem_231210.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231210,
                                                      bytes_229427,
                                                      "mem_231210")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_231210,
                                                                      (int64_t) 0,
                                                                      mem_231141,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      partition_sizze_203577,
                                                                      t_n_m_203650) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_231210,
                                                          "mem_231210") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231205,
                                                          "mem_231205") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232047,
                                                          "color_232047") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232046,
                                                          "color_232046") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232045,
                                                          "color_232045") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232044,
                                                          "color_232044") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231141,
                                                          "mem_231141") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231138,
                                                          "mem_231138") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231059,
                                                          "mem_231059") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231056,
                                                          "mem_231056") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231053,
                                                          "mem_231053") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231050,
                                                          "mem_231050") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231047,
                                                          "mem_231047") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231212,
                                                          "ext_mem_231212") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231213,
                                                          "ext_mem_231213") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231399,
                                                          "ext_mem_231399") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231400,
                                                          "ext_mem_231400") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231401,
                                                          "ext_mem_231401") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231402,
                                                          "ext_mem_231402") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231504,
                                                          "ext_mem_231504") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231505,
                                                          "ext_mem_231505") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230920,
                                                          "mem_230920") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230914,
                                                          "ext_mem_230914") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230907,
                                                          "ext_mem_230907") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230908,
                                                          "ext_mem_230908") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230546,
                                                          "ext_mem_230546") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230529,
                                                          "ext_mem_230529") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230512,
                                                          "ext_mem_230512") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230494,
                                                          "ext_mem_230494") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_231141,
                                                      "mem_231141") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_231213,
                                                    &mem_231205,
                                                    "mem_231205") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_231212,
                                                    &mem_231210,
                                                    "mem_231210") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231210,
                                                      "mem_231210") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231205,
                                                      "mem_231205") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232047,
                                                      "color_232047") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232046,
                                                      "color_232046") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232045,
                                                      "color_232045") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232044,
                                                      "color_232044") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231141,
                                                      "mem_231141") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231138,
                                                      "mem_231138") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231059,
                                                      "mem_231059") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231056,
                                                      "mem_231056") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231053,
                                                      "mem_231053") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231050,
                                                      "mem_231050") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231047,
                                                      "mem_231047") != 0)
                                return 1;
                        } else {
                            int64_t segmap_usable_groups_224069 =
                                    sdiv_up64(nest_sizze_207000,
                                              segmap_group_sizze_224068);
                            struct memblock_device mem_231146;
                            
                            mem_231146.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231146,
                                                      bytes_229177,
                                                      "mem_231146")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            
                            CUdeviceptr kernel_arg_238628 = mem_229161.mem;
                            CUdeviceptr kernel_arg_238629 = mem_230920.mem;
                            CUdeviceptr kernel_arg_238630 = mem_231146.mem;
                            
                            if ((((((1 && segmap_usable_groups_224069 != 0) &&
                                    1 != 0) && 1 != 0) &&
                                  segmap_group_sizze_224068 != 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_224069;
                                grid[perm[1]] = 1;
                                grid[perm[2]] = 1;
                                
                                void *kernel_args_238625[] =
                                     {&ctx->global_failure, &n_203490,
                                      &partition_sizze_203577,
                                      &kernel_arg_238628, &kernel_arg_238629,
                                      &kernel_arg_238630};
                                int64_t time_start_238626 = 0, time_end_238627 =
                                        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_224073",
                                            (long) segmap_usable_groups_224069,
                                            (long) 1, (long) 1,
                                            (long) segmap_group_sizze_224068,
                                            (long) 1, (long) 1, (int) 0);
                                    time_start_238626 = get_wall_time();
                                }
                                
                                cudaEvent_t *pevents = NULL;
                                
                                if (ctx->profiling && !ctx->profiling_paused) {
                                    pevents = cuda_get_events(&ctx->cuda,
                                                              &ctx->mainzisegmap_224073_runs,
                                                              &ctx->mainzisegmap_224073_total_runtime);
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                       0));
                                }
                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_224073,
                                                                      grid[0],
                                                                      grid[1],
                                                                      grid[2],
                                                                      segmap_group_sizze_224068,
                                                                      1, 1, 0,
                                                                      NULL,
                                                                      kernel_args_238625,
                                                                      NULL));
                                if (pevents != NULL)
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                       0));
                                if (ctx->debugging) {
                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                    time_end_238627 = get_wall_time();
                                    fprintf(ctx->log,
                                            "Kernel %s runtime: %ldus\n",
                                            "main.segmap_224073",
                                            time_end_238627 -
                                            time_start_238626);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            
                            int64_t segmap_usable_groups_224085 =
                                    sdiv_up64(nest_sizze_207000,
                                              segmap_group_sizze_224084);
                            struct memblock_device mem_231151;
                            
                            mem_231151.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231151,
                                                      bytes_229177,
                                                      "mem_231151")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231155;
                            
                            mem_231155.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231155,
                                                      bytes_229177,
                                                      "mem_231155")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            
                            CUdeviceptr kernel_arg_238634 = ext_mem_229197.mem;
                            CUdeviceptr kernel_arg_238635 =
                                        mem_param_229493.mem;
                            CUdeviceptr kernel_arg_238636 = mem_231146.mem;
                            CUdeviceptr kernel_arg_238637 = mem_231151.mem;
                            CUdeviceptr kernel_arg_238638 = mem_231155.mem;
                            
                            if ((((((1 && segmap_usable_groups_224085 != 0) &&
                                    1 != 0) && 1 != 0) &&
                                  segmap_group_sizze_224084 != 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_224085;
                                grid[perm[1]] = 1;
                                grid[perm[2]] = 1;
                                
                                void *kernel_args_238631[] =
                                     {&ctx->global_failure,
                                      &ctx->failure_is_an_option,
                                      &ctx->global_failure_args, &n_203490,
                                      &partition_sizze_203577,
                                      &ctx_param_ext_229488,
                                      &ctx_param_ext_229489,
                                      &ctx_param_ext_229491, &kernel_arg_238634,
                                      &kernel_arg_238635, &kernel_arg_238636,
                                      &kernel_arg_238637, &kernel_arg_238638};
                                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_224090",
                                            (long) segmap_usable_groups_224085,
                                            (long) 1, (long) 1,
                                            (long) segmap_group_sizze_224084,
                                            (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_224090_runs,
                                                              &ctx->mainzisegmap_224090_total_runtime);
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                       0));
                                }
                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_224090,
                                                                      grid[0],
                                                                      grid[1],
                                                                      grid[2],
                                                                      segmap_group_sizze_224084,
                                                                      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_224090",
                                            time_end_238633 -
                                            time_start_238632);
                                }
                            }
                            ctx->failure_is_an_option = 1;
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx, &mem_231146,
                                                      "mem_231146") != 0)
                                return 1;
                            
                            int64_t segmap_usable_groups_224110 =
                                    sdiv_up64(nest_sizze_210118,
                                              segmap_group_sizze_224109);
                            struct memblock_device ext_mem_231201;
                            
                            ext_mem_231201.references = NULL;
                            
                            struct memblock_device ext_mem_231200;
                            
                            ext_mem_231200.references = NULL;
                            
                            int32_t local_memory_capacity_236080;
                            
                            local_memory_capacity_236080 =
                                ctx->cuda.max_shared_memory;
                            if (sle64((int64_t) 0,
                                      sext_i32_i64(local_memory_capacity_236080)) &&
                                suff_outer_par_224113) {
                                struct memblock_device mem_231160;
                                
                                mem_231160.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231160,
                                                          bytes_229427,
                                                          "mem_231160")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231164;
                                
                                mem_231164.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231164,
                                                          bytes_229427,
                                                          "mem_231164")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                                
                                CUdeviceptr kernel_arg_238642 =
                                            ext_mem_229196.mem;
                                CUdeviceptr kernel_arg_238643 =
                                            ext_mem_229197.mem;
                                CUdeviceptr kernel_arg_238644 =
                                            ext_mem_229460.mem;
                                CUdeviceptr kernel_arg_238645 =
                                            ext_mem_229461.mem;
                                CUdeviceptr kernel_arg_238646 = mem_231151.mem;
                                CUdeviceptr kernel_arg_238647 = mem_231155.mem;
                                CUdeviceptr kernel_arg_238648 = mem_231160.mem;
                                CUdeviceptr kernel_arg_238649 = mem_231164.mem;
                                
                                if ((((((1 && segmap_usable_groups_224110 !=
                                         0) && 1 != 0) && 1 != 0) &&
                                      segmap_group_sizze_224109 != 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_224110;
                                    grid[perm[1]] = 1;
                                    grid[perm[2]] = 1;
                                    
                                    void *kernel_args_238639[] =
                                         {&ctx->global_failure, &n_203490,
                                          &q_t_203494, &jump_t_203500,
                                          &partition_sizze_203577,
                                          &t_n_m_203650, &i_203670,
                                          &kernel_arg_238642,
                                          &kernel_arg_238643,
                                          &kernel_arg_238644,
                                          &kernel_arg_238645,
                                          &kernel_arg_238646,
                                          &kernel_arg_238647,
                                          &kernel_arg_238648,
                                          &kernel_arg_238649};
                                    int64_t time_start_238640 = 0,
                                            time_end_238641 = 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_224120",
                                                (long) segmap_usable_groups_224110,
                                                (long) 1, (long) 1,
                                                (long) segmap_group_sizze_224109,
                                                (long) 1, (long) 1, (int) 0);
                                        time_start_238640 = get_wall_time();
                                    }
                                    
                                    cudaEvent_t *pevents = NULL;
                                    
                                    if (ctx->profiling &&
                                        !ctx->profiling_paused) {
                                        pevents = cuda_get_events(&ctx->cuda,
                                                                  &ctx->mainzisegmap_224120_runs,
                                                                  &ctx->mainzisegmap_224120_total_runtime);
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                           0));
                                    }
                                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_224120,
                                                                          grid[0],
                                                                          grid[1],
                                                                          grid[2],
                                                                          segmap_group_sizze_224109,
                                                                          1, 1,
                                                                          0,
                                                                          NULL,
                                                                          kernel_args_238639,
                                                                          NULL));
                                    if (pevents != NULL)
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                           0));
                                    if (ctx->debugging) {
                                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                        time_end_238641 = get_wall_time();
                                        fprintf(ctx->log,
                                                "Kernel %s runtime: %ldus\n",
                                                "main.segmap_224120",
                                                time_end_238641 -
                                                time_start_238640);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_set_device(ctx, &ext_mem_231201,
                                                        &mem_231160,
                                                        "mem_231160") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_231200,
                                                        &mem_231164,
                                                        "mem_231164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231164,
                                                          "mem_231164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231160,
                                                          "mem_231160") != 0)
                                    return 1;
                            } else {
                                struct memblock_device mem_231169;
                                
                                mem_231169.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231169,
                                                          bytes_229427,
                                                          "mem_231169")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231173;
                                
                                mem_231173.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231173,
                                                          bytes_229427,
                                                          "mem_231173")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231177;
                                
                                mem_231177.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231177,
                                                          bytes_229427,
                                                          "mem_231177")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (slt64(q_t_203494 * (int64_t) 2,
                                          segred_group_sizze_224226)) {
                                    int64_t segment_sizze_nonzzero_235884 =
                                            smax64((int64_t) 1, q_t_203494);
                                    int64_t num_threads_235885 =
                                            num_groups_224227 *
                                            segred_group_sizze_224226;
                                    
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n",
                                                "\n# SegRed-small");
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_segments",
                                                (long long) (partition_sizze_203577 *
                                                             t_n_m_203650),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_t_203494, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segments_per_group",
                                                (long long) squot64(segred_group_sizze_224226,
                                                                    segment_sizze_nonzzero_235884),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "required_groups",
                                                (long long) sext_i64_i32(sdiv_up64(partition_sizze_203577 *
                                                                                   t_n_m_203650,
                                                                                   squot64(segred_group_sizze_224226,
                                                                                           segment_sizze_nonzzero_235884))),
                                                '\n');
                                    
                                    unsigned int shared_sizze_238653 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_224226;
                                    unsigned int shared_sizze_238655 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_224226;
                                    unsigned int shared_sizze_238657 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_224226;
                                    CUdeviceptr kernel_arg_238659 =
                                                ext_mem_229196.mem;
                                    CUdeviceptr kernel_arg_238660 =
                                                ext_mem_229197.mem;
                                    CUdeviceptr kernel_arg_238661 =
                                                ext_mem_229460.mem;
                                    CUdeviceptr kernel_arg_238662 =
                                                ext_mem_229461.mem;
                                    CUdeviceptr kernel_arg_238663 =
                                                mem_231151.mem;
                                    CUdeviceptr kernel_arg_238664 =
                                                mem_231169.mem;
                                    CUdeviceptr kernel_arg_238665 =
                                                mem_231173.mem;
                                    CUdeviceptr kernel_arg_238666 =
                                                mem_231177.mem;
                                    unsigned int shared_offset_238654 = 0;
                                    unsigned int shared_offset_238656 = 0 +
                                                 (shared_sizze_238653 + (8 -
                                                                         shared_sizze_238653 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_238658 = 0 +
                                                 (shared_sizze_238653 + (8 -
                                                                         shared_sizze_238653 %
                                                                         8) %
                                                  8) + (shared_sizze_238655 +
                                                        (8 -
                                                         shared_sizze_238655 %
                                                         8) % 8);
                                    
                                    if ((((((1 && num_groups_224227 != 0) &&
                                            1 != 0) && 1 != 0) &&
                                          segred_group_sizze_224226 != 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_224227;
                                        grid[perm[1]] = 1;
                                        grid[perm[2]] = 1;
                                        
                                        void *kernel_args_238650[] =
                                             {&ctx->global_failure,
                                              &shared_offset_238654,
                                              &shared_offset_238656,
                                              &shared_offset_238658, &n_203490,
                                              &q_t_203494, &jump_t_203500,
                                              &partition_sizze_203577,
                                              &t_n_m_203650, &i_203670,
                                              &num_groups_224227,
                                              &segment_sizze_nonzzero_235884,
                                              &kernel_arg_238659,
                                              &kernel_arg_238660,
                                              &kernel_arg_238661,
                                              &kernel_arg_238662,
                                              &kernel_arg_238663,
                                              &kernel_arg_238664,
                                              &kernel_arg_238665,
                                              &kernel_arg_238666};
                                        int64_t time_start_238651 = 0,
                                                time_end_238652 = 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_224235",
                                                    (long) num_groups_224227,
                                                    (long) 1, (long) 1,
                                                    (long) segred_group_sizze_224226,
                                                    (long) 1, (long) 1,
                                                    (int) (0 +
                                                           (shared_sizze_238653 +
                                                            (8 -
                                                             shared_sizze_238653 %
                                                             8) % 8) +
                                                           (shared_sizze_238655 +
                                                            (8 -
                                                             shared_sizze_238655 %
                                                             8) % 8) +
                                                           (shared_sizze_238657 +
                                                            (8 -
                                                             shared_sizze_238657 %
                                                             8) % 8)));
                                            time_start_238651 = get_wall_time();
                                        }
                                        
                                        cudaEvent_t *pevents = NULL;
                                        
                                        if (ctx->profiling &&
                                            !ctx->profiling_paused) {
                                            pevents =
                                                cuda_get_events(&ctx->cuda,
                                                                &ctx->mainzisegred_small_224235_runs,
                                                                &ctx->mainzisegred_small_224235_total_runtime);
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                               0));
                                        }
                                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_small_224235,
                                                                              grid[0],
                                                                              grid[1],
                                                                              grid[2],
                                                                              segred_group_sizze_224226,
                                                                              1,
                                                                              1,
                                                                              0 +
                                                                              (shared_sizze_238653 +
                                                                               (8 -
                                                                                shared_sizze_238653 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238655 +
                                                                               (8 -
                                                                                shared_sizze_238655 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238657 +
                                                                               (8 -
                                                                                shared_sizze_238657 %
                                                                                8) %
                                                                               8),
                                                                              NULL,
                                                                              kernel_args_238650,
                                                                              NULL));
                                        if (pevents != NULL)
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                               0));
                                        if (ctx->debugging) {
                                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                            time_end_238652 = get_wall_time();
                                            fprintf(ctx->log,
                                                    "Kernel %s runtime: %ldus\n",
                                                    "main.segred_small_224235",
                                                    time_end_238652 -
                                                    time_start_238651);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                } else {
                                    int64_t groups_per_segment_235925 =
                                            sdiv_up64(num_groups_224227,
                                                      smax64((int64_t) 1,
                                                             partition_sizze_203577 *
                                                             t_n_m_203650));
                                    int64_t elements_per_thread_235926 =
                                            sdiv_up64(q_t_203494,
                                                      segred_group_sizze_224226 *
                                                      groups_per_segment_235925);
                                    int64_t virt_num_groups_235927 =
                                            groups_per_segment_235925 *
                                            (partition_sizze_203577 *
                                             t_n_m_203650);
                                    int64_t num_threads_235928 =
                                            num_groups_224227 *
                                            segred_group_sizze_224226;
                                    int64_t threads_per_segment_235929 =
                                            groups_per_segment_235925 *
                                            segred_group_sizze_224226;
                                    
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n",
                                                "\n# SegRed-large");
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_segments",
                                                (long long) (partition_sizze_203577 *
                                                             t_n_m_203650),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_t_203494, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "virt_num_groups",
                                                (long long) virt_num_groups_235927,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_groups",
                                                (long long) num_groups_224227,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "group_size",
                                                (long long) segred_group_sizze_224226,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "elems_per_thread",
                                                (long long) elements_per_thread_235926,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "groups_per_segment",
                                                (long long) groups_per_segment_235925,
                                                '\n');
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235930;
                                    
                                    segred_tmp_mem_235930.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235930,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235927,
                                                              "segred_tmp_mem_235930")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235932;
                                    
                                    segred_tmp_mem_235932.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235932,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235927,
                                                              "segred_tmp_mem_235932")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235934;
                                    
                                    segred_tmp_mem_235934.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235934,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235927,
                                                              "segred_tmp_mem_235934")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    mainzicounter_mem_235936 =
                                    ctx->mainzicounter_mem_235936;
                                    unsigned int shared_sizze_238671 = 1;
                                    unsigned int shared_sizze_238673 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_224226;
                                    unsigned int shared_sizze_238675 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_224226;
                                    unsigned int shared_sizze_238677 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_224226;
                                    CUdeviceptr kernel_arg_238679 =
                                                ext_mem_229196.mem;
                                    CUdeviceptr kernel_arg_238680 =
                                                ext_mem_229197.mem;
                                    CUdeviceptr kernel_arg_238681 =
                                                ext_mem_229460.mem;
                                    CUdeviceptr kernel_arg_238682 =
                                                ext_mem_229461.mem;
                                    CUdeviceptr kernel_arg_238683 =
                                                mem_231151.mem;
                                    CUdeviceptr kernel_arg_238684 =
                                                mem_231169.mem;
                                    CUdeviceptr kernel_arg_238685 =
                                                mem_231173.mem;
                                    CUdeviceptr kernel_arg_238686 =
                                                mem_231177.mem;
                                    CUdeviceptr kernel_arg_238687 =
                                                segred_tmp_mem_235930.mem;
                                    CUdeviceptr kernel_arg_238688 =
                                                segred_tmp_mem_235932.mem;
                                    CUdeviceptr kernel_arg_238689 =
                                                segred_tmp_mem_235934.mem;
                                    CUdeviceptr kernel_arg_238690 =
                                                mainzicounter_mem_235936.mem;
                                    unsigned int shared_offset_238672 = 0;
                                    unsigned int shared_offset_238674 = 0 +
                                                 (shared_sizze_238671 + (8 -
                                                                         shared_sizze_238671 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_238676 = 0 +
                                                 (shared_sizze_238671 + (8 -
                                                                         shared_sizze_238671 %
                                                                         8) %
                                                  8) + (shared_sizze_238673 +
                                                        (8 -
                                                         shared_sizze_238673 %
                                                         8) % 8);
                                    unsigned int shared_offset_238678 = 0 +
                                                 (shared_sizze_238671 + (8 -
                                                                         shared_sizze_238671 %
                                                                         8) %
                                                  8) + (shared_sizze_238673 +
                                                        (8 -
                                                         shared_sizze_238673 %
                                                         8) % 8) +
                                                 (shared_sizze_238675 + (8 -
                                                                         shared_sizze_238675 %
                                                                         8) %
                                                  8);
                                    
                                    if ((((((1 && num_groups_224227 != 0) &&
                                            1 != 0) && 1 != 0) &&
                                          segred_group_sizze_224226 != 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_224227;
                                        grid[perm[1]] = 1;
                                        grid[perm[2]] = 1;
                                        
                                        void *kernel_args_238668[] =
                                             {&ctx->global_failure,
                                              &shared_offset_238672,
                                              &shared_offset_238674,
                                              &shared_offset_238676,
                                              &shared_offset_238678, &n_203490,
                                              &q_t_203494, &jump_t_203500,
                                              &partition_sizze_203577,
                                              &t_n_m_203650, &i_203670,
                                              &num_groups_224227,
                                              &groups_per_segment_235925,
                                              &elements_per_thread_235926,
                                              &virt_num_groups_235927,
                                              &threads_per_segment_235929,
                                              &kernel_arg_238679,
                                              &kernel_arg_238680,
                                              &kernel_arg_238681,
                                              &kernel_arg_238682,
                                              &kernel_arg_238683,
                                              &kernel_arg_238684,
                                              &kernel_arg_238685,
                                              &kernel_arg_238686,
                                              &kernel_arg_238687,
                                              &kernel_arg_238688,
                                              &kernel_arg_238689,
                                              &kernel_arg_238690};
                                        int64_t time_start_238669 = 0,
                                                time_end_238670 = 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_224235",
                                                    (long) num_groups_224227,
                                                    (long) 1, (long) 1,
                                                    (long) segred_group_sizze_224226,
                                                    (long) 1, (long) 1,
                                                    (int) (0 +
                                                           (shared_sizze_238671 +
                                                            (8 -
                                                             shared_sizze_238671 %
                                                             8) % 8) +
                                                           (shared_sizze_238673 +
                                                            (8 -
                                                             shared_sizze_238673 %
                                                             8) % 8) +
                                                           (shared_sizze_238675 +
                                                            (8 -
                                                             shared_sizze_238675 %
                                                             8) % 8) +
                                                           (shared_sizze_238677 +
                                                            (8 -
                                                             shared_sizze_238677 %
                                                             8) % 8)));
                                            time_start_238669 = get_wall_time();
                                        }
                                        
                                        cudaEvent_t *pevents = NULL;
                                        
                                        if (ctx->profiling &&
                                            !ctx->profiling_paused) {
                                            pevents =
                                                cuda_get_events(&ctx->cuda,
                                                                &ctx->mainzisegred_large_224235_runs,
                                                                &ctx->mainzisegred_large_224235_total_runtime);
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                               0));
                                        }
                                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_large_224235,
                                                                              grid[0],
                                                                              grid[1],
                                                                              grid[2],
                                                                              segred_group_sizze_224226,
                                                                              1,
                                                                              1,
                                                                              0 +
                                                                              (shared_sizze_238671 +
                                                                               (8 -
                                                                                shared_sizze_238671 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238673 +
                                                                               (8 -
                                                                                shared_sizze_238673 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238675 +
                                                                               (8 -
                                                                                shared_sizze_238675 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238677 +
                                                                               (8 -
                                                                                shared_sizze_238677 %
                                                                                8) %
                                                                               8),
                                                                              NULL,
                                                                              kernel_args_238668,
                                                                              NULL));
                                        if (pevents != NULL)
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                               0));
                                        if (ctx->debugging) {
                                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                            time_end_238670 = get_wall_time();
                                            fprintf(ctx->log,
                                                    "Kernel %s runtime: %ldus\n",
                                                    "main.segred_large_224235",
                                                    time_end_238670 -
                                                    time_start_238669);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235934,
                                                              "segred_tmp_mem_235934") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235932,
                                                              "segred_tmp_mem_235932") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235930,
                                                              "segred_tmp_mem_235930") !=
                                        0)
                                        return 1;
                                }
                                
                                int64_t segmap_usable_groups_224278 =
                                        sdiv_up64(nest_sizze_210118,
                                                  segmap_group_sizze_224277);
                                struct memblock_device mem_231182;
                                
                                mem_231182.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231182,
                                                          bytes_229427,
                                                          "mem_231182")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231186;
                                
                                mem_231186.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231186,
                                                          bytes_229427,
                                                          "mem_231186")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231190;
                                
                                mem_231190.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231190,
                                                          bytes_229427,
                                                          "mem_231190")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                                
                                CUdeviceptr kernel_arg_238694 = mem_231169.mem;
                                CUdeviceptr kernel_arg_238695 = mem_231173.mem;
                                CUdeviceptr kernel_arg_238696 = mem_231177.mem;
                                CUdeviceptr kernel_arg_238697 = mem_231182.mem;
                                CUdeviceptr kernel_arg_238698 = mem_231186.mem;
                                CUdeviceptr kernel_arg_238699 = mem_231190.mem;
                                
                                if ((((((1 && segmap_usable_groups_224278 !=
                                         0) && 1 != 0) && 1 != 0) &&
                                      segmap_group_sizze_224277 != 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_224278;
                                    grid[perm[1]] = 1;
                                    grid[perm[2]] = 1;
                                    
                                    void *kernel_args_238691[] =
                                         {&ctx->global_failure,
                                          &partition_sizze_203577,
                                          &t_n_m_203650, &kernel_arg_238694,
                                          &kernel_arg_238695,
                                          &kernel_arg_238696,
                                          &kernel_arg_238697,
                                          &kernel_arg_238698,
                                          &kernel_arg_238699};
                                    int64_t time_start_238692 = 0,
                                            time_end_238693 = 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_224284",
                                                (long) segmap_usable_groups_224278,
                                                (long) 1, (long) 1,
                                                (long) segmap_group_sizze_224277,
                                                (long) 1, (long) 1, (int) 0);
                                        time_start_238692 = get_wall_time();
                                    }
                                    
                                    cudaEvent_t *pevents = NULL;
                                    
                                    if (ctx->profiling &&
                                        !ctx->profiling_paused) {
                                        pevents = cuda_get_events(&ctx->cuda,
                                                                  &ctx->mainzisegmap_224284_runs,
                                                                  &ctx->mainzisegmap_224284_total_runtime);
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                           0));
                                    }
                                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_224284,
                                                                          grid[0],
                                                                          grid[1],
                                                                          grid[2],
                                                                          segmap_group_sizze_224277,
                                                                          1, 1,
                                                                          0,
                                                                          NULL,
                                                                          kernel_args_238691,
                                                                          NULL));
                                    if (pevents != NULL)
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                           0));
                                    if (ctx->debugging) {
                                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                        time_end_238693 = get_wall_time();
                                        fprintf(ctx->log,
                                                "Kernel %s runtime: %ldus\n",
                                                "main.segmap_224284",
                                                time_end_238693 -
                                                time_start_238692);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_unref_device(ctx, &mem_231169,
                                                          "mem_231169") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231173,
                                                          "mem_231173") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231177,
                                                          "mem_231177") != 0)
                                    return 1;
                                
                                struct memblock_device mem_231195;
                                
                                mem_231195.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231195,
                                                          bytes_229427,
                                                          "mem_231195")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231199;
                                
                                mem_231199.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231199,
                                                          bytes_229427,
                                                          "mem_231199")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (slt64(q_t_203494 * (int64_t) 2,
                                          segred_group_sizze_224299)) {
                                    int64_t segment_sizze_nonzzero_235994 =
                                            smax64((int64_t) 1, q_t_203494);
                                    int64_t num_threads_235995 =
                                            num_groups_224300 *
                                            segred_group_sizze_224299;
                                    
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n",
                                                "\n# SegRed-small");
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_segments",
                                                (long long) (partition_sizze_203577 *
                                                             t_n_m_203650),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_t_203494, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segments_per_group",
                                                (long long) squot64(segred_group_sizze_224299,
                                                                    segment_sizze_nonzzero_235994),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "required_groups",
                                                (long long) sext_i64_i32(sdiv_up64(partition_sizze_203577 *
                                                                                   t_n_m_203650,
                                                                                   squot64(segred_group_sizze_224299,
                                                                                           segment_sizze_nonzzero_235994))),
                                                '\n');
                                    
                                    unsigned int shared_sizze_238703 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_224299;
                                    unsigned int shared_sizze_238705 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_224299;
                                    CUdeviceptr kernel_arg_238707 =
                                                ext_mem_229196.mem;
                                    CUdeviceptr kernel_arg_238708 =
                                                ext_mem_229197.mem;
                                    CUdeviceptr kernel_arg_238709 =
                                                ext_mem_229460.mem;
                                    CUdeviceptr kernel_arg_238710 =
                                                ext_mem_229461.mem;
                                    CUdeviceptr kernel_arg_238711 =
                                                mem_231151.mem;
                                    CUdeviceptr kernel_arg_238712 =
                                                mem_231155.mem;
                                    CUdeviceptr kernel_arg_238713 =
                                                mem_231182.mem;
                                    CUdeviceptr kernel_arg_238714 =
                                                mem_231186.mem;
                                    CUdeviceptr kernel_arg_238715 =
                                                mem_231190.mem;
                                    CUdeviceptr kernel_arg_238716 =
                                                mem_231195.mem;
                                    CUdeviceptr kernel_arg_238717 =
                                                mem_231199.mem;
                                    unsigned int shared_offset_238704 = 0;
                                    unsigned int shared_offset_238706 = 0 +
                                                 (shared_sizze_238703 + (8 -
                                                                         shared_sizze_238703 %
                                                                         8) %
                                                  8);
                                    
                                    if ((((((1 && num_groups_224300 != 0) &&
                                            1 != 0) && 1 != 0) &&
                                          segred_group_sizze_224299 != 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_224300;
                                        grid[perm[1]] = 1;
                                        grid[perm[2]] = 1;
                                        
                                        void *kernel_args_238700[] =
                                             {&ctx->global_failure,
                                              &shared_offset_238704,
                                              &shared_offset_238706, &n_203490,
                                              &q_t_203494, &jump_t_203500,
                                              &partition_sizze_203577,
                                              &t_n_m_203650, &i_203670,
                                              &num_groups_224300,
                                              &segment_sizze_nonzzero_235994,
                                              &kernel_arg_238707,
                                              &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_238701 = 0,
                                                time_end_238702 = 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_224307",
                                                    (long) num_groups_224300,
                                                    (long) 1, (long) 1,
                                                    (long) segred_group_sizze_224299,
                                                    (long) 1, (long) 1,
                                                    (int) (0 +
                                                           (shared_sizze_238703 +
                                                            (8 -
                                                             shared_sizze_238703 %
                                                             8) % 8) +
                                                           (shared_sizze_238705 +
                                                            (8 -
                                                             shared_sizze_238705 %
                                                             8) % 8)));
                                            time_start_238701 = get_wall_time();
                                        }
                                        
                                        cudaEvent_t *pevents = NULL;
                                        
                                        if (ctx->profiling &&
                                            !ctx->profiling_paused) {
                                            pevents =
                                                cuda_get_events(&ctx->cuda,
                                                                &ctx->mainzisegred_small_224307_runs,
                                                                &ctx->mainzisegred_small_224307_total_runtime);
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                               0));
                                        }
                                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_small_224307,
                                                                              grid[0],
                                                                              grid[1],
                                                                              grid[2],
                                                                              segred_group_sizze_224299,
                                                                              1,
                                                                              1,
                                                                              0 +
                                                                              (shared_sizze_238703 +
                                                                               (8 -
                                                                                shared_sizze_238703 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238705 +
                                                                               (8 -
                                                                                shared_sizze_238705 %
                                                                                8) %
                                                                               8),
                                                                              NULL,
                                                                              kernel_args_238700,
                                                                              NULL));
                                        if (pevents != NULL)
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                               0));
                                        if (ctx->debugging) {
                                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                            time_end_238702 = get_wall_time();
                                            fprintf(ctx->log,
                                                    "Kernel %s runtime: %ldus\n",
                                                    "main.segred_small_224307",
                                                    time_end_238702 -
                                                    time_start_238701);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                } else {
                                    int64_t groups_per_segment_236029 =
                                            sdiv_up64(num_groups_224300,
                                                      smax64((int64_t) 1,
                                                             partition_sizze_203577 *
                                                             t_n_m_203650));
                                    int64_t elements_per_thread_236030 =
                                            sdiv_up64(q_t_203494,
                                                      segred_group_sizze_224299 *
                                                      groups_per_segment_236029);
                                    int64_t virt_num_groups_236031 =
                                            groups_per_segment_236029 *
                                            (partition_sizze_203577 *
                                             t_n_m_203650);
                                    int64_t num_threads_236032 =
                                            num_groups_224300 *
                                            segred_group_sizze_224299;
                                    int64_t threads_per_segment_236033 =
                                            groups_per_segment_236029 *
                                            segred_group_sizze_224299;
                                    
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n",
                                                "\n# SegRed-large");
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_segments",
                                                (long long) (partition_sizze_203577 *
                                                             t_n_m_203650),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_t_203494, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "virt_num_groups",
                                                (long long) virt_num_groups_236031,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_groups",
                                                (long long) num_groups_224300,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "group_size",
                                                (long long) segred_group_sizze_224299,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "elems_per_thread",
                                                (long long) elements_per_thread_236030,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "groups_per_segment",
                                                (long long) groups_per_segment_236029,
                                                '\n');
                                    
                                    struct memblock_device
                                    segred_tmp_mem_236034;
                                    
                                    segred_tmp_mem_236034.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_236034,
                                                              (int64_t) 8 *
                                                              virt_num_groups_236031,
                                                              "segred_tmp_mem_236034")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_236036;
                                    
                                    segred_tmp_mem_236036.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_236036,
                                                              (int64_t) 8 *
                                                              virt_num_groups_236031,
                                                              "segred_tmp_mem_236036")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    mainzicounter_mem_236038 =
                                    ctx->mainzicounter_mem_236038;
                                    unsigned int shared_sizze_238722 = 1;
                                    unsigned int shared_sizze_238724 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_224299;
                                    unsigned int shared_sizze_238726 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_224299;
                                    CUdeviceptr kernel_arg_238728 =
                                                ext_mem_229196.mem;
                                    CUdeviceptr kernel_arg_238729 =
                                                ext_mem_229197.mem;
                                    CUdeviceptr kernel_arg_238730 =
                                                ext_mem_229460.mem;
                                    CUdeviceptr kernel_arg_238731 =
                                                ext_mem_229461.mem;
                                    CUdeviceptr kernel_arg_238732 =
                                                mem_231151.mem;
                                    CUdeviceptr kernel_arg_238733 =
                                                mem_231155.mem;
                                    CUdeviceptr kernel_arg_238734 =
                                                mem_231182.mem;
                                    CUdeviceptr kernel_arg_238735 =
                                                mem_231186.mem;
                                    CUdeviceptr kernel_arg_238736 =
                                                mem_231190.mem;
                                    CUdeviceptr kernel_arg_238737 =
                                                mem_231195.mem;
                                    CUdeviceptr kernel_arg_238738 =
                                                mem_231199.mem;
                                    CUdeviceptr kernel_arg_238739 =
                                                segred_tmp_mem_236034.mem;
                                    CUdeviceptr kernel_arg_238740 =
                                                segred_tmp_mem_236036.mem;
                                    CUdeviceptr kernel_arg_238741 =
                                                mainzicounter_mem_236038.mem;
                                    unsigned int shared_offset_238723 = 0;
                                    unsigned int shared_offset_238725 = 0 +
                                                 (shared_sizze_238722 + (8 -
                                                                         shared_sizze_238722 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_238727 = 0 +
                                                 (shared_sizze_238722 + (8 -
                                                                         shared_sizze_238722 %
                                                                         8) %
                                                  8) + (shared_sizze_238724 +
                                                        (8 -
                                                         shared_sizze_238724 %
                                                         8) % 8);
                                    
                                    if ((((((1 && num_groups_224300 != 0) &&
                                            1 != 0) && 1 != 0) &&
                                          segred_group_sizze_224299 != 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_224300;
                                        grid[perm[1]] = 1;
                                        grid[perm[2]] = 1;
                                        
                                        void *kernel_args_238719[] =
                                             {&ctx->global_failure,
                                              &shared_offset_238723,
                                              &shared_offset_238725,
                                              &shared_offset_238727, &n_203490,
                                              &q_t_203494, &jump_t_203500,
                                              &partition_sizze_203577,
                                              &t_n_m_203650, &i_203670,
                                              &num_groups_224300,
                                              &groups_per_segment_236029,
                                              &elements_per_thread_236030,
                                              &virt_num_groups_236031,
                                              &threads_per_segment_236033,
                                              &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,
                                              &kernel_arg_238739,
                                              &kernel_arg_238740,
                                              &kernel_arg_238741};
                                        int64_t time_start_238720 = 0,
                                                time_end_238721 = 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_224307",
                                                    (long) num_groups_224300,
                                                    (long) 1, (long) 1,
                                                    (long) segred_group_sizze_224299,
                                                    (long) 1, (long) 1,
                                                    (int) (0 +
                                                           (shared_sizze_238722 +
                                                            (8 -
                                                             shared_sizze_238722 %
                                                             8) % 8) +
                                                           (shared_sizze_238724 +
                                                            (8 -
                                                             shared_sizze_238724 %
                                                             8) % 8) +
                                                           (shared_sizze_238726 +
                                                            (8 -
                                                             shared_sizze_238726 %
                                                             8) % 8)));
                                            time_start_238720 = get_wall_time();
                                        }
                                        
                                        cudaEvent_t *pevents = NULL;
                                        
                                        if (ctx->profiling &&
                                            !ctx->profiling_paused) {
                                            pevents =
                                                cuda_get_events(&ctx->cuda,
                                                                &ctx->mainzisegred_large_224307_runs,
                                                                &ctx->mainzisegred_large_224307_total_runtime);
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                               0));
                                        }
                                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_large_224307,
                                                                              grid[0],
                                                                              grid[1],
                                                                              grid[2],
                                                                              segred_group_sizze_224299,
                                                                              1,
                                                                              1,
                                                                              0 +
                                                                              (shared_sizze_238722 +
                                                                               (8 -
                                                                                shared_sizze_238722 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238724 +
                                                                               (8 -
                                                                                shared_sizze_238724 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238726 +
                                                                               (8 -
                                                                                shared_sizze_238726 %
                                                                                8) %
                                                                               8),
                                                                              NULL,
                                                                              kernel_args_238719,
                                                                              NULL));
                                        if (pevents != NULL)
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                               0));
                                        if (ctx->debugging) {
                                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                            time_end_238721 = get_wall_time();
                                            fprintf(ctx->log,
                                                    "Kernel %s runtime: %ldus\n",
                                                    "main.segred_large_224307",
                                                    time_end_238721 -
                                                    time_start_238720);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_236036,
                                                              "segred_tmp_mem_236036") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_236034,
                                                              "segred_tmp_mem_236034") !=
                                        0)
                                        return 1;
                                }
                                if (memblock_unref_device(ctx, &mem_231182,
                                                          "mem_231182") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231186,
                                                          "mem_231186") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231190,
                                                          "mem_231190") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_231201,
                                                        &mem_231195,
                                                        "mem_231195") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_231200,
                                                        &mem_231199,
                                                        "mem_231199") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231199,
                                                          "mem_231199") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231195,
                                                          "mem_231195") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231190,
                                                          "mem_231190") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231186,
                                                          "mem_231186") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231182,
                                                          "mem_231182") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231177,
                                                          "mem_231177") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231173,
                                                          "mem_231173") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231169,
                                                          "mem_231169") != 0)
                                    return 1;
                            }
                            if (memblock_unref_device(ctx, &mem_231151,
                                                      "mem_231151") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231155,
                                                      "mem_231155") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_231213,
                                                    &ext_mem_231201,
                                                    "ext_mem_231201") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_231212,
                                                    &ext_mem_231200,
                                                    "ext_mem_231200") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231200,
                                                      "ext_mem_231200") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231201,
                                                      "ext_mem_231201") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231155,
                                                      "mem_231155") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231151,
                                                      "mem_231151") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231146,
                                                      "mem_231146") != 0)
                                return 1;
                        }
                        if (memblock_set_device(ctx, &ext_mem_231400,
                                                &ext_mem_231213,
                                                "ext_mem_231213") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_231399,
                                                &ext_mem_231212,
                                                "ext_mem_231212") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231212,
                                                  "ext_mem_231212") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231213,
                                                  "ext_mem_231213") != 0)
                            return 1;
                    } else {
                        bool suff_outer_par_224366;
                        
                        suff_outer_par_224366 =
                            *ctx->tuning_params.mainzisuff_outer_par_32 <=
                            partition_sizze_203577;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_32",
                                    (long) partition_sizze_203577,
                                    suff_outer_par_224366 ? "true" : "false");
                        
                        int64_t segmap_group_sizze_224523;
                        
                        segmap_group_sizze_224523 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_224370;
                        
                        int64_t num_groups_224524;
                        int32_t max_num_groups_236082;
                        
                        max_num_groups_236082 =
                            *ctx->tuning_params.mainzisegmap_num_groups_224372;
                        num_groups_224524 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(partition_sizze_203577,
                                                                                 segmap_group_sizze_224523),
                                                                       sext_i32_i64(max_num_groups_236082))));
                        
                        int64_t segmap_group_sizze_225322;
                        
                        segmap_group_sizze_225322 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_225296;
                        
                        int64_t segmap_group_sizze_225338;
                        
                        segmap_group_sizze_225338 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_225240;
                        
                        int64_t segmap_group_sizze_225363;
                        
                        segmap_group_sizze_225363 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_224682;
                        
                        bool suff_outer_par_225367;
                        
                        suff_outer_par_225367 =
                            *ctx->tuning_params.mainzisuff_outer_par_33 <=
                            nest_sizze_210118;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_33",
                                    (long) nest_sizze_210118,
                                    suff_outer_par_225367 ? "true" : "false");
                        
                        int64_t nest_sizze_225511 = q_t_203494 *
                                nest_sizze_210118;
                        int64_t segred_group_sizze_225512;
                        
                        segred_group_sizze_225512 =
                            *ctx->tuning_params.mainzisegred_group_sizze_224961;
                        
                        int64_t num_groups_225513;
                        int32_t max_num_groups_236083;
                        
                        max_num_groups_236083 =
                            *ctx->tuning_params.mainzisegred_num_groups_224963;
                        num_groups_225513 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(nest_sizze_225511,
                                                                                 segred_group_sizze_225512),
                                                                       sext_i32_i64(max_num_groups_236083))));
                        
                        int64_t segmap_group_sizze_225573;
                        
                        segmap_group_sizze_225573 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_224920;
                        
                        int64_t segred_group_sizze_225616;
                        
                        segred_group_sizze_225616 =
                            *ctx->tuning_params.mainzisegred_group_sizze_224832;
                        
                        int64_t num_groups_225617;
                        int32_t max_num_groups_236084;
                        
                        max_num_groups_236084 =
                            *ctx->tuning_params.mainzisegred_num_groups_224834;
                        num_groups_225617 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(nest_sizze_225511,
                                                                                 segred_group_sizze_225616),
                                                                       sext_i32_i64(max_num_groups_236084))));
                        
                        int64_t maxSubHelper_232048 = umax64(bytes_229169,
                                                             bytes_229420);
                        int64_t num_threads_232203 = segmap_group_sizze_224523 *
                                num_groups_224524;
                        int64_t total_sizze_232204 = maxSubHelper_232048 *
                                num_threads_232203;
                        int64_t total_sizze_232205 = bytes_229420 *
                                num_threads_232203;
                        int64_t total_sizze_232206 = bytes_229169 *
                                num_threads_232203;
                        int64_t total_sizze_232207 = bytes_229169 *
                                num_threads_232203;
                        struct memblock_device ext_mem_231398;
                        
                        ext_mem_231398.references = NULL;
                        
                        struct memblock_device ext_mem_231397;
                        
                        ext_mem_231397.references = NULL;
                        
                        int32_t local_memory_capacity_236386;
                        
                        local_memory_capacity_236386 =
                            ctx->cuda.max_shared_memory;
                        if ((sle64((int64_t) 0,
                                   sext_i32_i64(local_memory_capacity_236386)) &&
                             sle64((int64_t) 0,
                                   sext_i32_i64(local_memory_capacity_236386))) &&
                            suff_outer_par_224366) {
                            struct memblock_device mem_231216;
                            
                            mem_231216.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231216,
                                                      binop_y_229176,
                                                      "mem_231216")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_231216,
                                                                      (int64_t) 0,
                                                                      mem_230920,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_203490,
                                                                      partition_sizze_203577) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_231216,
                                                          "mem_231216") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231397,
                                                          "ext_mem_231397") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231398,
                                                          "ext_mem_231398") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231399,
                                                          "ext_mem_231399") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231400,
                                                          "ext_mem_231400") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231401,
                                                          "ext_mem_231401") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231402,
                                                          "ext_mem_231402") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231504,
                                                          "ext_mem_231504") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231505,
                                                          "ext_mem_231505") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230920,
                                                          "mem_230920") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230914,
                                                          "ext_mem_230914") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230907,
                                                          "ext_mem_230907") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230908,
                                                          "ext_mem_230908") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230546,
                                                          "ext_mem_230546") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230529,
                                                          "ext_mem_230529") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230512,
                                                          "ext_mem_230512") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230494,
                                                          "ext_mem_230494") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231219;
                            
                            mem_231219.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231219,
                                                      binop_y_229176,
                                                      "mem_231219")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_231219,
                                                                      (int64_t) 0,
                                                                      ext_mem_229197,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_203490,
                                                                      partition_sizze_203577) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_231219,
                                                          "mem_231219") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231216,
                                                          "mem_231216") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231397,
                                                          "ext_mem_231397") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231398,
                                                          "ext_mem_231398") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231399,
                                                          "ext_mem_231399") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231400,
                                                          "ext_mem_231400") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231401,
                                                          "ext_mem_231401") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231402,
                                                          "ext_mem_231402") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231504,
                                                          "ext_mem_231504") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231505,
                                                          "ext_mem_231505") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230920,
                                                          "mem_230920") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230914,
                                                          "ext_mem_230914") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230907,
                                                          "ext_mem_230907") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230908,
                                                          "ext_mem_230908") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230546,
                                                          "ext_mem_230546") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230529,
                                                          "ext_mem_230529") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230512,
                                                          "ext_mem_230512") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230494,
                                                          "ext_mem_230494") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231222;
                            
                            mem_231222.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231222,
                                                      binop_y_229426,
                                                      "mem_231222")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_231222,
                                                                      (int64_t) 0,
                                                                      ext_mem_229461,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      t_n_m_203650,
                                                                      partition_sizze_203577) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_231222,
                                                          "mem_231222") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231219,
                                                          "mem_231219") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231216,
                                                          "mem_231216") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231397,
                                                          "ext_mem_231397") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231398,
                                                          "ext_mem_231398") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231399,
                                                          "ext_mem_231399") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231400,
                                                          "ext_mem_231400") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231401,
                                                          "ext_mem_231401") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231402,
                                                          "ext_mem_231402") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231504,
                                                          "ext_mem_231504") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231505,
                                                          "ext_mem_231505") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230920,
                                                          "mem_230920") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230914,
                                                          "ext_mem_230914") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230907,
                                                          "ext_mem_230907") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230908,
                                                          "ext_mem_230908") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230546,
                                                          "ext_mem_230546") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230529,
                                                          "ext_mem_230529") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230512,
                                                          "ext_mem_230512") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230494,
                                                          "ext_mem_230494") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231225;
                            
                            mem_231225.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231225,
                                                      binop_y_229426,
                                                      "mem_231225")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_231225,
                                                                      (int64_t) 0,
                                                                      ext_mem_229460,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      t_n_m_203650,
                                                                      partition_sizze_203577) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_231225,
                                                          "mem_231225") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231222,
                                                          "mem_231222") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231219,
                                                          "mem_231219") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231216,
                                                          "mem_231216") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231397,
                                                          "ext_mem_231397") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231398,
                                                          "ext_mem_231398") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231399,
                                                          "ext_mem_231399") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231400,
                                                          "ext_mem_231400") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231401,
                                                          "ext_mem_231401") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231402,
                                                          "ext_mem_231402") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231504,
                                                          "ext_mem_231504") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231505,
                                                          "ext_mem_231505") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230920,
                                                          "mem_230920") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230914,
                                                          "ext_mem_230914") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230907,
                                                          "ext_mem_230907") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230908,
                                                          "ext_mem_230908") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230546,
                                                          "ext_mem_230546") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230529,
                                                          "ext_mem_230529") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230512,
                                                          "ext_mem_230512") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230494,
                                                          "ext_mem_230494") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231228;
                            
                            mem_231228.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231228,
                                                      binop_y_229176,
                                                      "mem_231228")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            int64_t group_sizze_236088;
                            
                            group_sizze_236088 =
                                *ctx->tuning_params.mainzigroup_sizze_236088;
                            
                            int64_t num_groups_236089 =
                                    sdiv_up64(partition_sizze_203577 * n_203490,
                                              group_sizze_236088);
                            CUdeviceptr kernel_arg_238745 =
                                        mem_param_229493.mem;
                            CUdeviceptr kernel_arg_238746 = mem_231228.mem;
                            
                            if ((((((1 && num_groups_236089 != 0) && 1 != 0) &&
                                   1 != 0) && group_sizze_236088 != 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_236089;
                                grid[perm[1]] = 1;
                                grid[perm[2]] = 1;
                                
                                void *kernel_args_238742[] = {&n_203490,
                                                              &partition_sizze_203577,
                                                              &ctx_param_ext_229488,
                                                              &ctx_param_ext_229489,
                                                              &ctx_param_ext_229491,
                                                              &kernel_arg_238745,
                                                              &kernel_arg_238746};
                                int64_t time_start_238743 = 0, time_end_238744 =
                                        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_236085",
                                            (long) num_groups_236089, (long) 1,
                                            (long) 1, (long) group_sizze_236088,
                                            (long) 1, (long) 1, (int) 0);
                                    time_start_238743 = get_wall_time();
                                }
                                
                                cudaEvent_t *pevents = NULL;
                                
                                if (ctx->profiling && !ctx->profiling_paused) {
                                    pevents = cuda_get_events(&ctx->cuda,
                                                              &ctx->mainzicopy_236085_runs,
                                                              &ctx->mainzicopy_236085_total_runtime);
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                       0));
                                }
                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzicopy_236085,
                                                                      grid[0],
                                                                      grid[1],
                                                                      grid[2],
                                                                      group_sizze_236088,
                                                                      1, 1, 0,
                                                                      NULL,
                                                                      kernel_args_238742,
                                                                      NULL));
                                if (pevents != NULL)
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                       0));
                                if (ctx->debugging) {
                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                    time_end_238744 = get_wall_time();
                                    fprintf(ctx->log,
                                            "Kernel %s runtime: %ldus\n",
                                            "main.copy_236085",
                                            time_end_238744 -
                                            time_start_238743);
                                }
                            }
                            
                            struct memblock_device mem_231307;
                            
                            mem_231307.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231307,
                                                      binop_y_229426,
                                                      "mem_231307")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231310;
                            
                            mem_231310.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231310,
                                                      binop_y_229426,
                                                      "mem_231310")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232049;
                            
                            color_232049.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232049,
                                                      total_sizze_232204,
                                                      "color_232049")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232050;
                            
                            color_232050.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232050,
                                                      total_sizze_232205,
                                                      "color_232050")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232051;
                            
                            color_232051.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232051,
                                                      total_sizze_232206,
                                                      "color_232051")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232052;
                            
                            color_232052.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232052,
                                                      total_sizze_232207,
                                                      "color_232052")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            
                            CUdeviceptr kernel_arg_238750 = mem_229161.mem;
                            CUdeviceptr kernel_arg_238751 = ext_mem_229196.mem;
                            CUdeviceptr kernel_arg_238752 = mem_231216.mem;
                            CUdeviceptr kernel_arg_238753 = mem_231219.mem;
                            CUdeviceptr kernel_arg_238754 = mem_231222.mem;
                            CUdeviceptr kernel_arg_238755 = mem_231225.mem;
                            CUdeviceptr kernel_arg_238756 = mem_231228.mem;
                            CUdeviceptr kernel_arg_238757 = mem_231307.mem;
                            CUdeviceptr kernel_arg_238758 = mem_231310.mem;
                            CUdeviceptr kernel_arg_238759 = color_232049.mem;
                            CUdeviceptr kernel_arg_238760 = color_232050.mem;
                            CUdeviceptr kernel_arg_238761 = color_232051.mem;
                            CUdeviceptr kernel_arg_238762 = color_232052.mem;
                            
                            if ((((((1 && num_groups_224524 != 0) && 1 != 0) &&
                                   1 != 0) && segmap_group_sizze_224523 != 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_224524;
                                grid[perm[1]] = 1;
                                grid[perm[2]] = 1;
                                
                                void *kernel_args_238747[] =
                                     {&ctx->global_failure,
                                      &ctx->failure_is_an_option,
                                      &ctx->global_failure_args, &n_203490,
                                      &q_t_203494, &jump_t_203500,
                                      &partition_sizze_203577, &t_n_m_203650,
                                      &i_203670, &num_groups_224524,
                                      &num_threads_232203, &kernel_arg_238750,
                                      &kernel_arg_238751, &kernel_arg_238752,
                                      &kernel_arg_238753, &kernel_arg_238754,
                                      &kernel_arg_238755, &kernel_arg_238756,
                                      &kernel_arg_238757, &kernel_arg_238758,
                                      &kernel_arg_238759, &kernel_arg_238760,
                                      &kernel_arg_238761, &kernel_arg_238762};
                                int64_t time_start_238748 = 0, time_end_238749 =
                                        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_224529",
                                            (long) num_groups_224524, (long) 1,
                                            (long) 1,
                                            (long) segmap_group_sizze_224523,
                                            (long) 1, (long) 1, (int) 0);
                                    time_start_238748 = get_wall_time();
                                }
                                
                                cudaEvent_t *pevents = NULL;
                                
                                if (ctx->profiling && !ctx->profiling_paused) {
                                    pevents = cuda_get_events(&ctx->cuda,
                                                              &ctx->mainzisegmap_224529_runs,
                                                              &ctx->mainzisegmap_224529_total_runtime);
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                       0));
                                }
                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_224529,
                                                                      grid[0],
                                                                      grid[1],
                                                                      grid[2],
                                                                      segmap_group_sizze_224523,
                                                                      1, 1, 0,
                                                                      NULL,
                                                                      kernel_args_238747,
                                                                      NULL));
                                if (pevents != NULL)
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                       0));
                                if (ctx->debugging) {
                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                    time_end_238749 = get_wall_time();
                                    fprintf(ctx->log,
                                            "Kernel %s runtime: %ldus\n",
                                            "main.segmap_224529",
                                            time_end_238749 -
                                            time_start_238748);
                                }
                            }
                            ctx->failure_is_an_option = 1;
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx, &mem_231216,
                                                      "mem_231216") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231219,
                                                      "mem_231219") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231222,
                                                      "mem_231222") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231225,
                                                      "mem_231225") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231228,
                                                      "mem_231228") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232049,
                                                      "color_232049") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232050,
                                                      "color_232050") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232051,
                                                      "color_232051") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232052,
                                                      "color_232052") != 0)
                                return 1;
                            
                            struct memblock_device mem_231390;
                            
                            mem_231390.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231390,
                                                      bytes_229427,
                                                      "mem_231390")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_231390,
                                                                      (int64_t) 0,
                                                                      mem_231307,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      partition_sizze_203577,
                                                                      t_n_m_203650) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_231390,
                                                          "mem_231390") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232052,
                                                          "color_232052") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232051,
                                                          "color_232051") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232050,
                                                          "color_232050") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232049,
                                                          "color_232049") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231310,
                                                          "mem_231310") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231307,
                                                          "mem_231307") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231228,
                                                          "mem_231228") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231225,
                                                          "mem_231225") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231222,
                                                          "mem_231222") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231219,
                                                          "mem_231219") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231216,
                                                          "mem_231216") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231397,
                                                          "ext_mem_231397") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231398,
                                                          "ext_mem_231398") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231399,
                                                          "ext_mem_231399") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231400,
                                                          "ext_mem_231400") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231401,
                                                          "ext_mem_231401") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231402,
                                                          "ext_mem_231402") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231504,
                                                          "ext_mem_231504") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231505,
                                                          "ext_mem_231505") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230920,
                                                          "mem_230920") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230914,
                                                          "ext_mem_230914") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230907,
                                                          "ext_mem_230907") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230908,
                                                          "ext_mem_230908") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230546,
                                                          "ext_mem_230546") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230529,
                                                          "ext_mem_230529") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230512,
                                                          "ext_mem_230512") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230494,
                                                          "ext_mem_230494") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_231307,
                                                      "mem_231307") != 0)
                                return 1;
                            
                            struct memblock_device mem_231395;
                            
                            mem_231395.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231395,
                                                      bytes_229427,
                                                      "mem_231395")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_231395,
                                                                      (int64_t) 0,
                                                                      mem_231310,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      partition_sizze_203577,
                                                                      t_n_m_203650) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_231395,
                                                          "mem_231395") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231390,
                                                          "mem_231390") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232052,
                                                          "color_232052") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232051,
                                                          "color_232051") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232050,
                                                          "color_232050") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232049,
                                                          "color_232049") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231310,
                                                          "mem_231310") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231307,
                                                          "mem_231307") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231228,
                                                          "mem_231228") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231225,
                                                          "mem_231225") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231222,
                                                          "mem_231222") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231219,
                                                          "mem_231219") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231216,
                                                          "mem_231216") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231397,
                                                          "ext_mem_231397") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231398,
                                                          "ext_mem_231398") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231399,
                                                          "ext_mem_231399") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231400,
                                                          "ext_mem_231400") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231401,
                                                          "ext_mem_231401") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231402,
                                                          "ext_mem_231402") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231504,
                                                          "ext_mem_231504") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231505,
                                                          "ext_mem_231505") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230920,
                                                          "mem_230920") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230914,
                                                          "ext_mem_230914") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230907,
                                                          "ext_mem_230907") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230908,
                                                          "ext_mem_230908") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230546,
                                                          "ext_mem_230546") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230529,
                                                          "ext_mem_230529") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230512,
                                                          "ext_mem_230512") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230494,
                                                          "ext_mem_230494") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_231310,
                                                      "mem_231310") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_231398,
                                                    &mem_231390,
                                                    "mem_231390") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_231397,
                                                    &mem_231395,
                                                    "mem_231395") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231395,
                                                      "mem_231395") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231390,
                                                      "mem_231390") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232052,
                                                      "color_232052") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232051,
                                                      "color_232051") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232050,
                                                      "color_232050") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232049,
                                                      "color_232049") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231310,
                                                      "mem_231310") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231307,
                                                      "mem_231307") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231228,
                                                      "mem_231228") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231225,
                                                      "mem_231225") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231222,
                                                      "mem_231222") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231219,
                                                      "mem_231219") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231216,
                                                      "mem_231216") != 0)
                                return 1;
                        } else {
                            int64_t segmap_usable_groups_225323 =
                                    sdiv_up64(nest_sizze_207000,
                                              segmap_group_sizze_225322);
                            struct memblock_device mem_231315;
                            
                            mem_231315.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231315,
                                                      bytes_229177,
                                                      "mem_231315")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            
                            CUdeviceptr kernel_arg_238766 = mem_229161.mem;
                            CUdeviceptr kernel_arg_238767 = mem_230920.mem;
                            CUdeviceptr kernel_arg_238768 = mem_231315.mem;
                            
                            if ((((((1 && segmap_usable_groups_225323 != 0) &&
                                    1 != 0) && 1 != 0) &&
                                  segmap_group_sizze_225322 != 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_225323;
                                grid[perm[1]] = 1;
                                grid[perm[2]] = 1;
                                
                                void *kernel_args_238763[] =
                                     {&ctx->global_failure, &n_203490,
                                      &partition_sizze_203577,
                                      &kernel_arg_238766, &kernel_arg_238767,
                                      &kernel_arg_238768};
                                int64_t time_start_238764 = 0, time_end_238765 =
                                        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_225327",
                                            (long) segmap_usable_groups_225323,
                                            (long) 1, (long) 1,
                                            (long) segmap_group_sizze_225322,
                                            (long) 1, (long) 1, (int) 0);
                                    time_start_238764 = get_wall_time();
                                }
                                
                                cudaEvent_t *pevents = NULL;
                                
                                if (ctx->profiling && !ctx->profiling_paused) {
                                    pevents = cuda_get_events(&ctx->cuda,
                                                              &ctx->mainzisegmap_225327_runs,
                                                              &ctx->mainzisegmap_225327_total_runtime);
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                       0));
                                }
                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_225327,
                                                                      grid[0],
                                                                      grid[1],
                                                                      grid[2],
                                                                      segmap_group_sizze_225322,
                                                                      1, 1, 0,
                                                                      NULL,
                                                                      kernel_args_238763,
                                                                      NULL));
                                if (pevents != NULL)
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                       0));
                                if (ctx->debugging) {
                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                    time_end_238765 = get_wall_time();
                                    fprintf(ctx->log,
                                            "Kernel %s runtime: %ldus\n",
                                            "main.segmap_225327",
                                            time_end_238765 -
                                            time_start_238764);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            
                            int64_t segmap_usable_groups_225339 =
                                    sdiv_up64(nest_sizze_207000,
                                              segmap_group_sizze_225338);
                            struct memblock_device mem_231320;
                            
                            mem_231320.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231320,
                                                      bytes_229177,
                                                      "mem_231320")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231324;
                            
                            mem_231324.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231324,
                                                      bytes_229177,
                                                      "mem_231324")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            
                            CUdeviceptr kernel_arg_238772 = ext_mem_229197.mem;
                            CUdeviceptr kernel_arg_238773 =
                                        mem_param_229493.mem;
                            CUdeviceptr kernel_arg_238774 = mem_231315.mem;
                            CUdeviceptr kernel_arg_238775 = mem_231320.mem;
                            CUdeviceptr kernel_arg_238776 = mem_231324.mem;
                            
                            if ((((((1 && segmap_usable_groups_225339 != 0) &&
                                    1 != 0) && 1 != 0) &&
                                  segmap_group_sizze_225338 != 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_225339;
                                grid[perm[1]] = 1;
                                grid[perm[2]] = 1;
                                
                                void *kernel_args_238769[] =
                                     {&ctx->global_failure,
                                      &ctx->failure_is_an_option,
                                      &ctx->global_failure_args, &n_203490,
                                      &partition_sizze_203577,
                                      &ctx_param_ext_229488,
                                      &ctx_param_ext_229489,
                                      &ctx_param_ext_229491, &kernel_arg_238772,
                                      &kernel_arg_238773, &kernel_arg_238774,
                                      &kernel_arg_238775, &kernel_arg_238776};
                                int64_t time_start_238770 = 0, time_end_238771 =
                                        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_225344",
                                            (long) segmap_usable_groups_225339,
                                            (long) 1, (long) 1,
                                            (long) segmap_group_sizze_225338,
                                            (long) 1, (long) 1, (int) 0);
                                    time_start_238770 = get_wall_time();
                                }
                                
                                cudaEvent_t *pevents = NULL;
                                
                                if (ctx->profiling && !ctx->profiling_paused) {
                                    pevents = cuda_get_events(&ctx->cuda,
                                                              &ctx->mainzisegmap_225344_runs,
                                                              &ctx->mainzisegmap_225344_total_runtime);
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                       0));
                                }
                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_225344,
                                                                      grid[0],
                                                                      grid[1],
                                                                      grid[2],
                                                                      segmap_group_sizze_225338,
                                                                      1, 1, 0,
                                                                      NULL,
                                                                      kernel_args_238769,
                                                                      NULL));
                                if (pevents != NULL)
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                       0));
                                if (ctx->debugging) {
                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                    time_end_238771 = get_wall_time();
                                    fprintf(ctx->log,
                                            "Kernel %s runtime: %ldus\n",
                                            "main.segmap_225344",
                                            time_end_238771 -
                                            time_start_238770);
                                }
                            }
                            ctx->failure_is_an_option = 1;
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx, &mem_231315,
                                                      "mem_231315") != 0)
                                return 1;
                            
                            int64_t segmap_usable_groups_225364 =
                                    sdiv_up64(nest_sizze_210118,
                                              segmap_group_sizze_225363);
                            struct memblock_device ext_mem_231386;
                            
                            ext_mem_231386.references = NULL;
                            
                            struct memblock_device ext_mem_231385;
                            
                            ext_mem_231385.references = NULL;
                            
                            int32_t local_memory_capacity_236385;
                            
                            local_memory_capacity_236385 =
                                ctx->cuda.max_shared_memory;
                            if (sle64((int64_t) 0,
                                      sext_i32_i64(local_memory_capacity_236385)) &&
                                suff_outer_par_225367) {
                                struct memblock_device mem_231329;
                                
                                mem_231329.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231329,
                                                          bytes_229427,
                                                          "mem_231329")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231333;
                                
                                mem_231333.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231333,
                                                          bytes_229427,
                                                          "mem_231333")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                                
                                CUdeviceptr kernel_arg_238780 =
                                            ext_mem_229196.mem;
                                CUdeviceptr kernel_arg_238781 =
                                            ext_mem_229197.mem;
                                CUdeviceptr kernel_arg_238782 =
                                            ext_mem_229460.mem;
                                CUdeviceptr kernel_arg_238783 =
                                            ext_mem_229461.mem;
                                CUdeviceptr kernel_arg_238784 = mem_231320.mem;
                                CUdeviceptr kernel_arg_238785 = mem_231324.mem;
                                CUdeviceptr kernel_arg_238786 = mem_231329.mem;
                                CUdeviceptr kernel_arg_238787 = mem_231333.mem;
                                
                                if ((((((1 && segmap_usable_groups_225364 !=
                                         0) && 1 != 0) && 1 != 0) &&
                                      segmap_group_sizze_225363 != 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_225364;
                                    grid[perm[1]] = 1;
                                    grid[perm[2]] = 1;
                                    
                                    void *kernel_args_238777[] =
                                         {&ctx->global_failure, &n_203490,
                                          &q_t_203494, &jump_t_203500,
                                          &partition_sizze_203577,
                                          &t_n_m_203650, &i_203670,
                                          &kernel_arg_238780,
                                          &kernel_arg_238781,
                                          &kernel_arg_238782,
                                          &kernel_arg_238783,
                                          &kernel_arg_238784,
                                          &kernel_arg_238785,
                                          &kernel_arg_238786,
                                          &kernel_arg_238787};
                                    int64_t time_start_238778 = 0,
                                            time_end_238779 = 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_225374",
                                                (long) segmap_usable_groups_225364,
                                                (long) 1, (long) 1,
                                                (long) segmap_group_sizze_225363,
                                                (long) 1, (long) 1, (int) 0);
                                        time_start_238778 = get_wall_time();
                                    }
                                    
                                    cudaEvent_t *pevents = NULL;
                                    
                                    if (ctx->profiling &&
                                        !ctx->profiling_paused) {
                                        pevents = cuda_get_events(&ctx->cuda,
                                                                  &ctx->mainzisegmap_225374_runs,
                                                                  &ctx->mainzisegmap_225374_total_runtime);
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                           0));
                                    }
                                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_225374,
                                                                          grid[0],
                                                                          grid[1],
                                                                          grid[2],
                                                                          segmap_group_sizze_225363,
                                                                          1, 1,
                                                                          0,
                                                                          NULL,
                                                                          kernel_args_238777,
                                                                          NULL));
                                    if (pevents != NULL)
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                           0));
                                    if (ctx->debugging) {
                                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                        time_end_238779 = get_wall_time();
                                        fprintf(ctx->log,
                                                "Kernel %s runtime: %ldus\n",
                                                "main.segmap_225374",
                                                time_end_238779 -
                                                time_start_238778);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_set_device(ctx, &ext_mem_231386,
                                                        &mem_231329,
                                                        "mem_231329") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_231385,
                                                        &mem_231333,
                                                        "mem_231333") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231333,
                                                          "mem_231333") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231329,
                                                          "mem_231329") != 0)
                                    return 1;
                            } else {
                                struct memblock_device mem_231338;
                                
                                mem_231338.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231338,
                                                          bytes_229427,
                                                          "mem_231338")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231342;
                                
                                mem_231342.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231342,
                                                          bytes_229427,
                                                          "mem_231342")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231346;
                                
                                mem_231346.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231346,
                                                          bytes_229427,
                                                          "mem_231346")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231350;
                                
                                mem_231350.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231350,
                                                          bytes_229427,
                                                          "mem_231350")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231354;
                                
                                mem_231354.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231354,
                                                          bytes_229427,
                                                          "mem_231354")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (slt64(q_t_203494 * (int64_t) 2,
                                          segred_group_sizze_225512)) {
                                    int64_t segment_sizze_nonzzero_236161 =
                                            smax64((int64_t) 1, q_t_203494);
                                    int64_t num_threads_236162 =
                                            num_groups_225513 *
                                            segred_group_sizze_225512;
                                    
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n",
                                                "\n# SegRed-small");
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_segments",
                                                (long long) (partition_sizze_203577 *
                                                             t_n_m_203650),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_t_203494, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segments_per_group",
                                                (long long) squot64(segred_group_sizze_225512,
                                                                    segment_sizze_nonzzero_236161),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "required_groups",
                                                (long long) sext_i64_i32(sdiv_up64(partition_sizze_203577 *
                                                                                   t_n_m_203650,
                                                                                   squot64(segred_group_sizze_225512,
                                                                                           segment_sizze_nonzzero_236161))),
                                                '\n');
                                    
                                    unsigned int shared_sizze_238791 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_225512;
                                    unsigned int shared_sizze_238793 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_225512;
                                    unsigned int shared_sizze_238795 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_225512;
                                    unsigned int shared_sizze_238797 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_225512;
                                    unsigned int shared_sizze_238799 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_225512;
                                    CUdeviceptr kernel_arg_238801 =
                                                ext_mem_229196.mem;
                                    CUdeviceptr kernel_arg_238802 =
                                                ext_mem_229197.mem;
                                    CUdeviceptr kernel_arg_238803 =
                                                ext_mem_229460.mem;
                                    CUdeviceptr kernel_arg_238804 =
                                                ext_mem_229461.mem;
                                    CUdeviceptr kernel_arg_238805 =
                                                mem_231320.mem;
                                    CUdeviceptr kernel_arg_238806 =
                                                mem_231338.mem;
                                    CUdeviceptr kernel_arg_238807 =
                                                mem_231342.mem;
                                    CUdeviceptr kernel_arg_238808 =
                                                mem_231346.mem;
                                    CUdeviceptr kernel_arg_238809 =
                                                mem_231350.mem;
                                    CUdeviceptr kernel_arg_238810 =
                                                mem_231354.mem;
                                    unsigned int shared_offset_238792 = 0;
                                    unsigned int shared_offset_238794 = 0 +
                                                 (shared_sizze_238791 + (8 -
                                                                         shared_sizze_238791 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_238796 = 0 +
                                                 (shared_sizze_238791 + (8 -
                                                                         shared_sizze_238791 %
                                                                         8) %
                                                  8) + (shared_sizze_238793 +
                                                        (8 -
                                                         shared_sizze_238793 %
                                                         8) % 8);
                                    unsigned int shared_offset_238798 = 0 +
                                                 (shared_sizze_238791 + (8 -
                                                                         shared_sizze_238791 %
                                                                         8) %
                                                  8) + (shared_sizze_238793 +
                                                        (8 -
                                                         shared_sizze_238793 %
                                                         8) % 8) +
                                                 (shared_sizze_238795 + (8 -
                                                                         shared_sizze_238795 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_238800 = 0 +
                                                 (shared_sizze_238791 + (8 -
                                                                         shared_sizze_238791 %
                                                                         8) %
                                                  8) + (shared_sizze_238793 +
                                                        (8 -
                                                         shared_sizze_238793 %
                                                         8) % 8) +
                                                 (shared_sizze_238795 + (8 -
                                                                         shared_sizze_238795 %
                                                                         8) %
                                                  8) + (shared_sizze_238797 +
                                                        (8 -
                                                         shared_sizze_238797 %
                                                         8) % 8);
                                    
                                    if ((((((1 && num_groups_225513 != 0) &&
                                            1 != 0) && 1 != 0) &&
                                          segred_group_sizze_225512 != 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_225513;
                                        grid[perm[1]] = 1;
                                        grid[perm[2]] = 1;
                                        
                                        void *kernel_args_238788[] =
                                             {&ctx->global_failure,
                                              &shared_offset_238792,
                                              &shared_offset_238794,
                                              &shared_offset_238796,
                                              &shared_offset_238798,
                                              &shared_offset_238800, &n_203490,
                                              &q_t_203494, &jump_t_203500,
                                              &partition_sizze_203577,
                                              &t_n_m_203650, &i_203670,
                                              &num_groups_225513,
                                              &segment_sizze_nonzzero_236161,
                                              &kernel_arg_238801,
                                              &kernel_arg_238802,
                                              &kernel_arg_238803,
                                              &kernel_arg_238804,
                                              &kernel_arg_238805,
                                              &kernel_arg_238806,
                                              &kernel_arg_238807,
                                              &kernel_arg_238808,
                                              &kernel_arg_238809,
                                              &kernel_arg_238810};
                                        int64_t time_start_238789 = 0,
                                                time_end_238790 = 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_225523",
                                                    (long) num_groups_225513,
                                                    (long) 1, (long) 1,
                                                    (long) segred_group_sizze_225512,
                                                    (long) 1, (long) 1,
                                                    (int) (0 +
                                                           (shared_sizze_238791 +
                                                            (8 -
                                                             shared_sizze_238791 %
                                                             8) % 8) +
                                                           (shared_sizze_238793 +
                                                            (8 -
                                                             shared_sizze_238793 %
                                                             8) % 8) +
                                                           (shared_sizze_238795 +
                                                            (8 -
                                                             shared_sizze_238795 %
                                                             8) % 8) +
                                                           (shared_sizze_238797 +
                                                            (8 -
                                                             shared_sizze_238797 %
                                                             8) % 8) +
                                                           (shared_sizze_238799 +
                                                            (8 -
                                                             shared_sizze_238799 %
                                                             8) % 8)));
                                            time_start_238789 = get_wall_time();
                                        }
                                        
                                        cudaEvent_t *pevents = NULL;
                                        
                                        if (ctx->profiling &&
                                            !ctx->profiling_paused) {
                                            pevents =
                                                cuda_get_events(&ctx->cuda,
                                                                &ctx->mainzisegred_small_225523_runs,
                                                                &ctx->mainzisegred_small_225523_total_runtime);
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                               0));
                                        }
                                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_small_225523,
                                                                              grid[0],
                                                                              grid[1],
                                                                              grid[2],
                                                                              segred_group_sizze_225512,
                                                                              1,
                                                                              1,
                                                                              0 +
                                                                              (shared_sizze_238791 +
                                                                               (8 -
                                                                                shared_sizze_238791 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238793 +
                                                                               (8 -
                                                                                shared_sizze_238793 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238795 +
                                                                               (8 -
                                                                                shared_sizze_238795 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238797 +
                                                                               (8 -
                                                                                shared_sizze_238797 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238799 +
                                                                               (8 -
                                                                                shared_sizze_238799 %
                                                                                8) %
                                                                               8),
                                                                              NULL,
                                                                              kernel_args_238788,
                                                                              NULL));
                                        if (pevents != NULL)
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                               0));
                                        if (ctx->debugging) {
                                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                            time_end_238790 = get_wall_time();
                                            fprintf(ctx->log,
                                                    "Kernel %s runtime: %ldus\n",
                                                    "main.segred_small_225523",
                                                    time_end_238790 -
                                                    time_start_238789);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                } else {
                                    int64_t groups_per_segment_236214 =
                                            sdiv_up64(num_groups_225513,
                                                      smax64((int64_t) 1,
                                                             partition_sizze_203577 *
                                                             t_n_m_203650));
                                    int64_t elements_per_thread_236215 =
                                            sdiv_up64(q_t_203494,
                                                      segred_group_sizze_225512 *
                                                      groups_per_segment_236214);
                                    int64_t virt_num_groups_236216 =
                                            groups_per_segment_236214 *
                                            (partition_sizze_203577 *
                                             t_n_m_203650);
                                    int64_t num_threads_236217 =
                                            num_groups_225513 *
                                            segred_group_sizze_225512;
                                    int64_t threads_per_segment_236218 =
                                            groups_per_segment_236214 *
                                            segred_group_sizze_225512;
                                    
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n",
                                                "\n# SegRed-large");
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_segments",
                                                (long long) (partition_sizze_203577 *
                                                             t_n_m_203650),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_t_203494, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "virt_num_groups",
                                                (long long) virt_num_groups_236216,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_groups",
                                                (long long) num_groups_225513,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "group_size",
                                                (long long) segred_group_sizze_225512,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "elems_per_thread",
                                                (long long) elements_per_thread_236215,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "groups_per_segment",
                                                (long long) groups_per_segment_236214,
                                                '\n');
                                    
                                    struct memblock_device
                                    segred_tmp_mem_236219;
                                    
                                    segred_tmp_mem_236219.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_236219,
                                                              (int64_t) 8 *
                                                              virt_num_groups_236216,
                                                              "segred_tmp_mem_236219")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_236221;
                                    
                                    segred_tmp_mem_236221.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_236221,
                                                              (int64_t) 8 *
                                                              virt_num_groups_236216,
                                                              "segred_tmp_mem_236221")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_236223;
                                    
                                    segred_tmp_mem_236223.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_236223,
                                                              (int64_t) 8 *
                                                              virt_num_groups_236216,
                                                              "segred_tmp_mem_236223")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_236225;
                                    
                                    segred_tmp_mem_236225.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_236225,
                                                              (int64_t) 8 *
                                                              virt_num_groups_236216,
                                                              "segred_tmp_mem_236225")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_236227;
                                    
                                    segred_tmp_mem_236227.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_236227,
                                                              (int64_t) 8 *
                                                              virt_num_groups_236216,
                                                              "segred_tmp_mem_236227")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    mainzicounter_mem_236229 =
                                    ctx->mainzicounter_mem_236229;
                                    unsigned int shared_sizze_238815 = 1;
                                    unsigned int shared_sizze_238817 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_225512;
                                    unsigned int shared_sizze_238819 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_225512;
                                    unsigned int shared_sizze_238821 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_225512;
                                    unsigned int shared_sizze_238823 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_225512;
                                    unsigned int shared_sizze_238825 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_225512;
                                    CUdeviceptr kernel_arg_238827 =
                                                ext_mem_229196.mem;
                                    CUdeviceptr kernel_arg_238828 =
                                                ext_mem_229197.mem;
                                    CUdeviceptr kernel_arg_238829 =
                                                ext_mem_229460.mem;
                                    CUdeviceptr kernel_arg_238830 =
                                                ext_mem_229461.mem;
                                    CUdeviceptr kernel_arg_238831 =
                                                mem_231320.mem;
                                    CUdeviceptr kernel_arg_238832 =
                                                mem_231338.mem;
                                    CUdeviceptr kernel_arg_238833 =
                                                mem_231342.mem;
                                    CUdeviceptr kernel_arg_238834 =
                                                mem_231346.mem;
                                    CUdeviceptr kernel_arg_238835 =
                                                mem_231350.mem;
                                    CUdeviceptr kernel_arg_238836 =
                                                mem_231354.mem;
                                    CUdeviceptr kernel_arg_238837 =
                                                segred_tmp_mem_236219.mem;
                                    CUdeviceptr kernel_arg_238838 =
                                                segred_tmp_mem_236221.mem;
                                    CUdeviceptr kernel_arg_238839 =
                                                segred_tmp_mem_236223.mem;
                                    CUdeviceptr kernel_arg_238840 =
                                                segred_tmp_mem_236225.mem;
                                    CUdeviceptr kernel_arg_238841 =
                                                segred_tmp_mem_236227.mem;
                                    CUdeviceptr kernel_arg_238842 =
                                                mainzicounter_mem_236229.mem;
                                    unsigned int shared_offset_238816 = 0;
                                    unsigned int shared_offset_238818 = 0 +
                                                 (shared_sizze_238815 + (8 -
                                                                         shared_sizze_238815 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_238820 = 0 +
                                                 (shared_sizze_238815 + (8 -
                                                                         shared_sizze_238815 %
                                                                         8) %
                                                  8) + (shared_sizze_238817 +
                                                        (8 -
                                                         shared_sizze_238817 %
                                                         8) % 8);
                                    unsigned int shared_offset_238822 = 0 +
                                                 (shared_sizze_238815 + (8 -
                                                                         shared_sizze_238815 %
                                                                         8) %
                                                  8) + (shared_sizze_238817 +
                                                        (8 -
                                                         shared_sizze_238817 %
                                                         8) % 8) +
                                                 (shared_sizze_238819 + (8 -
                                                                         shared_sizze_238819 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_238824 = 0 +
                                                 (shared_sizze_238815 + (8 -
                                                                         shared_sizze_238815 %
                                                                         8) %
                                                  8) + (shared_sizze_238817 +
                                                        (8 -
                                                         shared_sizze_238817 %
                                                         8) % 8) +
                                                 (shared_sizze_238819 + (8 -
                                                                         shared_sizze_238819 %
                                                                         8) %
                                                  8) + (shared_sizze_238821 +
                                                        (8 -
                                                         shared_sizze_238821 %
                                                         8) % 8);
                                    unsigned int shared_offset_238826 = 0 +
                                                 (shared_sizze_238815 + (8 -
                                                                         shared_sizze_238815 %
                                                                         8) %
                                                  8) + (shared_sizze_238817 +
                                                        (8 -
                                                         shared_sizze_238817 %
                                                         8) % 8) +
                                                 (shared_sizze_238819 + (8 -
                                                                         shared_sizze_238819 %
                                                                         8) %
                                                  8) + (shared_sizze_238821 +
                                                        (8 -
                                                         shared_sizze_238821 %
                                                         8) % 8) +
                                                 (shared_sizze_238823 + (8 -
                                                                         shared_sizze_238823 %
                                                                         8) %
                                                  8);
                                    
                                    if ((((((1 && num_groups_225513 != 0) &&
                                            1 != 0) && 1 != 0) &&
                                          segred_group_sizze_225512 != 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_225513;
                                        grid[perm[1]] = 1;
                                        grid[perm[2]] = 1;
                                        
                                        void *kernel_args_238812[] =
                                             {&ctx->global_failure,
                                              &shared_offset_238816,
                                              &shared_offset_238818,
                                              &shared_offset_238820,
                                              &shared_offset_238822,
                                              &shared_offset_238824,
                                              &shared_offset_238826, &n_203490,
                                              &q_t_203494, &jump_t_203500,
                                              &partition_sizze_203577,
                                              &t_n_m_203650, &i_203670,
                                              &num_groups_225513,
                                              &groups_per_segment_236214,
                                              &elements_per_thread_236215,
                                              &virt_num_groups_236216,
                                              &threads_per_segment_236218,
                                              &kernel_arg_238827,
                                              &kernel_arg_238828,
                                              &kernel_arg_238829,
                                              &kernel_arg_238830,
                                              &kernel_arg_238831,
                                              &kernel_arg_238832,
                                              &kernel_arg_238833,
                                              &kernel_arg_238834,
                                              &kernel_arg_238835,
                                              &kernel_arg_238836,
                                              &kernel_arg_238837,
                                              &kernel_arg_238838,
                                              &kernel_arg_238839,
                                              &kernel_arg_238840,
                                              &kernel_arg_238841,
                                              &kernel_arg_238842};
                                        int64_t time_start_238813 = 0,
                                                time_end_238814 = 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_225523",
                                                    (long) num_groups_225513,
                                                    (long) 1, (long) 1,
                                                    (long) segred_group_sizze_225512,
                                                    (long) 1, (long) 1,
                                                    (int) (0 +
                                                           (shared_sizze_238815 +
                                                            (8 -
                                                             shared_sizze_238815 %
                                                             8) % 8) +
                                                           (shared_sizze_238817 +
                                                            (8 -
                                                             shared_sizze_238817 %
                                                             8) % 8) +
                                                           (shared_sizze_238819 +
                                                            (8 -
                                                             shared_sizze_238819 %
                                                             8) % 8) +
                                                           (shared_sizze_238821 +
                                                            (8 -
                                                             shared_sizze_238821 %
                                                             8) % 8) +
                                                           (shared_sizze_238823 +
                                                            (8 -
                                                             shared_sizze_238823 %
                                                             8) % 8) +
                                                           (shared_sizze_238825 +
                                                            (8 -
                                                             shared_sizze_238825 %
                                                             8) % 8)));
                                            time_start_238813 = get_wall_time();
                                        }
                                        
                                        cudaEvent_t *pevents = NULL;
                                        
                                        if (ctx->profiling &&
                                            !ctx->profiling_paused) {
                                            pevents =
                                                cuda_get_events(&ctx->cuda,
                                                                &ctx->mainzisegred_large_225523_runs,
                                                                &ctx->mainzisegred_large_225523_total_runtime);
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                               0));
                                        }
                                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_large_225523,
                                                                              grid[0],
                                                                              grid[1],
                                                                              grid[2],
                                                                              segred_group_sizze_225512,
                                                                              1,
                                                                              1,
                                                                              0 +
                                                                              (shared_sizze_238815 +
                                                                               (8 -
                                                                                shared_sizze_238815 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238817 +
                                                                               (8 -
                                                                                shared_sizze_238817 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238819 +
                                                                               (8 -
                                                                                shared_sizze_238819 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238821 +
                                                                               (8 -
                                                                                shared_sizze_238821 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238823 +
                                                                               (8 -
                                                                                shared_sizze_238823 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238825 +
                                                                               (8 -
                                                                                shared_sizze_238825 %
                                                                                8) %
                                                                               8),
                                                                              NULL,
                                                                              kernel_args_238812,
                                                                              NULL));
                                        if (pevents != NULL)
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                               0));
                                        if (ctx->debugging) {
                                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                            time_end_238814 = get_wall_time();
                                            fprintf(ctx->log,
                                                    "Kernel %s runtime: %ldus\n",
                                                    "main.segred_large_225523",
                                                    time_end_238814 -
                                                    time_start_238813);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_236227,
                                                              "segred_tmp_mem_236227") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_236225,
                                                              "segred_tmp_mem_236225") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_236223,
                                                              "segred_tmp_mem_236223") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_236221,
                                                              "segred_tmp_mem_236221") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_236219,
                                                              "segred_tmp_mem_236219") !=
                                        0)
                                        return 1;
                                }
                                
                                int64_t segmap_usable_groups_225574 =
                                        sdiv_up64(nest_sizze_210118,
                                                  segmap_group_sizze_225573);
                                struct memblock_device mem_231359;
                                
                                mem_231359.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231359,
                                                          bytes_229427,
                                                          "mem_231359")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231363;
                                
                                mem_231363.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231363,
                                                          bytes_229427,
                                                          "mem_231363")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231367;
                                
                                mem_231367.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231367,
                                                          bytes_229427,
                                                          "mem_231367")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231371;
                                
                                mem_231371.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231371,
                                                          bytes_229427,
                                                          "mem_231371")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231375;
                                
                                mem_231375.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231375,
                                                          bytes_229427,
                                                          "mem_231375")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                                
                                CUdeviceptr kernel_arg_238846 = mem_231338.mem;
                                CUdeviceptr kernel_arg_238847 = mem_231342.mem;
                                CUdeviceptr kernel_arg_238848 = mem_231346.mem;
                                CUdeviceptr kernel_arg_238849 = mem_231350.mem;
                                CUdeviceptr kernel_arg_238850 = mem_231354.mem;
                                CUdeviceptr kernel_arg_238851 = mem_231359.mem;
                                CUdeviceptr kernel_arg_238852 = mem_231363.mem;
                                CUdeviceptr kernel_arg_238853 = mem_231367.mem;
                                CUdeviceptr kernel_arg_238854 = mem_231371.mem;
                                CUdeviceptr kernel_arg_238855 = mem_231375.mem;
                                
                                if ((((((1 && segmap_usable_groups_225574 !=
                                         0) && 1 != 0) && 1 != 0) &&
                                      segmap_group_sizze_225573 != 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_225574;
                                    grid[perm[1]] = 1;
                                    grid[perm[2]] = 1;
                                    
                                    void *kernel_args_238843[] =
                                         {&ctx->global_failure,
                                          &partition_sizze_203577,
                                          &t_n_m_203650, &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_238844 = 0,
                                            time_end_238845 = 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_225582",
                                                (long) segmap_usable_groups_225574,
                                                (long) 1, (long) 1,
                                                (long) segmap_group_sizze_225573,
                                                (long) 1, (long) 1, (int) 0);
                                        time_start_238844 = get_wall_time();
                                    }
                                    
                                    cudaEvent_t *pevents = NULL;
                                    
                                    if (ctx->profiling &&
                                        !ctx->profiling_paused) {
                                        pevents = cuda_get_events(&ctx->cuda,
                                                                  &ctx->mainzisegmap_225582_runs,
                                                                  &ctx->mainzisegmap_225582_total_runtime);
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                           0));
                                    }
                                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_225582,
                                                                          grid[0],
                                                                          grid[1],
                                                                          grid[2],
                                                                          segmap_group_sizze_225573,
                                                                          1, 1,
                                                                          0,
                                                                          NULL,
                                                                          kernel_args_238843,
                                                                          NULL));
                                    if (pevents != NULL)
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                           0));
                                    if (ctx->debugging) {
                                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                        time_end_238845 = get_wall_time();
                                        fprintf(ctx->log,
                                                "Kernel %s runtime: %ldus\n",
                                                "main.segmap_225582",
                                                time_end_238845 -
                                                time_start_238844);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_unref_device(ctx, &mem_231338,
                                                          "mem_231338") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231342,
                                                          "mem_231342") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231346,
                                                          "mem_231346") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231350,
                                                          "mem_231350") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231354,
                                                          "mem_231354") != 0)
                                    return 1;
                                
                                struct memblock_device mem_231380;
                                
                                mem_231380.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231380,
                                                          bytes_229427,
                                                          "mem_231380")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231384;
                                
                                mem_231384.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231384,
                                                          bytes_229427,
                                                          "mem_231384")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (slt64(q_t_203494 * (int64_t) 2,
                                          segred_group_sizze_225616)) {
                                    int64_t segment_sizze_nonzzero_236299 =
                                            smax64((int64_t) 1, q_t_203494);
                                    int64_t num_threads_236300 =
                                            num_groups_225617 *
                                            segred_group_sizze_225616;
                                    
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n",
                                                "\n# SegRed-small");
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_segments",
                                                (long long) (partition_sizze_203577 *
                                                             t_n_m_203650),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_t_203494, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segments_per_group",
                                                (long long) squot64(segred_group_sizze_225616,
                                                                    segment_sizze_nonzzero_236299),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "required_groups",
                                                (long long) sext_i64_i32(sdiv_up64(partition_sizze_203577 *
                                                                                   t_n_m_203650,
                                                                                   squot64(segred_group_sizze_225616,
                                                                                           segment_sizze_nonzzero_236299))),
                                                '\n');
                                    
                                    unsigned int shared_sizze_238859 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_225616;
                                    unsigned int shared_sizze_238861 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_225616;
                                    CUdeviceptr kernel_arg_238863 =
                                                ext_mem_229196.mem;
                                    CUdeviceptr kernel_arg_238864 =
                                                ext_mem_229197.mem;
                                    CUdeviceptr kernel_arg_238865 =
                                                ext_mem_229460.mem;
                                    CUdeviceptr kernel_arg_238866 =
                                                ext_mem_229461.mem;
                                    CUdeviceptr kernel_arg_238867 =
                                                mem_231320.mem;
                                    CUdeviceptr kernel_arg_238868 =
                                                mem_231324.mem;
                                    CUdeviceptr kernel_arg_238869 =
                                                mem_231359.mem;
                                    CUdeviceptr kernel_arg_238870 =
                                                mem_231363.mem;
                                    CUdeviceptr kernel_arg_238871 =
                                                mem_231367.mem;
                                    CUdeviceptr kernel_arg_238872 =
                                                mem_231371.mem;
                                    CUdeviceptr kernel_arg_238873 =
                                                mem_231375.mem;
                                    CUdeviceptr kernel_arg_238874 =
                                                mem_231380.mem;
                                    CUdeviceptr kernel_arg_238875 =
                                                mem_231384.mem;
                                    unsigned int shared_offset_238860 = 0;
                                    unsigned int shared_offset_238862 = 0 +
                                                 (shared_sizze_238859 + (8 -
                                                                         shared_sizze_238859 %
                                                                         8) %
                                                  8);
                                    
                                    if ((((((1 && num_groups_225617 != 0) &&
                                            1 != 0) && 1 != 0) &&
                                          segred_group_sizze_225616 != 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_225617;
                                        grid[perm[1]] = 1;
                                        grid[perm[2]] = 1;
                                        
                                        void *kernel_args_238856[] =
                                             {&ctx->global_failure,
                                              &shared_offset_238860,
                                              &shared_offset_238862, &n_203490,
                                              &q_t_203494, &jump_t_203500,
                                              &partition_sizze_203577,
                                              &t_n_m_203650, &i_203670,
                                              &num_groups_225617,
                                              &segment_sizze_nonzzero_236299,
                                              &kernel_arg_238863,
                                              &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};
                                        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.segred_small_225624",
                                                    (long) num_groups_225617,
                                                    (long) 1, (long) 1,
                                                    (long) segred_group_sizze_225616,
                                                    (long) 1, (long) 1,
                                                    (int) (0 +
                                                           (shared_sizze_238859 +
                                                            (8 -
                                                             shared_sizze_238859 %
                                                             8) % 8) +
                                                           (shared_sizze_238861 +
                                                            (8 -
                                                             shared_sizze_238861 %
                                                             8) % 8)));
                                            time_start_238857 = get_wall_time();
                                        }
                                        
                                        cudaEvent_t *pevents = NULL;
                                        
                                        if (ctx->profiling &&
                                            !ctx->profiling_paused) {
                                            pevents =
                                                cuda_get_events(&ctx->cuda,
                                                                &ctx->mainzisegred_small_225624_runs,
                                                                &ctx->mainzisegred_small_225624_total_runtime);
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                               0));
                                        }
                                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_small_225624,
                                                                              grid[0],
                                                                              grid[1],
                                                                              grid[2],
                                                                              segred_group_sizze_225616,
                                                                              1,
                                                                              1,
                                                                              0 +
                                                                              (shared_sizze_238859 +
                                                                               (8 -
                                                                                shared_sizze_238859 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238861 +
                                                                               (8 -
                                                                                shared_sizze_238861 %
                                                                                8) %
                                                                               8),
                                                                              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.segred_small_225624",
                                                    time_end_238858 -
                                                    time_start_238857);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                } else {
                                    int64_t groups_per_segment_236334 =
                                            sdiv_up64(num_groups_225617,
                                                      smax64((int64_t) 1,
                                                             partition_sizze_203577 *
                                                             t_n_m_203650));
                                    int64_t elements_per_thread_236335 =
                                            sdiv_up64(q_t_203494,
                                                      segred_group_sizze_225616 *
                                                      groups_per_segment_236334);
                                    int64_t virt_num_groups_236336 =
                                            groups_per_segment_236334 *
                                            (partition_sizze_203577 *
                                             t_n_m_203650);
                                    int64_t num_threads_236337 =
                                            num_groups_225617 *
                                            segred_group_sizze_225616;
                                    int64_t threads_per_segment_236338 =
                                            groups_per_segment_236334 *
                                            segred_group_sizze_225616;
                                    
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n",
                                                "\n# SegRed-large");
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_segments",
                                                (long long) (partition_sizze_203577 *
                                                             t_n_m_203650),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_t_203494, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "virt_num_groups",
                                                (long long) virt_num_groups_236336,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_groups",
                                                (long long) num_groups_225617,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "group_size",
                                                (long long) segred_group_sizze_225616,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "elems_per_thread",
                                                (long long) elements_per_thread_236335,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "groups_per_segment",
                                                (long long) groups_per_segment_236334,
                                                '\n');
                                    
                                    struct memblock_device
                                    segred_tmp_mem_236339;
                                    
                                    segred_tmp_mem_236339.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_236339,
                                                              (int64_t) 8 *
                                                              virt_num_groups_236336,
                                                              "segred_tmp_mem_236339")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_236341;
                                    
                                    segred_tmp_mem_236341.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_236341,
                                                              (int64_t) 8 *
                                                              virt_num_groups_236336,
                                                              "segred_tmp_mem_236341")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    mainzicounter_mem_236343 =
                                    ctx->mainzicounter_mem_236343;
                                    unsigned int shared_sizze_238880 = 1;
                                    unsigned int shared_sizze_238882 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_225616;
                                    unsigned int shared_sizze_238884 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_225616;
                                    CUdeviceptr kernel_arg_238886 =
                                                ext_mem_229196.mem;
                                    CUdeviceptr kernel_arg_238887 =
                                                ext_mem_229197.mem;
                                    CUdeviceptr kernel_arg_238888 =
                                                ext_mem_229460.mem;
                                    CUdeviceptr kernel_arg_238889 =
                                                ext_mem_229461.mem;
                                    CUdeviceptr kernel_arg_238890 =
                                                mem_231320.mem;
                                    CUdeviceptr kernel_arg_238891 =
                                                mem_231324.mem;
                                    CUdeviceptr kernel_arg_238892 =
                                                mem_231359.mem;
                                    CUdeviceptr kernel_arg_238893 =
                                                mem_231363.mem;
                                    CUdeviceptr kernel_arg_238894 =
                                                mem_231367.mem;
                                    CUdeviceptr kernel_arg_238895 =
                                                mem_231371.mem;
                                    CUdeviceptr kernel_arg_238896 =
                                                mem_231375.mem;
                                    CUdeviceptr kernel_arg_238897 =
                                                mem_231380.mem;
                                    CUdeviceptr kernel_arg_238898 =
                                                mem_231384.mem;
                                    CUdeviceptr kernel_arg_238899 =
                                                segred_tmp_mem_236339.mem;
                                    CUdeviceptr kernel_arg_238900 =
                                                segred_tmp_mem_236341.mem;
                                    CUdeviceptr kernel_arg_238901 =
                                                mainzicounter_mem_236343.mem;
                                    unsigned int shared_offset_238881 = 0;
                                    unsigned int shared_offset_238883 = 0 +
                                                 (shared_sizze_238880 + (8 -
                                                                         shared_sizze_238880 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_238885 = 0 +
                                                 (shared_sizze_238880 + (8 -
                                                                         shared_sizze_238880 %
                                                                         8) %
                                                  8) + (shared_sizze_238882 +
                                                        (8 -
                                                         shared_sizze_238882 %
                                                         8) % 8);
                                    
                                    if ((((((1 && num_groups_225617 != 0) &&
                                            1 != 0) && 1 != 0) &&
                                          segred_group_sizze_225616 != 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_225617;
                                        grid[perm[1]] = 1;
                                        grid[perm[2]] = 1;
                                        
                                        void *kernel_args_238877[] =
                                             {&ctx->global_failure,
                                              &shared_offset_238881,
                                              &shared_offset_238883,
                                              &shared_offset_238885, &n_203490,
                                              &q_t_203494, &jump_t_203500,
                                              &partition_sizze_203577,
                                              &t_n_m_203650, &i_203670,
                                              &num_groups_225617,
                                              &groups_per_segment_236334,
                                              &elements_per_thread_236335,
                                              &virt_num_groups_236336,
                                              &threads_per_segment_236338,
                                              &kernel_arg_238886,
                                              &kernel_arg_238887,
                                              &kernel_arg_238888,
                                              &kernel_arg_238889,
                                              &kernel_arg_238890,
                                              &kernel_arg_238891,
                                              &kernel_arg_238892,
                                              &kernel_arg_238893,
                                              &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_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.segred_large_225624",
                                                    (long) num_groups_225617,
                                                    (long) 1, (long) 1,
                                                    (long) segred_group_sizze_225616,
                                                    (long) 1, (long) 1,
                                                    (int) (0 +
                                                           (shared_sizze_238880 +
                                                            (8 -
                                                             shared_sizze_238880 %
                                                             8) % 8) +
                                                           (shared_sizze_238882 +
                                                            (8 -
                                                             shared_sizze_238882 %
                                                             8) % 8) +
                                                           (shared_sizze_238884 +
                                                            (8 -
                                                             shared_sizze_238884 %
                                                             8) % 8)));
                                            time_start_238878 = get_wall_time();
                                        }
                                        
                                        cudaEvent_t *pevents = NULL;
                                        
                                        if (ctx->profiling &&
                                            !ctx->profiling_paused) {
                                            pevents =
                                                cuda_get_events(&ctx->cuda,
                                                                &ctx->mainzisegred_large_225624_runs,
                                                                &ctx->mainzisegred_large_225624_total_runtime);
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                               0));
                                        }
                                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_large_225624,
                                                                              grid[0],
                                                                              grid[1],
                                                                              grid[2],
                                                                              segred_group_sizze_225616,
                                                                              1,
                                                                              1,
                                                                              0 +
                                                                              (shared_sizze_238880 +
                                                                               (8 -
                                                                                shared_sizze_238880 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238882 +
                                                                               (8 -
                                                                                shared_sizze_238882 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238884 +
                                                                               (8 -
                                                                                shared_sizze_238884 %
                                                                                8) %
                                                                               8),
                                                                              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.segred_large_225624",
                                                    time_end_238879 -
                                                    time_start_238878);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_236341,
                                                              "segred_tmp_mem_236341") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_236339,
                                                              "segred_tmp_mem_236339") !=
                                        0)
                                        return 1;
                                }
                                if (memblock_unref_device(ctx, &mem_231359,
                                                          "mem_231359") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231363,
                                                          "mem_231363") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231367,
                                                          "mem_231367") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231371,
                                                          "mem_231371") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231375,
                                                          "mem_231375") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_231386,
                                                        &mem_231380,
                                                        "mem_231380") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_231385,
                                                        &mem_231384,
                                                        "mem_231384") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231384,
                                                          "mem_231384") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231380,
                                                          "mem_231380") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231375,
                                                          "mem_231375") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231371,
                                                          "mem_231371") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231367,
                                                          "mem_231367") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231363,
                                                          "mem_231363") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231359,
                                                          "mem_231359") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231354,
                                                          "mem_231354") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231350,
                                                          "mem_231350") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231346,
                                                          "mem_231346") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231342,
                                                          "mem_231342") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231338,
                                                          "mem_231338") != 0)
                                    return 1;
                            }
                            if (memblock_unref_device(ctx, &mem_231320,
                                                      "mem_231320") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231324,
                                                      "mem_231324") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_231398,
                                                    &ext_mem_231386,
                                                    "ext_mem_231386") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_231397,
                                                    &ext_mem_231385,
                                                    "ext_mem_231385") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231385,
                                                      "ext_mem_231385") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231386,
                                                      "ext_mem_231386") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231324,
                                                      "mem_231324") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231320,
                                                      "mem_231320") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231315,
                                                      "mem_231315") != 0)
                                return 1;
                        }
                        if (memblock_set_device(ctx, &ext_mem_231400,
                                                &ext_mem_231398,
                                                "ext_mem_231398") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_231399,
                                                &ext_mem_231397,
                                                "ext_mem_231397") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231397,
                                                  "ext_mem_231397") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231398,
                                                  "ext_mem_231398") != 0)
                            return 1;
                    }
                    if (memblock_set_device(ctx, &ext_mem_231402,
                                            &ext_mem_231400,
                                            "ext_mem_231400") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_231401,
                                            &ext_mem_231399,
                                            "ext_mem_231399") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231399,
                                              "ext_mem_231399") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231400,
                                              "ext_mem_231400") != 0)
                        return 1;
                }
                if (memblock_set_device(ctx, &ext_mem_231505, &ext_mem_231402,
                                        "ext_mem_231402") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_231504, &ext_mem_231401,
                                        "ext_mem_231401") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231401,
                                          "ext_mem_231401") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231402,
                                          "ext_mem_231402") != 0)
                    return 1;
            } else {
                bool match_lit_206214 = (int64_t) 0 == d_t_203497;
                int64_t binop_y_231423 = (int64_t) 8 * q_t_203494;
                int64_t bytes_231424 = smax64((int64_t) 0, binop_y_231423);
                struct memblock_device ext_mem_231503;
                
                ext_mem_231503.references = NULL;
                
                struct memblock_device ext_mem_231502;
                
                ext_mem_231502.references = NULL;
                if (match_lit_206214) {
                    struct memblock_device mem_231406;
                    
                    mem_231406.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_231406, bytes_229427,
                                              "mem_231406")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (futrts_builtinzhreplicate_f64(ctx, mem_231406,
                                                      partition_sizze_203577 *
                                                      t_n_m_203650, 0.0) != 0) {
                        if (memblock_unref_device(ctx, &mem_231406,
                                                  "mem_231406") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231502,
                                                  "ext_mem_231502") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231503,
                                                  "ext_mem_231503") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231504,
                                                  "ext_mem_231504") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231505,
                                                  "ext_mem_231505") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230920,
                                                  "mem_230920") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230914,
                                                  "ext_mem_230914") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230907,
                                                  "ext_mem_230907") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230908,
                                                  "ext_mem_230908") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230546,
                                                  "ext_mem_230546") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230529,
                                                  "ext_mem_230529") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230512,
                                                  "ext_mem_230512") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230494,
                                                  "ext_mem_230494") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230486,
                                                  "ext_mem_230486") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230487,
                                                  "ext_mem_230487") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229515,
                                                  "mem_param_229515") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229507,
                                                  "mem_param_229507") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231517,
                                                  "ext_mem_231517") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231518,
                                                  "ext_mem_231518") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229493,
                                                  "mem_param_229493") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229485,
                                                  "mem_param_229485") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229477,
                                                  "mem_param_229477") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231860,
                                                  "ext_mem_231860") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231861,
                                                  "ext_mem_231861") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231862,
                                                  "ext_mem_231862") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230551,
                                                  "mem_230551") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230534,
                                                  "mem_230534") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230517,
                                                  "mem_230517") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230500,
                                                  "mem_230500") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229531,
                                                  "mem_229531") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229526,
                                                  "mem_229526") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229520,
                                                  "mem_229520") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229469,
                                                  "mem_229469") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229465,
                                                  "mem_229465") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229460,
                                                  "ext_mem_229460") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229461,
                                                  "ext_mem_229461") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229411,
                                                  "ext_mem_229411") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229412,
                                                  "ext_mem_229412") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229362,
                                                  "ext_mem_229362") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229363,
                                                  "ext_mem_229363") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229264,
                                                  "ext_mem_229264") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229265,
                                                  "ext_mem_229265") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229206,
                                                  "mem_229206") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229200,
                                                  "mem_229200") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229196,
                                                  "ext_mem_229196") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229197,
                                                  "ext_mem_229197") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229164,
                                                  "mem_229164") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229161,
                                                  "mem_229161") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229157,
                                                  "mem_229157") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229155,
                                                  "mem_229155") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229152,
                                                  "mem_229152") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229148,
                                                  "mem_229148") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232249,
                                                  "mem_out_232249") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232248,
                                                  "mem_out_232248") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232247,
                                                  "mem_out_232247") != 0)
                            return 1;
                        err = 1;
                        goto cleanup;
                    }
                    
                    int64_t segmap_group_sizze_225868;
                    
                    segmap_group_sizze_225868 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_225842;
                    
                    int64_t segmap_usable_groups_225869 =
                            sdiv_up64(nest_sizze_207000,
                                      segmap_group_sizze_225868);
                    struct memblock_device mem_231411;
                    
                    mem_231411.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_231411, bytes_229177,
                                              "mem_231411")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                    
                    CUdeviceptr kernel_arg_238905 = mem_229161.mem;
                    CUdeviceptr kernel_arg_238906 = mem_230920.mem;
                    CUdeviceptr kernel_arg_238907 = mem_231411.mem;
                    
                    if ((((((1 && segmap_usable_groups_225869 != 0) && 1 !=
                            0) && 1 != 0) && segmap_group_sizze_225868 != 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_225869;
                        grid[perm[1]] = 1;
                        grid[perm[2]] = 1;
                        
                        void *kernel_args_238902[] = {&ctx->global_failure,
                                                      &n_203490,
                                                      &partition_sizze_203577,
                                                      &kernel_arg_238905,
                                                      &kernel_arg_238906,
                                                      &kernel_arg_238907};
                        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.segmap_225873",
                                    (long) segmap_usable_groups_225869,
                                    (long) 1, (long) 1,
                                    (long) segmap_group_sizze_225868, (long) 1,
                                    (long) 1, (int) 0);
                            time_start_238903 = get_wall_time();
                        }
                        
                        cudaEvent_t *pevents = NULL;
                        
                        if (ctx->profiling && !ctx->profiling_paused) {
                            pevents = cuda_get_events(&ctx->cuda,
                                                      &ctx->mainzisegmap_225873_runs,
                                                      &ctx->mainzisegmap_225873_total_runtime);
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                        }
                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_225873,
                                                              grid[0], grid[1],
                                                              grid[2],
                                                              segmap_group_sizze_225868,
                                                              1, 1, 0, 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.segmap_225873", time_end_238904 -
                                    time_start_238903);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    
                    int64_t segmap_group_sizze_225884;
                    
                    segmap_group_sizze_225884 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_225786;
                    
                    int64_t segmap_usable_groups_225885 =
                            sdiv_up64(nest_sizze_207000,
                                      segmap_group_sizze_225884);
                    struct memblock_device mem_231416;
                    
                    mem_231416.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_231416, bytes_229177,
                                              "mem_231416")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mem_231420;
                    
                    mem_231420.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_231420, bytes_229177,
                                              "mem_231420")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                    
                    CUdeviceptr kernel_arg_238911 = ext_mem_229197.mem;
                    CUdeviceptr kernel_arg_238912 = mem_param_229493.mem;
                    CUdeviceptr kernel_arg_238913 = mem_231411.mem;
                    CUdeviceptr kernel_arg_238914 = mem_231416.mem;
                    CUdeviceptr kernel_arg_238915 = mem_231420.mem;
                    
                    if ((((((1 && segmap_usable_groups_225885 != 0) && 1 !=
                            0) && 1 != 0) && segmap_group_sizze_225884 != 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_225885;
                        grid[perm[1]] = 1;
                        grid[perm[2]] = 1;
                        
                        void *kernel_args_238908[] = {&ctx->global_failure,
                                                      &ctx->failure_is_an_option,
                                                      &ctx->global_failure_args,
                                                      &n_203490,
                                                      &partition_sizze_203577,
                                                      &ctx_param_ext_229488,
                                                      &ctx_param_ext_229489,
                                                      &ctx_param_ext_229491,
                                                      &kernel_arg_238911,
                                                      &kernel_arg_238912,
                                                      &kernel_arg_238913,
                                                      &kernel_arg_238914,
                                                      &kernel_arg_238915};
                        int64_t time_start_238909 = 0, time_end_238910 = 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_225890",
                                    (long) segmap_usable_groups_225885,
                                    (long) 1, (long) 1,
                                    (long) segmap_group_sizze_225884, (long) 1,
                                    (long) 1, (int) 0);
                            time_start_238909 = get_wall_time();
                        }
                        
                        cudaEvent_t *pevents = NULL;
                        
                        if (ctx->profiling && !ctx->profiling_paused) {
                            pevents = cuda_get_events(&ctx->cuda,
                                                      &ctx->mainzisegmap_225890_runs,
                                                      &ctx->mainzisegmap_225890_total_runtime);
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                        }
                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_225890,
                                                              grid[0], grid[1],
                                                              grid[2],
                                                              segmap_group_sizze_225884,
                                                              1, 1, 0, NULL,
                                                              kernel_args_238908,
                                                              NULL));
                        if (pevents != NULL)
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                        if (ctx->debugging) {
                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                            time_end_238910 = get_wall_time();
                            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                    "main.segmap_225890", time_end_238910 -
                                    time_start_238909);
                        }
                    }
                    ctx->failure_is_an_option = 1;
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    if (memblock_unref_device(ctx, &mem_231411, "mem_231411") !=
                        0)
                        return 1;
                    
                    struct memblock_device mem_231430;
                    
                    mem_231430.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_231430, bytes_229427,
                                              "mem_231430")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                    
                    unsigned int shared_sizze_238919 = (int64_t) 8 * q_t_203494;
                    unsigned int shared_sizze_238921 = (int64_t) 8 * q_t_203494;
                    unsigned int shared_sizze_238923 = bytes_231424;
                    CUdeviceptr kernel_arg_238925 = ext_mem_229196.mem;
                    CUdeviceptr kernel_arg_238926 = ext_mem_229197.mem;
                    CUdeviceptr kernel_arg_238927 = ext_mem_229460.mem;
                    CUdeviceptr kernel_arg_238928 = ext_mem_229461.mem;
                    CUdeviceptr kernel_arg_238929 = mem_231416.mem;
                    CUdeviceptr kernel_arg_238930 = mem_231420.mem;
                    CUdeviceptr kernel_arg_238931 = mem_231430.mem;
                    unsigned int shared_offset_238920 = 0;
                    unsigned int shared_offset_238922 = 0 +
                                 (shared_sizze_238919 + (8 -
                                                         shared_sizze_238919 %
                                                         8) % 8);
                    unsigned int shared_offset_238924 = 0 +
                                 (shared_sizze_238919 + (8 -
                                                         shared_sizze_238919 %
                                                         8) % 8) +
                                 (shared_sizze_238921 + (8 -
                                                         shared_sizze_238921 %
                                                         8) % 8);
                    
                    if ((((((1 && nest_sizze_210118 != 0) && 1 != 0) && 1 !=
                           0) && q_t_203494 != 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_210118;
                        grid[perm[1]] = 1;
                        grid[perm[2]] = 1;
                        
                        void *kernel_args_238916[] = {&ctx->global_failure,
                                                      &shared_offset_238920,
                                                      &shared_offset_238922,
                                                      &shared_offset_238924,
                                                      &n_203490, &q_t_203494,
                                                      &jump_t_203500,
                                                      &partition_sizze_203577,
                                                      &t_n_m_203650, &i_203670,
                                                      &kernel_arg_238925,
                                                      &kernel_arg_238926,
                                                      &kernel_arg_238927,
                                                      &kernel_arg_238928,
                                                      &kernel_arg_238929,
                                                      &kernel_arg_238930,
                                                      &kernel_arg_238931};
                        int64_t time_start_238917 = 0, time_end_238918 = 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_225917",
                                    (long) nest_sizze_210118, (long) 1,
                                    (long) 1, (long) q_t_203494, (long) 1,
                                    (long) 1, (int) (0 + (shared_sizze_238919 +
                                                          (8 -
                                                           shared_sizze_238919 %
                                                           8) % 8) +
                                                     (shared_sizze_238921 + (8 -
                                                                             shared_sizze_238921 %
                                                                             8) %
                                                      8) +
                                                     (shared_sizze_238923 + (8 -
                                                                             shared_sizze_238923 %
                                                                             8) %
                                                      8)));
                            time_start_238917 = get_wall_time();
                        }
                        
                        cudaEvent_t *pevents = NULL;
                        
                        if (ctx->profiling && !ctx->profiling_paused) {
                            pevents = cuda_get_events(&ctx->cuda,
                                                      &ctx->mainzisegmap_intragroup_225917_runs,
                                                      &ctx->mainzisegmap_intragroup_225917_total_runtime);
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                        }
                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_intragroup_225917,
                                                              grid[0], grid[1],
                                                              grid[2],
                                                              q_t_203494, 1, 1,
                                                              0 +
                                                              (shared_sizze_238919 +
                                                               (8 -
                                                                shared_sizze_238919 %
                                                                8) % 8) +
                                                              (shared_sizze_238921 +
                                                               (8 -
                                                                shared_sizze_238921 %
                                                                8) % 8) +
                                                              (shared_sizze_238923 +
                                                               (8 -
                                                                shared_sizze_238923 %
                                                                8) % 8), NULL,
                                                              kernel_args_238916,
                                                              NULL));
                        if (pevents != NULL)
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                        if (ctx->debugging) {
                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                            time_end_238918 = get_wall_time();
                            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                    "main.segmap_intragroup_225917",
                                    time_end_238918 - time_start_238917);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    if (memblock_unref_device(ctx, &mem_231416, "mem_231416") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_231420, "mem_231420") !=
                        0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_231503, &mem_231430,
                                            "mem_231430") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_231502, &mem_231406,
                                            "mem_231406") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_231430, "mem_231430") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_231420, "mem_231420") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_231416, "mem_231416") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_231411, "mem_231411") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_231406, "mem_231406") !=
                        0)
                        return 1;
                } else {
                    bool match_lit_206291 = (int64_t) 1 == d_t_203497;
                    struct memblock_device ext_mem_231501;
                    
                    ext_mem_231501.references = NULL;
                    
                    struct memblock_device ext_mem_231500;
                    
                    ext_mem_231500.references = NULL;
                    if (match_lit_206291) {
                        int64_t segmap_group_sizze_226180;
                        
                        segmap_group_sizze_226180 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_226154;
                        
                        int64_t segmap_usable_groups_226181 =
                                sdiv_up64(nest_sizze_207000,
                                          segmap_group_sizze_226180);
                        struct memblock_device mem_231435;
                        
                        mem_231435.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231435,
                                                  bytes_229177, "mem_231435")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        
                        CUdeviceptr kernel_arg_238935 = mem_229161.mem;
                        CUdeviceptr kernel_arg_238936 = mem_230920.mem;
                        CUdeviceptr kernel_arg_238937 = mem_231435.mem;
                        
                        if ((((((1 && segmap_usable_groups_226181 != 0) && 1 !=
                                0) && 1 != 0) && segmap_group_sizze_226180 !=
                              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_226181;
                            grid[perm[1]] = 1;
                            grid[perm[2]] = 1;
                            
                            void *kernel_args_238932[] = {&ctx->global_failure,
                                                          &n_203490,
                                                          &partition_sizze_203577,
                                                          &kernel_arg_238935,
                                                          &kernel_arg_238936,
                                                          &kernel_arg_238937};
                            int64_t time_start_238933 = 0, time_end_238934 = 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_226185",
                                        (long) segmap_usable_groups_226181,
                                        (long) 1, (long) 1,
                                        (long) segmap_group_sizze_226180,
                                        (long) 1, (long) 1, (int) 0);
                                time_start_238933 = get_wall_time();
                            }
                            
                            cudaEvent_t *pevents = NULL;
                            
                            if (ctx->profiling && !ctx->profiling_paused) {
                                pevents = cuda_get_events(&ctx->cuda,
                                                          &ctx->mainzisegmap_226185_runs,
                                                          &ctx->mainzisegmap_226185_total_runtime);
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                   0));
                            }
                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_226185,
                                                                  grid[0],
                                                                  grid[1],
                                                                  grid[2],
                                                                  segmap_group_sizze_226180,
                                                                  1, 1, 0, NULL,
                                                                  kernel_args_238932,
                                                                  NULL));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                            if (ctx->debugging) {
                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                time_end_238934 = get_wall_time();
                                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                        "main.segmap_226185", time_end_238934 -
                                        time_start_238933);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        
                        int64_t segmap_group_sizze_226196;
                        
                        segmap_group_sizze_226196 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_226098;
                        
                        int64_t segmap_usable_groups_226197 =
                                sdiv_up64(nest_sizze_207000,
                                          segmap_group_sizze_226196);
                        struct memblock_device mem_231440;
                        
                        mem_231440.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231440,
                                                  bytes_229177, "mem_231440")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_231444;
                        
                        mem_231444.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231444,
                                                  bytes_229177, "mem_231444")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        
                        CUdeviceptr kernel_arg_238941 = ext_mem_229197.mem;
                        CUdeviceptr kernel_arg_238942 = mem_param_229493.mem;
                        CUdeviceptr kernel_arg_238943 = mem_231435.mem;
                        CUdeviceptr kernel_arg_238944 = mem_231440.mem;
                        CUdeviceptr kernel_arg_238945 = mem_231444.mem;
                        
                        if ((((((1 && segmap_usable_groups_226197 != 0) && 1 !=
                                0) && 1 != 0) && segmap_group_sizze_226196 !=
                              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_226197;
                            grid[perm[1]] = 1;
                            grid[perm[2]] = 1;
                            
                            void *kernel_args_238938[] = {&ctx->global_failure,
                                                          &ctx->failure_is_an_option,
                                                          &ctx->global_failure_args,
                                                          &n_203490,
                                                          &partition_sizze_203577,
                                                          &ctx_param_ext_229488,
                                                          &ctx_param_ext_229489,
                                                          &ctx_param_ext_229491,
                                                          &kernel_arg_238941,
                                                          &kernel_arg_238942,
                                                          &kernel_arg_238943,
                                                          &kernel_arg_238944,
                                                          &kernel_arg_238945};
                            int64_t time_start_238939 = 0, time_end_238940 = 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_226202",
                                        (long) segmap_usable_groups_226197,
                                        (long) 1, (long) 1,
                                        (long) segmap_group_sizze_226196,
                                        (long) 1, (long) 1, (int) 0);
                                time_start_238939 = get_wall_time();
                            }
                            
                            cudaEvent_t *pevents = NULL;
                            
                            if (ctx->profiling && !ctx->profiling_paused) {
                                pevents = cuda_get_events(&ctx->cuda,
                                                          &ctx->mainzisegmap_226202_runs,
                                                          &ctx->mainzisegmap_226202_total_runtime);
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                   0));
                            }
                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_226202,
                                                                  grid[0],
                                                                  grid[1],
                                                                  grid[2],
                                                                  segmap_group_sizze_226196,
                                                                  1, 1, 0, NULL,
                                                                  kernel_args_238938,
                                                                  NULL));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                            if (ctx->debugging) {
                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                time_end_238940 = get_wall_time();
                                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                        "main.segmap_226202", time_end_238940 -
                                        time_start_238939);
                            }
                        }
                        ctx->failure_is_an_option = 1;
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_unref_device(ctx, &mem_231435,
                                                  "mem_231435") != 0)
                            return 1;
                        
                        struct memblock_device mem_231457;
                        
                        mem_231457.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231457,
                                                  bytes_229427, "mem_231457")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_231461;
                        
                        mem_231461.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231461,
                                                  bytes_229427, "mem_231461")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        
                        unsigned int shared_sizze_238949 = (int64_t) 8 *
                                     q_t_203494;
                        unsigned int shared_sizze_238951 = (int64_t) 8 *
                                     q_t_203494;
                        unsigned int shared_sizze_238953 = (int64_t) 8 *
                                     q_t_203494;
                        unsigned int shared_sizze_238955 = (int64_t) 8 *
                                     q_t_203494;
                        unsigned int shared_sizze_238957 = (int64_t) 8 *
                                     q_t_203494;
                        unsigned int shared_sizze_238959 = bytes_231424;
                        unsigned int shared_sizze_238961 = bytes_231424;
                        CUdeviceptr kernel_arg_238963 = ext_mem_229196.mem;
                        CUdeviceptr kernel_arg_238964 = ext_mem_229197.mem;
                        CUdeviceptr kernel_arg_238965 = ext_mem_229460.mem;
                        CUdeviceptr kernel_arg_238966 = ext_mem_229461.mem;
                        CUdeviceptr kernel_arg_238967 = mem_231440.mem;
                        CUdeviceptr kernel_arg_238968 = mem_231444.mem;
                        CUdeviceptr kernel_arg_238969 = mem_231457.mem;
                        CUdeviceptr kernel_arg_238970 = mem_231461.mem;
                        unsigned int shared_offset_238950 = 0;
                        unsigned int shared_offset_238952 = 0 +
                                     (shared_sizze_238949 + (8 -
                                                             shared_sizze_238949 %
                                                             8) % 8);
                        unsigned int shared_offset_238954 = 0 +
                                     (shared_sizze_238949 + (8 -
                                                             shared_sizze_238949 %
                                                             8) % 8) +
                                     (shared_sizze_238951 + (8 -
                                                             shared_sizze_238951 %
                                                             8) % 8);
                        unsigned int shared_offset_238956 = 0 +
                                     (shared_sizze_238949 + (8 -
                                                             shared_sizze_238949 %
                                                             8) % 8) +
                                     (shared_sizze_238951 + (8 -
                                                             shared_sizze_238951 %
                                                             8) % 8) +
                                     (shared_sizze_238953 + (8 -
                                                             shared_sizze_238953 %
                                                             8) % 8);
                        unsigned int shared_offset_238958 = 0 +
                                     (shared_sizze_238949 + (8 -
                                                             shared_sizze_238949 %
                                                             8) % 8) +
                                     (shared_sizze_238951 + (8 -
                                                             shared_sizze_238951 %
                                                             8) % 8) +
                                     (shared_sizze_238953 + (8 -
                                                             shared_sizze_238953 %
                                                             8) % 8) +
                                     (shared_sizze_238955 + (8 -
                                                             shared_sizze_238955 %
                                                             8) % 8);
                        unsigned int shared_offset_238960 = 0 +
                                     (shared_sizze_238949 + (8 -
                                                             shared_sizze_238949 %
                                                             8) % 8) +
                                     (shared_sizze_238951 + (8 -
                                                             shared_sizze_238951 %
                                                             8) % 8) +
                                     (shared_sizze_238953 + (8 -
                                                             shared_sizze_238953 %
                                                             8) % 8) +
                                     (shared_sizze_238955 + (8 -
                                                             shared_sizze_238955 %
                                                             8) % 8) +
                                     (shared_sizze_238957 + (8 -
                                                             shared_sizze_238957 %
                                                             8) % 8);
                        unsigned int shared_offset_238962 = 0 +
                                     (shared_sizze_238949 + (8 -
                                                             shared_sizze_238949 %
                                                             8) % 8) +
                                     (shared_sizze_238951 + (8 -
                                                             shared_sizze_238951 %
                                                             8) % 8) +
                                     (shared_sizze_238953 + (8 -
                                                             shared_sizze_238953 %
                                                             8) % 8) +
                                     (shared_sizze_238955 + (8 -
                                                             shared_sizze_238955 %
                                                             8) % 8) +
                                     (shared_sizze_238957 + (8 -
                                                             shared_sizze_238957 %
                                                             8) % 8) +
                                     (shared_sizze_238959 + (8 -
                                                             shared_sizze_238959 %
                                                             8) % 8);
                        
                        if ((((((1 && nest_sizze_210118 != 0) && 1 != 0) && 1 !=
                               0) && q_t_203494 != 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_210118;
                            grid[perm[1]] = 1;
                            grid[perm[2]] = 1;
                            
                            void *kernel_args_238946[] = {&ctx->global_failure,
                                                          &shared_offset_238950,
                                                          &shared_offset_238952,
                                                          &shared_offset_238954,
                                                          &shared_offset_238956,
                                                          &shared_offset_238958,
                                                          &shared_offset_238960,
                                                          &shared_offset_238962,
                                                          &n_203490,
                                                          &q_t_203494,
                                                          &jump_t_203500,
                                                          &partition_sizze_203577,
                                                          &t_n_m_203650,
                                                          &i_203670,
                                                          &kernel_arg_238963,
                                                          &kernel_arg_238964,
                                                          &kernel_arg_238965,
                                                          &kernel_arg_238966,
                                                          &kernel_arg_238967,
                                                          &kernel_arg_238968,
                                                          &kernel_arg_238969,
                                                          &kernel_arg_238970};
                            int64_t time_start_238947 = 0, time_end_238948 = 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_226230",
                                        (long) nest_sizze_210118, (long) 1,
                                        (long) 1, (long) q_t_203494, (long) 1,
                                        (long) 1, (int) (0 +
                                                         (shared_sizze_238949 +
                                                          (8 -
                                                           shared_sizze_238949 %
                                                           8) % 8) +
                                                         (shared_sizze_238951 +
                                                          (8 -
                                                           shared_sizze_238951 %
                                                           8) % 8) +
                                                         (shared_sizze_238953 +
                                                          (8 -
                                                           shared_sizze_238953 %
                                                           8) % 8) +
                                                         (shared_sizze_238955 +
                                                          (8 -
                                                           shared_sizze_238955 %
                                                           8) % 8) +
                                                         (shared_sizze_238957 +
                                                          (8 -
                                                           shared_sizze_238957 %
                                                           8) % 8) +
                                                         (shared_sizze_238959 +
                                                          (8 -
                                                           shared_sizze_238959 %
                                                           8) % 8) +
                                                         (shared_sizze_238961 +
                                                          (8 -
                                                           shared_sizze_238961 %
                                                           8) % 8)));
                                time_start_238947 = get_wall_time();
                            }
                            
                            cudaEvent_t *pevents = NULL;
                            
                            if (ctx->profiling && !ctx->profiling_paused) {
                                pevents = cuda_get_events(&ctx->cuda,
                                                          &ctx->mainzisegmap_intragroup_226230_runs,
                                                          &ctx->mainzisegmap_intragroup_226230_total_runtime);
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                   0));
                            }
                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_intragroup_226230,
                                                                  grid[0],
                                                                  grid[1],
                                                                  grid[2],
                                                                  q_t_203494, 1,
                                                                  1, 0 +
                                                                  (shared_sizze_238949 +
                                                                   (8 -
                                                                    shared_sizze_238949 %
                                                                    8) % 8) +
                                                                  (shared_sizze_238951 +
                                                                   (8 -
                                                                    shared_sizze_238951 %
                                                                    8) % 8) +
                                                                  (shared_sizze_238953 +
                                                                   (8 -
                                                                    shared_sizze_238953 %
                                                                    8) % 8) +
                                                                  (shared_sizze_238955 +
                                                                   (8 -
                                                                    shared_sizze_238955 %
                                                                    8) % 8) +
                                                                  (shared_sizze_238957 +
                                                                   (8 -
                                                                    shared_sizze_238957 %
                                                                    8) % 8) +
                                                                  (shared_sizze_238959 +
                                                                   (8 -
                                                                    shared_sizze_238959 %
                                                                    8) % 8) +
                                                                  (shared_sizze_238961 +
                                                                   (8 -
                                                                    shared_sizze_238961 %
                                                                    8) % 8),
                                                                  NULL,
                                                                  kernel_args_238946,
                                                                  NULL));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                            if (ctx->debugging) {
                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                time_end_238948 = get_wall_time();
                                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                        "main.segmap_intragroup_226230",
                                        time_end_238948 - time_start_238947);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_unref_device(ctx, &mem_231440,
                                                  "mem_231440") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231444,
                                                  "mem_231444") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_231501,
                                                &mem_231457, "mem_231457") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_231500,
                                                &mem_231461, "mem_231461") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231461,
                                                  "mem_231461") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231457,
                                                  "mem_231457") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231444,
                                                  "mem_231444") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231440,
                                                  "mem_231440") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231435,
                                                  "mem_231435") != 0)
                            return 1;
                    } else {
                        int64_t segmap_group_sizze_226584;
                        
                        segmap_group_sizze_226584 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_226558;
                        
                        int64_t segmap_usable_groups_226585 =
                                sdiv_up64(nest_sizze_207000,
                                          segmap_group_sizze_226584);
                        struct memblock_device mem_231466;
                        
                        mem_231466.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231466,
                                                  bytes_229177, "mem_231466")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        
                        CUdeviceptr kernel_arg_238974 = mem_229161.mem;
                        CUdeviceptr kernel_arg_238975 = mem_230920.mem;
                        CUdeviceptr kernel_arg_238976 = mem_231466.mem;
                        
                        if ((((((1 && segmap_usable_groups_226585 != 0) && 1 !=
                                0) && 1 != 0) && segmap_group_sizze_226584 !=
                              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_226585;
                            grid[perm[1]] = 1;
                            grid[perm[2]] = 1;
                            
                            void *kernel_args_238971[] = {&ctx->global_failure,
                                                          &n_203490,
                                                          &partition_sizze_203577,
                                                          &kernel_arg_238974,
                                                          &kernel_arg_238975,
                                                          &kernel_arg_238976};
                            int64_t time_start_238972 = 0, time_end_238973 = 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_226589",
                                        (long) segmap_usable_groups_226585,
                                        (long) 1, (long) 1,
                                        (long) segmap_group_sizze_226584,
                                        (long) 1, (long) 1, (int) 0);
                                time_start_238972 = get_wall_time();
                            }
                            
                            cudaEvent_t *pevents = NULL;
                            
                            if (ctx->profiling && !ctx->profiling_paused) {
                                pevents = cuda_get_events(&ctx->cuda,
                                                          &ctx->mainzisegmap_226589_runs,
                                                          &ctx->mainzisegmap_226589_total_runtime);
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                   0));
                            }
                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_226589,
                                                                  grid[0],
                                                                  grid[1],
                                                                  grid[2],
                                                                  segmap_group_sizze_226584,
                                                                  1, 1, 0, NULL,
                                                                  kernel_args_238971,
                                                                  NULL));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                            if (ctx->debugging) {
                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                time_end_238973 = get_wall_time();
                                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                        "main.segmap_226589", time_end_238973 -
                                        time_start_238972);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        
                        int64_t segmap_group_sizze_226600;
                        
                        segmap_group_sizze_226600 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_226502;
                        
                        int64_t segmap_usable_groups_226601 =
                                sdiv_up64(nest_sizze_207000,
                                          segmap_group_sizze_226600);
                        struct memblock_device mem_231471;
                        
                        mem_231471.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231471,
                                                  bytes_229177, "mem_231471")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_231475;
                        
                        mem_231475.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231475,
                                                  bytes_229177, "mem_231475")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        
                        CUdeviceptr kernel_arg_238980 = ext_mem_229197.mem;
                        CUdeviceptr kernel_arg_238981 = mem_param_229493.mem;
                        CUdeviceptr kernel_arg_238982 = mem_231466.mem;
                        CUdeviceptr kernel_arg_238983 = mem_231471.mem;
                        CUdeviceptr kernel_arg_238984 = mem_231475.mem;
                        
                        if ((((((1 && segmap_usable_groups_226601 != 0) && 1 !=
                                0) && 1 != 0) && segmap_group_sizze_226600 !=
                              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_226601;
                            grid[perm[1]] = 1;
                            grid[perm[2]] = 1;
                            
                            void *kernel_args_238977[] = {&ctx->global_failure,
                                                          &ctx->failure_is_an_option,
                                                          &ctx->global_failure_args,
                                                          &n_203490,
                                                          &partition_sizze_203577,
                                                          &ctx_param_ext_229488,
                                                          &ctx_param_ext_229489,
                                                          &ctx_param_ext_229491,
                                                          &kernel_arg_238980,
                                                          &kernel_arg_238981,
                                                          &kernel_arg_238982,
                                                          &kernel_arg_238983,
                                                          &kernel_arg_238984};
                            int64_t time_start_238978 = 0, time_end_238979 = 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_226606",
                                        (long) segmap_usable_groups_226601,
                                        (long) 1, (long) 1,
                                        (long) segmap_group_sizze_226600,
                                        (long) 1, (long) 1, (int) 0);
                                time_start_238978 = get_wall_time();
                            }
                            
                            cudaEvent_t *pevents = NULL;
                            
                            if (ctx->profiling && !ctx->profiling_paused) {
                                pevents = cuda_get_events(&ctx->cuda,
                                                          &ctx->mainzisegmap_226606_runs,
                                                          &ctx->mainzisegmap_226606_total_runtime);
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                   0));
                            }
                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_226606,
                                                                  grid[0],
                                                                  grid[1],
                                                                  grid[2],
                                                                  segmap_group_sizze_226600,
                                                                  1, 1, 0, NULL,
                                                                  kernel_args_238977,
                                                                  NULL));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                            if (ctx->debugging) {
                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                time_end_238979 = get_wall_time();
                                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                        "main.segmap_226606", time_end_238979 -
                                        time_start_238978);
                            }
                        }
                        ctx->failure_is_an_option = 1;
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_unref_device(ctx, &mem_231466,
                                                  "mem_231466") != 0)
                            return 1;
                        
                        struct memblock_device mem_231495;
                        
                        mem_231495.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231495,
                                                  bytes_229427, "mem_231495")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_231499;
                        
                        mem_231499.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231499,
                                                  bytes_229427, "mem_231499")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        
                        unsigned int shared_sizze_238988 = (int64_t) 8 *
                                     q_t_203494;
                        unsigned int shared_sizze_238990 = (int64_t) 8 *
                                     q_t_203494;
                        unsigned int shared_sizze_238992 = (int64_t) 8 *
                                     q_t_203494;
                        unsigned int shared_sizze_238994 = (int64_t) 8 *
                                     q_t_203494;
                        unsigned int shared_sizze_238996 = (int64_t) 8 *
                                     q_t_203494;
                        unsigned int shared_sizze_238998 = (int64_t) 8 *
                                     q_t_203494;
                        unsigned int shared_sizze_239000 = (int64_t) 8 *
                                     q_t_203494;
                        unsigned int shared_sizze_239002 = bytes_231424;
                        unsigned int shared_sizze_239004 = bytes_231424;
                        unsigned int shared_sizze_239006 = bytes_231424;
                        unsigned int shared_sizze_239008 = bytes_231424;
                        CUdeviceptr kernel_arg_239010 = ext_mem_229196.mem;
                        CUdeviceptr kernel_arg_239011 = ext_mem_229197.mem;
                        CUdeviceptr kernel_arg_239012 = ext_mem_229460.mem;
                        CUdeviceptr kernel_arg_239013 = ext_mem_229461.mem;
                        CUdeviceptr kernel_arg_239014 = mem_231471.mem;
                        CUdeviceptr kernel_arg_239015 = mem_231475.mem;
                        CUdeviceptr kernel_arg_239016 = mem_231495.mem;
                        CUdeviceptr kernel_arg_239017 = mem_231499.mem;
                        unsigned int shared_offset_238989 = 0;
                        unsigned int shared_offset_238991 = 0 +
                                     (shared_sizze_238988 + (8 -
                                                             shared_sizze_238988 %
                                                             8) % 8);
                        unsigned int shared_offset_238993 = 0 +
                                     (shared_sizze_238988 + (8 -
                                                             shared_sizze_238988 %
                                                             8) % 8) +
                                     (shared_sizze_238990 + (8 -
                                                             shared_sizze_238990 %
                                                             8) % 8);
                        unsigned int shared_offset_238995 = 0 +
                                     (shared_sizze_238988 + (8 -
                                                             shared_sizze_238988 %
                                                             8) % 8) +
                                     (shared_sizze_238990 + (8 -
                                                             shared_sizze_238990 %
                                                             8) % 8) +
                                     (shared_sizze_238992 + (8 -
                                                             shared_sizze_238992 %
                                                             8) % 8);
                        unsigned int shared_offset_238997 = 0 +
                                     (shared_sizze_238988 + (8 -
                                                             shared_sizze_238988 %
                                                             8) % 8) +
                                     (shared_sizze_238990 + (8 -
                                                             shared_sizze_238990 %
                                                             8) % 8) +
                                     (shared_sizze_238992 + (8 -
                                                             shared_sizze_238992 %
                                                             8) % 8) +
                                     (shared_sizze_238994 + (8 -
                                                             shared_sizze_238994 %
                                                             8) % 8);
                        unsigned int shared_offset_238999 = 0 +
                                     (shared_sizze_238988 + (8 -
                                                             shared_sizze_238988 %
                                                             8) % 8) +
                                     (shared_sizze_238990 + (8 -
                                                             shared_sizze_238990 %
                                                             8) % 8) +
                                     (shared_sizze_238992 + (8 -
                                                             shared_sizze_238992 %
                                                             8) % 8) +
                                     (shared_sizze_238994 + (8 -
                                                             shared_sizze_238994 %
                                                             8) % 8) +
                                     (shared_sizze_238996 + (8 -
                                                             shared_sizze_238996 %
                                                             8) % 8);
                        unsigned int shared_offset_239001 = 0 +
                                     (shared_sizze_238988 + (8 -
                                                             shared_sizze_238988 %
                                                             8) % 8) +
                                     (shared_sizze_238990 + (8 -
                                                             shared_sizze_238990 %
                                                             8) % 8) +
                                     (shared_sizze_238992 + (8 -
                                                             shared_sizze_238992 %
                                                             8) % 8) +
                                     (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);
                        unsigned int shared_offset_239003 = 0 +
                                     (shared_sizze_238988 + (8 -
                                                             shared_sizze_238988 %
                                                             8) % 8) +
                                     (shared_sizze_238990 + (8 -
                                                             shared_sizze_238990 %
                                                             8) % 8) +
                                     (shared_sizze_238992 + (8 -
                                                             shared_sizze_238992 %
                                                             8) % 8) +
                                     (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) +
                                     (shared_sizze_239000 + (8 -
                                                             shared_sizze_239000 %
                                                             8) % 8);
                        unsigned int shared_offset_239005 = 0 +
                                     (shared_sizze_238988 + (8 -
                                                             shared_sizze_238988 %
                                                             8) % 8) +
                                     (shared_sizze_238990 + (8 -
                                                             shared_sizze_238990 %
                                                             8) % 8) +
                                     (shared_sizze_238992 + (8 -
                                                             shared_sizze_238992 %
                                                             8) % 8) +
                                     (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) +
                                     (shared_sizze_239000 + (8 -
                                                             shared_sizze_239000 %
                                                             8) % 8) +
                                     (shared_sizze_239002 + (8 -
                                                             shared_sizze_239002 %
                                                             8) % 8);
                        unsigned int shared_offset_239007 = 0 +
                                     (shared_sizze_238988 + (8 -
                                                             shared_sizze_238988 %
                                                             8) % 8) +
                                     (shared_sizze_238990 + (8 -
                                                             shared_sizze_238990 %
                                                             8) % 8) +
                                     (shared_sizze_238992 + (8 -
                                                             shared_sizze_238992 %
                                                             8) % 8) +
                                     (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) +
                                     (shared_sizze_239000 + (8 -
                                                             shared_sizze_239000 %
                                                             8) % 8) +
                                     (shared_sizze_239002 + (8 -
                                                             shared_sizze_239002 %
                                                             8) % 8) +
                                     (shared_sizze_239004 + (8 -
                                                             shared_sizze_239004 %
                                                             8) % 8);
                        unsigned int shared_offset_239009 = 0 +
                                     (shared_sizze_238988 + (8 -
                                                             shared_sizze_238988 %
                                                             8) % 8) +
                                     (shared_sizze_238990 + (8 -
                                                             shared_sizze_238990 %
                                                             8) % 8) +
                                     (shared_sizze_238992 + (8 -
                                                             shared_sizze_238992 %
                                                             8) % 8) +
                                     (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) +
                                     (shared_sizze_239000 + (8 -
                                                             shared_sizze_239000 %
                                                             8) % 8) +
                                     (shared_sizze_239002 + (8 -
                                                             shared_sizze_239002 %
                                                             8) % 8) +
                                     (shared_sizze_239004 + (8 -
                                                             shared_sizze_239004 %
                                                             8) % 8) +
                                     (shared_sizze_239006 + (8 -
                                                             shared_sizze_239006 %
                                                             8) % 8);
                        
                        if ((((((1 && nest_sizze_210118 != 0) && 1 != 0) && 1 !=
                               0) && q_t_203494 != 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_210118;
                            grid[perm[1]] = 1;
                            grid[perm[2]] = 1;
                            
                            void *kernel_args_238985[] = {&ctx->global_failure,
                                                          &shared_offset_238989,
                                                          &shared_offset_238991,
                                                          &shared_offset_238993,
                                                          &shared_offset_238995,
                                                          &shared_offset_238997,
                                                          &shared_offset_238999,
                                                          &shared_offset_239001,
                                                          &shared_offset_239003,
                                                          &shared_offset_239005,
                                                          &shared_offset_239007,
                                                          &shared_offset_239009,
                                                          &n_203490,
                                                          &q_t_203494,
                                                          &jump_t_203500,
                                                          &partition_sizze_203577,
                                                          &t_n_m_203650,
                                                          &i_203670,
                                                          &kernel_arg_239010,
                                                          &kernel_arg_239011,
                                                          &kernel_arg_239012,
                                                          &kernel_arg_239013,
                                                          &kernel_arg_239014,
                                                          &kernel_arg_239015,
                                                          &kernel_arg_239016,
                                                          &kernel_arg_239017};
                            int64_t time_start_238986 = 0, time_end_238987 = 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_226634",
                                        (long) nest_sizze_210118, (long) 1,
                                        (long) 1, (long) q_t_203494, (long) 1,
                                        (long) 1, (int) (0 +
                                                         (shared_sizze_238988 +
                                                          (8 -
                                                           shared_sizze_238988 %
                                                           8) % 8) +
                                                         (shared_sizze_238990 +
                                                          (8 -
                                                           shared_sizze_238990 %
                                                           8) % 8) +
                                                         (shared_sizze_238992 +
                                                          (8 -
                                                           shared_sizze_238992 %
                                                           8) % 8) +
                                                         (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) +
                                                         (shared_sizze_239000 +
                                                          (8 -
                                                           shared_sizze_239000 %
                                                           8) % 8) +
                                                         (shared_sizze_239002 +
                                                          (8 -
                                                           shared_sizze_239002 %
                                                           8) % 8) +
                                                         (shared_sizze_239004 +
                                                          (8 -
                                                           shared_sizze_239004 %
                                                           8) % 8) +
                                                         (shared_sizze_239006 +
                                                          (8 -
                                                           shared_sizze_239006 %
                                                           8) % 8) +
                                                         (shared_sizze_239008 +
                                                          (8 -
                                                           shared_sizze_239008 %
                                                           8) % 8)));
                                time_start_238986 = get_wall_time();
                            }
                            
                            cudaEvent_t *pevents = NULL;
                            
                            if (ctx->profiling && !ctx->profiling_paused) {
                                pevents = cuda_get_events(&ctx->cuda,
                                                          &ctx->mainzisegmap_intragroup_226634_runs,
                                                          &ctx->mainzisegmap_intragroup_226634_total_runtime);
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                   0));
                            }
                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_intragroup_226634,
                                                                  grid[0],
                                                                  grid[1],
                                                                  grid[2],
                                                                  q_t_203494, 1,
                                                                  1, 0 +
                                                                  (shared_sizze_238988 +
                                                                   (8 -
                                                                    shared_sizze_238988 %
                                                                    8) % 8) +
                                                                  (shared_sizze_238990 +
                                                                   (8 -
                                                                    shared_sizze_238990 %
                                                                    8) % 8) +
                                                                  (shared_sizze_238992 +
                                                                   (8 -
                                                                    shared_sizze_238992 %
                                                                    8) % 8) +
                                                                  (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) +
                                                                  (shared_sizze_239000 +
                                                                   (8 -
                                                                    shared_sizze_239000 %
                                                                    8) % 8) +
                                                                  (shared_sizze_239002 +
                                                                   (8 -
                                                                    shared_sizze_239002 %
                                                                    8) % 8) +
                                                                  (shared_sizze_239004 +
                                                                   (8 -
                                                                    shared_sizze_239004 %
                                                                    8) % 8) +
                                                                  (shared_sizze_239006 +
                                                                   (8 -
                                                                    shared_sizze_239006 %
                                                                    8) % 8) +
                                                                  (shared_sizze_239008 +
                                                                   (8 -
                                                                    shared_sizze_239008 %
                                                                    8) % 8),
                                                                  NULL,
                                                                  kernel_args_238985,
                                                                  NULL));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                            if (ctx->debugging) {
                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                time_end_238987 = get_wall_time();
                                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                        "main.segmap_intragroup_226634",
                                        time_end_238987 - time_start_238986);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_unref_device(ctx, &mem_231471,
                                                  "mem_231471") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231475,
                                                  "mem_231475") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_231501,
                                                &mem_231495, "mem_231495") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_231500,
                                                &mem_231499, "mem_231499") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231499,
                                                  "mem_231499") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231495,
                                                  "mem_231495") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231475,
                                                  "mem_231475") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231471,
                                                  "mem_231471") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231466,
                                                  "mem_231466") != 0)
                            return 1;
                    }
                    if (memblock_set_device(ctx, &ext_mem_231503,
                                            &ext_mem_231501,
                                            "ext_mem_231501") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_231502,
                                            &ext_mem_231500,
                                            "ext_mem_231500") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231500,
                                              "ext_mem_231500") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231501,
                                              "ext_mem_231501") != 0)
                        return 1;
                }
                if (memblock_set_device(ctx, &ext_mem_231505, &ext_mem_231503,
                                        "ext_mem_231503") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_231504, &ext_mem_231502,
                                        "ext_mem_231502") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231502,
                                          "ext_mem_231502") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231503,
                                          "ext_mem_231503") != 0)
                    return 1;
            }
            
            struct memblock_device ext_mem_231511;
            
            ext_mem_231511.references = NULL;
            if (cond_204108) {
                bool zzero_206580 = jump_t_203500 == (int64_t) 0;
                bool nonzzero_206581 = !zzero_206580;
                bool nonzzero_cert_206582;
                
                if (!nonzzero_206581) {
                    ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                                           "division by zero",
                                           "-> #0  loess.fut:547:20-27\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:546:3-550:9\n   #5  stl.fut:304:23-75\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:303:15-305:43\n   #9  stl.fut:415:61-429:75\n   #10 stl.fut:455:3-469:34\n   #11 stl.fut:439:1-469:34\n");
                    if (memblock_unref_device(ctx, &ext_mem_231511,
                                              "ext_mem_231511") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231504,
                                              "ext_mem_231504") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231505,
                                              "ext_mem_231505") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230920, "mem_230920") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230914,
                                              "ext_mem_230914") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230907,
                                              "ext_mem_230907") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230908,
                                              "ext_mem_230908") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230546,
                                              "ext_mem_230546") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230529,
                                              "ext_mem_230529") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230512,
                                              "ext_mem_230512") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230494,
                                              "ext_mem_230494") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230486,
                                              "ext_mem_230486") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230487,
                                              "ext_mem_230487") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229515,
                                              "mem_param_229515") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229507,
                                              "mem_param_229507") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231517,
                                              "ext_mem_231517") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231518,
                                              "ext_mem_231518") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229493,
                                              "mem_param_229493") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229485,
                                              "mem_param_229485") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229477,
                                              "mem_param_229477") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231860,
                                              "ext_mem_231860") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231861,
                                              "ext_mem_231861") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231862,
                                              "ext_mem_231862") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230551, "mem_230551") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230534, "mem_230534") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230517, "mem_230517") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230500, "mem_230500") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229531, "mem_229531") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229526, "mem_229526") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229520, "mem_229520") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229469, "mem_229469") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229465, "mem_229465") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229460,
                                              "ext_mem_229460") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229461,
                                              "ext_mem_229461") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229411,
                                              "ext_mem_229411") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229412,
                                              "ext_mem_229412") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229362,
                                              "ext_mem_229362") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229363,
                                              "ext_mem_229363") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229264,
                                              "ext_mem_229264") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229265,
                                              "ext_mem_229265") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229206, "mem_229206") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229200, "mem_229200") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229196,
                                              "ext_mem_229196") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229197,
                                              "ext_mem_229197") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229164, "mem_229164") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229161, "mem_229161") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229157, "mem_229157") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229155, "mem_229155") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229152, "mem_229152") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229148, "mem_229148") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232249,
                                              "mem_out_232249") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232248,
                                              "mem_out_232248") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232247,
                                              "mem_out_232247") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                int64_t y_206583 = sub64(t_n_m_203650, (int64_t) 1);
                int64_t segmap_group_sizze_226889;
                
                segmap_group_sizze_226889 =
                    *ctx->tuning_params.mainzisegmap_group_sizze_226771;
                
                int64_t segmap_usable_groups_226890 =
                        sdiv_up64(nest_sizze_207000, segmap_group_sizze_226889);
                struct memblock_device mem_231510;
                
                mem_231510.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231510, bytes_229177,
                                          "mem_231510")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                
                CUdeviceptr kernel_arg_239021 = ext_mem_231504.mem;
                CUdeviceptr kernel_arg_239022 = ext_mem_231505.mem;
                CUdeviceptr kernel_arg_239023 = mem_231510.mem;
                
                if ((((((1 && segmap_usable_groups_226890 != 0) && 1 != 0) &&
                       1 != 0) && segmap_group_sizze_226889 != 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_226890;
                    grid[perm[1]] = 1;
                    grid[perm[2]] = 1;
                    
                    void *kernel_args_239018[] = {&ctx->global_failure,
                                                  &ctx->failure_is_an_option,
                                                  &ctx->global_failure_args,
                                                  &n_203490, &jump_t_203500,
                                                  &partition_sizze_203577,
                                                  &t_n_m_203650, &i_203670,
                                                  &y_206583, &kernel_arg_239021,
                                                  &kernel_arg_239022,
                                                  &kernel_arg_239023};
                    int64_t time_start_239019 = 0, time_end_239020 = 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_226894",
                                (long) segmap_usable_groups_226890, (long) 1,
                                (long) 1, (long) segmap_group_sizze_226889,
                                (long) 1, (long) 1, (int) 0);
                        time_start_239019 = get_wall_time();
                    }
                    
                    cudaEvent_t *pevents = NULL;
                    
                    if (ctx->profiling && !ctx->profiling_paused) {
                        pevents = cuda_get_events(&ctx->cuda,
                                                  &ctx->mainzisegmap_226894_runs,
                                                  &ctx->mainzisegmap_226894_total_runtime);
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                    }
                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_226894,
                                                          grid[0], grid[1],
                                                          grid[2],
                                                          segmap_group_sizze_226889,
                                                          1, 1, 0, NULL,
                                                          kernel_args_239018,
                                                          NULL));
                    if (pevents != NULL)
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                    if (ctx->debugging) {
                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                        time_end_239020 = get_wall_time();
                        fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                "main.segmap_226894", time_end_239020 -
                                time_start_239019);
                    }
                }
                ctx->failure_is_an_option = 1;
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_set_device(ctx, &ext_mem_231511, &mem_231510,
                                        "mem_231510") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231510, "mem_231510") != 0)
                    return 1;
            } else {
                bool dim_match_206636 = n_203490 == t_n_m_203650;
                bool empty_or_match_cert_206637;
                
                if (!dim_match_206636) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Value of (core language) shape (",
                                  (long long) partition_sizze_203577, ", ",
                                  (long long) t_n_m_203650,
                                  ") cannot match shape of type `[",
                                  (long long) partition_sizze_203577, "][",
                                  (long long) n_203490, "]t`.",
                                  "-> #0  stl.fut:307:15-36\n   #1  stl.fut:415:61-429:75\n   #2  stl.fut:455:3-469:34\n   #3  stl.fut:439:1-469:34\n");
                    if (memblock_unref_device(ctx, &ext_mem_231511,
                                              "ext_mem_231511") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231504,
                                              "ext_mem_231504") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231505,
                                              "ext_mem_231505") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230920, "mem_230920") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230914,
                                              "ext_mem_230914") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230907,
                                              "ext_mem_230907") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230908,
                                              "ext_mem_230908") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230546,
                                              "ext_mem_230546") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230529,
                                              "ext_mem_230529") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230512,
                                              "ext_mem_230512") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230494,
                                              "ext_mem_230494") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230486,
                                              "ext_mem_230486") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230487,
                                              "ext_mem_230487") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229515,
                                              "mem_param_229515") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229507,
                                              "mem_param_229507") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231517,
                                              "ext_mem_231517") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231518,
                                              "ext_mem_231518") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229493,
                                              "mem_param_229493") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229485,
                                              "mem_param_229485") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229477,
                                              "mem_param_229477") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231860,
                                              "ext_mem_231860") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231861,
                                              "ext_mem_231861") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231862,
                                              "ext_mem_231862") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230551, "mem_230551") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230534, "mem_230534") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230517, "mem_230517") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230500, "mem_230500") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229531, "mem_229531") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229526, "mem_229526") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229520, "mem_229520") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229469, "mem_229469") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229465, "mem_229465") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229460,
                                              "ext_mem_229460") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229461,
                                              "ext_mem_229461") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229411,
                                              "ext_mem_229411") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229412,
                                              "ext_mem_229412") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229362,
                                              "ext_mem_229362") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229363,
                                              "ext_mem_229363") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229264,
                                              "ext_mem_229264") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229265,
                                              "ext_mem_229265") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229206, "mem_229206") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229200, "mem_229200") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229196,
                                              "ext_mem_229196") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229197,
                                              "ext_mem_229197") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229164, "mem_229164") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229161, "mem_229161") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229157, "mem_229157") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229155, "mem_229155") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229152, "mem_229152") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229148, "mem_229148") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232249,
                                              "mem_out_232249") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232248,
                                              "mem_out_232248") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232247,
                                              "mem_out_232247") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                if (memblock_set_device(ctx, &ext_mem_231511, &ext_mem_231505,
                                        "ext_mem_231505") != 0)
                    return 1;
            }
            if (memblock_unref_device(ctx, &ext_mem_231504, "ext_mem_231504") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231505, "ext_mem_231505") !=
                0)
                return 1;
            
            int64_t ctx_param_ext_tmp_232995 = ext_231512;
            int64_t ctx_param_ext_tmp_232996 = ext_231512;
            struct memblock_device mem_param_tmp_232997;
            
            mem_param_tmp_232997.references = NULL;
            if (memblock_set_device(ctx, &mem_param_tmp_232997, &mem_230920,
                                    "mem_230920") != 0)
                return 1;
            
            struct memblock_device mem_param_tmp_232998;
            
            mem_param_tmp_232998.references = NULL;
            if (memblock_set_device(ctx, &mem_param_tmp_232998, &ext_mem_231511,
                                    "ext_mem_231511") != 0)
                return 1;
            ctx_param_ext_229509 = ctx_param_ext_tmp_232995;
            ctx_param_ext_229511 = ctx_param_ext_tmp_232996;
            if (memblock_set_device(ctx, &mem_param_229507,
                                    &mem_param_tmp_232997,
                                    "mem_param_tmp_232997") != 0)
                return 1;
            if (memblock_set_device(ctx, &mem_param_229515,
                                    &mem_param_tmp_232998,
                                    "mem_param_tmp_232998") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_param_tmp_232998,
                                      "mem_param_tmp_232998") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_param_tmp_232997,
                                      "mem_param_tmp_232997") != 0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231511, "ext_mem_231511") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231504, "ext_mem_231504") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231505, "ext_mem_231505") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &mem_230920, "mem_230920") != 0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_230914, "ext_mem_230914") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_230907, "ext_mem_230907") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_230908, "ext_mem_230908") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_230546, "ext_mem_230546") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_230529, "ext_mem_230529") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_230512, "ext_mem_230512") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_230494, "ext_mem_230494") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_230486, "ext_mem_230486") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_230487, "ext_mem_230487") !=
                0)
                return 1;
        }
        ext_231524 = ctx_param_ext_229509;
        ext_231522 = ctx_param_ext_229511;
        if (memblock_set_device(ctx, &ext_mem_231518, &mem_param_229507,
                                "mem_param_229507") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_231517, &mem_param_229515,
                                "mem_param_229515") != 0)
            return 1;
        
        bool cond_206639 = slt64(i_outer_204192, y_204109);
        int64_t ext_231859;
        
        if (cond_206639) {
            ext_231859 = partition_sizze_203577;
        } else {
            ext_231859 = ctx_param_ext_229490;
        }
        
        int64_t ext_231858;
        
        if (cond_206639) {
            ext_231858 = n_203490;
        } else {
            ext_231858 = ctx_param_ext_229492;
        }
        
        int64_t ext_231857;
        
        if (cond_206639) {
            ext_231857 = partition_sizze_203577;
        } else {
            ext_231857 = ctx_param_ext_229486;
        }
        
        int64_t ext_231856;
        
        if (cond_206639) {
            ext_231856 = n_203490;
        } else {
            ext_231856 = ctx_param_ext_229487;
        }
        
        int64_t ext_231855;
        
        if (cond_206639) {
            ext_231855 = n_203490;
        } else {
            ext_231855 = ctx_param_ext_229489;
        }
        
        int64_t ext_231854;
        
        if (cond_206639) {
            ext_231854 = (int64_t) 1;
        } else {
            ext_231854 = ctx_param_ext_229491;
        }
        
        int64_t ext_231853;
        
        if (cond_206639) {
            ext_231853 = (int64_t) 0;
        } else {
            ext_231853 = ctx_param_ext_229488;
        }
        
        struct memblock_device ext_mem_231852;
        
        ext_mem_231852.references = NULL;
        if (cond_206639) {
            bool suff_intra_par_226977;
            
            suff_intra_par_226977 =
                *ctx->tuning_params.mainzisuff_intra_par_34 <= n_203490;
            if (ctx->logging)
                fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                        "main.suff_intra_par_34", (long) n_203490,
                        suff_intra_par_226977 ? "true" : "false");
            
            bool intra_suff_and_fits_226980 = fits_206888 &&
                 suff_intra_par_226977;
            int64_t segmap_group_sizze_227106;
            
            segmap_group_sizze_227106 =
                *ctx->tuning_params.mainzisegmap_group_sizze_227070;
            
            int64_t segmap_group_sizze_227127;
            
            segmap_group_sizze_227127 =
                *ctx->tuning_params.mainzisegmap_group_sizze_227027;
            
            struct memblock_device ext_mem_231561;
            
            ext_mem_231561.references = NULL;
            
            struct memblock_device ext_mem_231560;
            
            ext_mem_231560.references = NULL;
            
            int32_t local_memory_capacity_236565;
            
            local_memory_capacity_236565 = ctx->cuda.max_shared_memory;
            if (sle64(bytes_229169 + srem64((int64_t) 8 - srem64(bytes_229169,
                                                                 (int64_t) 8),
                                            (int64_t) 8) + (bytes_229169 +
                                                            srem64((int64_t) 8 -
                                                                   srem64(bytes_229169,
                                                                          (int64_t) 8),
                                                                   (int64_t) 8)),
                      sext_i32_i64(local_memory_capacity_236565)) &&
                intra_suff_and_fits_226980) {
                struct memblock_device mem_231545;
                
                mem_231545.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231545, bytes_229177,
                                          "mem_231545")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_231549;
                
                mem_231549.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231549, bytes_229177,
                                          "mem_231549")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                
                unsigned int shared_sizze_239027 = bytes_229169;
                unsigned int shared_sizze_239029 = bytes_229169;
                CUdeviceptr kernel_arg_239031 = mem_229161.mem;
                CUdeviceptr kernel_arg_239032 = ext_mem_229197.mem;
                CUdeviceptr kernel_arg_239033 = ext_mem_231517.mem;
                CUdeviceptr kernel_arg_239034 = ext_mem_231518.mem;
                CUdeviceptr kernel_arg_239035 = mem_231545.mem;
                CUdeviceptr kernel_arg_239036 = mem_231549.mem;
                unsigned int shared_offset_239028 = 0;
                unsigned int shared_offset_239030 = 0 + (shared_sizze_239027 +
                                                         (8 -
                                                          shared_sizze_239027 %
                                                          8) % 8);
                
                if ((((((1 && partition_sizze_203577 != 0) && 1 != 0) && 1 !=
                       0) && n_203490 != 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_203577;
                    grid[perm[1]] = 1;
                    grid[perm[2]] = 1;
                    
                    void *kernel_args_239024[] = {&ctx->global_failure,
                                                  &ctx->failure_is_an_option,
                                                  &ctx->global_failure_args,
                                                  &shared_offset_239028,
                                                  &shared_offset_239030,
                                                  &n_203490,
                                                  &partition_sizze_203577,
                                                  &ext_231522,
                                                  &kernel_arg_239031,
                                                  &kernel_arg_239032,
                                                  &kernel_arg_239033,
                                                  &kernel_arg_239034,
                                                  &kernel_arg_239035,
                                                  &kernel_arg_239036};
                    int64_t time_start_239025 = 0, time_end_239026 = 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_226984",
                                (long) partition_sizze_203577, (long) 1,
                                (long) 1, (long) n_203490, (long) 1, (long) 1,
                                (int) (0 + (shared_sizze_239027 + (8 -
                                                                   shared_sizze_239027 %
                                                                   8) % 8) +
                                       (shared_sizze_239029 + (8 -
                                                               shared_sizze_239029 %
                                                               8) % 8)));
                        time_start_239025 = get_wall_time();
                    }
                    
                    cudaEvent_t *pevents = NULL;
                    
                    if (ctx->profiling && !ctx->profiling_paused) {
                        pevents = cuda_get_events(&ctx->cuda,
                                                  &ctx->mainzisegmap_intragroup_226984_runs,
                                                  &ctx->mainzisegmap_intragroup_226984_total_runtime);
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                    }
                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_intragroup_226984,
                                                          grid[0], grid[1],
                                                          grid[2], n_203490, 1,
                                                          1, 0 +
                                                          (shared_sizze_239027 +
                                                           (8 -
                                                            shared_sizze_239027 %
                                                            8) % 8) +
                                                          (shared_sizze_239029 +
                                                           (8 -
                                                            shared_sizze_239029 %
                                                            8) % 8), NULL,
                                                          kernel_args_239024,
                                                          NULL));
                    if (pevents != NULL)
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                    if (ctx->debugging) {
                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                        time_end_239026 = get_wall_time();
                        fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                "main.segmap_intragroup_226984",
                                time_end_239026 - time_start_239025);
                    }
                }
                ctx->failure_is_an_option = 1;
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_set_device(ctx, &ext_mem_231561, &mem_231545,
                                        "mem_231545") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_231560, &mem_231549,
                                        "mem_231549") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231549, "mem_231549") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231545, "mem_231545") != 0)
                    return 1;
            } else {
                int64_t segmap_usable_groups_227107 =
                        sdiv_up64(nest_sizze_207000, segmap_group_sizze_227106);
                struct memblock_device mem_231554;
                
                mem_231554.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231554, bytes_229177,
                                          "mem_231554")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                
                CUdeviceptr kernel_arg_239040 = mem_229161.mem;
                CUdeviceptr kernel_arg_239041 = ext_mem_231517.mem;
                CUdeviceptr kernel_arg_239042 = ext_mem_231518.mem;
                CUdeviceptr kernel_arg_239043 = mem_231554.mem;
                
                if ((((((1 && segmap_usable_groups_227107 != 0) && 1 != 0) &&
                       1 != 0) && segmap_group_sizze_227106 != 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_227107;
                    grid[perm[1]] = 1;
                    grid[perm[2]] = 1;
                    
                    void *kernel_args_239037[] = {&ctx->global_failure,
                                                  &n_203490,
                                                  &partition_sizze_203577,
                                                  &ext_231522,
                                                  &kernel_arg_239040,
                                                  &kernel_arg_239041,
                                                  &kernel_arg_239042,
                                                  &kernel_arg_239043};
                    int64_t time_start_239038 = 0, time_end_239039 = 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_227111",
                                (long) segmap_usable_groups_227107, (long) 1,
                                (long) 1, (long) segmap_group_sizze_227106,
                                (long) 1, (long) 1, (int) 0);
                        time_start_239038 = get_wall_time();
                    }
                    
                    cudaEvent_t *pevents = NULL;
                    
                    if (ctx->profiling && !ctx->profiling_paused) {
                        pevents = cuda_get_events(&ctx->cuda,
                                                  &ctx->mainzisegmap_227111_runs,
                                                  &ctx->mainzisegmap_227111_total_runtime);
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                    }
                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_227111,
                                                          grid[0], grid[1],
                                                          grid[2],
                                                          segmap_group_sizze_227106,
                                                          1, 1, 0, NULL,
                                                          kernel_args_239037,
                                                          NULL));
                    if (pevents != NULL)
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                    if (ctx->debugging) {
                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                        time_end_239039 = get_wall_time();
                        fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                "main.segmap_227111", time_end_239039 -
                                time_start_239038);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                
                int64_t segmap_usable_groups_227128 =
                        sdiv_up64(nest_sizze_207000, segmap_group_sizze_227127);
                struct memblock_device mem_231559;
                
                mem_231559.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231559, bytes_229177,
                                          "mem_231559")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                
                CUdeviceptr kernel_arg_239047 = ext_mem_229197.mem;
                CUdeviceptr kernel_arg_239048 = mem_231554.mem;
                CUdeviceptr kernel_arg_239049 = mem_231559.mem;
                
                if ((((((1 && segmap_usable_groups_227128 != 0) && 1 != 0) &&
                       1 != 0) && segmap_group_sizze_227127 != 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_227128;
                    grid[perm[1]] = 1;
                    grid[perm[2]] = 1;
                    
                    void *kernel_args_239044[] = {&ctx->global_failure,
                                                  &ctx->failure_is_an_option,
                                                  &ctx->global_failure_args,
                                                  &n_203490,
                                                  &partition_sizze_203577,
                                                  &kernel_arg_239047,
                                                  &kernel_arg_239048,
                                                  &kernel_arg_239049};
                    int64_t time_start_239045 = 0, time_end_239046 = 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_227132",
                                (long) segmap_usable_groups_227128, (long) 1,
                                (long) 1, (long) segmap_group_sizze_227127,
                                (long) 1, (long) 1, (int) 0);
                        time_start_239045 = get_wall_time();
                    }
                    
                    cudaEvent_t *pevents = NULL;
                    
                    if (ctx->profiling && !ctx->profiling_paused) {
                        pevents = cuda_get_events(&ctx->cuda,
                                                  &ctx->mainzisegmap_227132_runs,
                                                  &ctx->mainzisegmap_227132_total_runtime);
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                    }
                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_227132,
                                                          grid[0], grid[1],
                                                          grid[2],
                                                          segmap_group_sizze_227127,
                                                          1, 1, 0, NULL,
                                                          kernel_args_239044,
                                                          NULL));
                    if (pevents != NULL)
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                    if (ctx->debugging) {
                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                        time_end_239046 = get_wall_time();
                        fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                "main.segmap_227132", time_end_239046 -
                                time_start_239045);
                    }
                }
                ctx->failure_is_an_option = 1;
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_set_device(ctx, &ext_mem_231561, &mem_231559,
                                        "mem_231559") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_231560, &mem_231554,
                                        "mem_231554") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231559, "mem_231559") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231554, "mem_231554") != 0)
                    return 1;
            }
            
            int32_t iters_206665;
            
            if (empty_slice_204119) {
                iters_206665 = 0;
            } else {
                iters_206665 = 32;
            }
            
            bool loop_nonempty_206666 = slt32(0, iters_206665);
            bool loop_not_taken_206667 = !loop_nonempty_206666;
            bool protect_assert_disj_206668 = bounds_check_203673 ||
                 loop_not_taken_206667;
            bool index_certs_206669;
            
            if (!protect_assert_disj_206668) {
                ctx->error =
                    msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                              "Index [", (long long) i_203670,
                              "] out of bounds for array of shape [",
                              (long long) n_203490, "].",
                              "-> #0  /prelude/array.fut:26:29-34\n   #1  lib/github.com/diku-dk/sorts/radix_sort.fut:25:24-35\n   #2  lib/github.com/diku-dk/sorts/radix_sort.fut:53:31-62\n   #3  lib/github.com/diku-dk/sorts/radix_sort.fut:104:6-36\n   #4  stl.fut:338:35-77\n   #5  stl.fut:337:28-339:40\n   #6  stl.fut:415:61-429:75\n   #7  stl.fut:455:3-469:34\n   #8  stl.fut:439:1-469:34\n");
                if (memblock_unref_device(ctx, &ext_mem_231560,
                                          "ext_mem_231560") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231561,
                                          "ext_mem_231561") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231852,
                                          "ext_mem_231852") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_param_229515,
                                          "mem_param_229515") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_param_229507,
                                          "mem_param_229507") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231517,
                                          "ext_mem_231517") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231518,
                                          "ext_mem_231518") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_param_229493,
                                          "mem_param_229493") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_param_229485,
                                          "mem_param_229485") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_param_229477,
                                          "mem_param_229477") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231860,
                                          "ext_mem_231860") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231861,
                                          "ext_mem_231861") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231862,
                                          "ext_mem_231862") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230551, "mem_230551") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230534, "mem_230534") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230517, "mem_230517") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230500, "mem_230500") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229531, "mem_229531") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229526, "mem_229526") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229520, "mem_229520") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229469, "mem_229469") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229465, "mem_229465") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229460,
                                          "ext_mem_229460") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229461,
                                          "ext_mem_229461") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229411,
                                          "ext_mem_229411") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229412,
                                          "ext_mem_229412") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229362,
                                          "ext_mem_229362") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229363,
                                          "ext_mem_229363") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229264,
                                          "ext_mem_229264") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229265,
                                          "ext_mem_229265") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229206, "mem_229206") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229200, "mem_229200") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229196,
                                          "ext_mem_229196") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229197,
                                          "ext_mem_229197") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_out_232249,
                                          "mem_out_232249") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_out_232248,
                                          "mem_out_232248") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_out_232247,
                                          "mem_out_232247") != 0)
                    return 1;
                err = 1;
                goto cleanup;
            }
            
            bool suff_outer_par_227154;
            
            suff_outer_par_227154 =
                *ctx->tuning_params.mainzisuff_outer_par_35 <=
                partition_sizze_203577;
            if (ctx->logging)
                fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                        "main.suff_outer_par_35", (long) partition_sizze_203577,
                        suff_outer_par_227154 ? "true" : "false");
            
            bool suff_intra_par_227353;
            
            suff_intra_par_227353 =
                *ctx->tuning_params.mainzisuff_intra_par_36 <= n_203490;
            if (ctx->logging)
                fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                        "main.suff_intra_par_36", (long) n_203490,
                        suff_intra_par_227353 ? "true" : "false");
            
            bool intra_suff_and_fits_227356 = fits_206888 &&
                 suff_intra_par_227353;
            int64_t segmap_group_sizze_227256;
            
            segmap_group_sizze_227256 =
                *ctx->tuning_params.mainzisegmap_group_sizze_227158;
            
            int64_t num_groups_227257;
            int32_t max_num_groups_236566;
            
            max_num_groups_236566 =
                *ctx->tuning_params.mainzisegmap_num_groups_227160;
            num_groups_227257 = sext_i64_i32(smax64((int64_t) 1,
                                                    smin64(sdiv_up64(partition_sizze_203577,
                                                                     segmap_group_sizze_227256),
                                                           sext_i32_i64(max_num_groups_236566))));
            
            bool suff_intra_par_227810;
            
            suff_intra_par_227810 =
                *ctx->tuning_params.mainzisuff_intra_par_37 <= n_203490;
            if (ctx->logging)
                fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                        "main.suff_intra_par_37", (long) n_203490,
                        suff_intra_par_227810 ? "true" : "false");
            
            bool intra_suff_and_fits_227811 = fits_206888 &&
                 suff_intra_par_227810;
            int64_t segscan_group_sizze_227905;
            
            segscan_group_sizze_227905 =
                *ctx->tuning_params.mainzisegscan_group_sizze_227625;
            
            int64_t num_groups_227906;
            int32_t max_num_groups_236567;
            
            max_num_groups_236567 =
                *ctx->tuning_params.mainzisegscan_num_groups_227627;
            num_groups_227906 = sext_i64_i32(smax64((int64_t) 1,
                                                    smin64(sdiv_up64(nest_sizze_207000,
                                                                     segscan_group_sizze_227905),
                                                           sext_i32_i64(max_num_groups_236567))));
            
            int64_t segmap_group_sizze_227981;
            
            segmap_group_sizze_227981 =
                *ctx->tuning_params.mainzisegmap_group_sizze_227577;
            
            int64_t segmap_usable_groups_227982 =
                    sdiv_up_safe64(nest_sizze_207000,
                                   segmap_group_sizze_227981);
            int64_t binop_y_231589 = (int64_t) 4 * n_203490;
            int64_t bytes_231590 = smax64((int64_t) 0, binop_y_231589);
            int64_t binop_y_231783 = (int64_t) 4 * nest_sizze_207000;
            int64_t bytes_231784 = smax64((int64_t) 0, binop_y_231783);
            int64_t num_bytes_231954 = (int64_t) 8 * n_203490;
            int64_t num_bytes_231959 = (int64_t) 8 * n_203490;
            int64_t num_threads_232227 = segmap_group_sizze_227256 *
                    num_groups_227257;
            int64_t total_sizze_232228 = num_bytes_231954 * num_threads_232227;
            int64_t total_sizze_232229 = bytes_229169 * num_threads_232227;
            int64_t total_sizze_232230 = bytes_231590 * num_threads_232227;
            int64_t total_sizze_232231 = bytes_229169 * num_threads_232227;
            int64_t total_sizze_232232 = bytes_229169 * num_threads_232227;
            int64_t total_sizze_232233 = bytes_229169 * num_threads_232227;
            int64_t total_sizze_232234 = bytes_229169 * num_threads_232227;
            int64_t total_sizze_232236 = partition_sizze_203577 *
                    num_bytes_231959;
            int64_t total_sizze_232237 = partition_sizze_203577 * bytes_229169;
            struct memblock_device ext_mem_231816;
            
            ext_mem_231816.references = NULL;
            
            int32_t local_memory_capacity_236955;
            
            local_memory_capacity_236955 = ctx->cuda.max_shared_memory;
            if (sle64((int64_t) 0,
                      sext_i32_i64(local_memory_capacity_236955)) &&
                suff_outer_par_227154) {
                struct memblock_device mem_231564;
                
                mem_231564.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231564, binop_y_229176,
                                          "mem_231564")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhgpu_map_transpose_f64(ctx, mem_231564,
                                                          (int64_t) 0,
                                                          ext_mem_231561,
                                                          (int64_t) 0,
                                                          (int64_t) 1, n_203490,
                                                          partition_sizze_203577) !=
                    0) {
                    if (memblock_unref_device(ctx, &mem_231564, "mem_231564") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231816,
                                              "ext_mem_231816") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231560,
                                              "ext_mem_231560") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231561,
                                              "ext_mem_231561") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231852,
                                              "ext_mem_231852") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229515,
                                              "mem_param_229515") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229507,
                                              "mem_param_229507") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231517,
                                              "ext_mem_231517") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231518,
                                              "ext_mem_231518") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229493,
                                              "mem_param_229493") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229485,
                                              "mem_param_229485") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229477,
                                              "mem_param_229477") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231860,
                                              "ext_mem_231860") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231861,
                                              "ext_mem_231861") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231862,
                                              "ext_mem_231862") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230551, "mem_230551") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230534, "mem_230534") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230517, "mem_230517") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230500, "mem_230500") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229531, "mem_229531") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229526, "mem_229526") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229520, "mem_229520") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229469, "mem_229469") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229465, "mem_229465") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229460,
                                              "ext_mem_229460") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229461,
                                              "ext_mem_229461") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229411,
                                              "ext_mem_229411") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229412,
                                              "ext_mem_229412") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229362,
                                              "ext_mem_229362") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229363,
                                              "ext_mem_229363") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229264,
                                              "ext_mem_229264") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229265,
                                              "ext_mem_229265") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229206, "mem_229206") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229200, "mem_229200") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229196,
                                              "ext_mem_229196") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229197,
                                              "ext_mem_229197") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229164, "mem_229164") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229161, "mem_229161") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229157, "mem_229157") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229155, "mem_229155") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229152, "mem_229152") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229148, "mem_229148") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232249,
                                              "mem_out_232249") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232248,
                                              "mem_out_232248") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232247,
                                              "mem_out_232247") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_231674;
                
                mem_231674.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231674, binop_y_229176,
                                          "mem_231674")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device color_232062;
                
                color_232062.references = NULL;
                if (memblock_alloc_device(ctx, &color_232062,
                                          total_sizze_232228, "color_232062")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device color_232063;
                
                color_232063.references = NULL;
                if (memblock_alloc_device(ctx, &color_232063,
                                          total_sizze_232229, "color_232063")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device color_232064;
                
                color_232064.references = NULL;
                if (memblock_alloc_device(ctx, &color_232064,
                                          total_sizze_232230, "color_232064")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device color_232065;
                
                color_232065.references = NULL;
                if (memblock_alloc_device(ctx, &color_232065,
                                          total_sizze_232231, "color_232065")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device color_232066;
                
                color_232066.references = NULL;
                if (memblock_alloc_device(ctx, &color_232066,
                                          total_sizze_232232, "color_232066")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device color_232067;
                
                color_232067.references = NULL;
                if (memblock_alloc_device(ctx, &color_232067,
                                          total_sizze_232233, "color_232067")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device color_232068;
                
                color_232068.references = NULL;
                if (memblock_alloc_device(ctx, &color_232068,
                                          total_sizze_232234, "color_232068")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                
                CUdeviceptr kernel_arg_239053 = mem_231564.mem;
                CUdeviceptr kernel_arg_239054 = mem_231674.mem;
                CUdeviceptr kernel_arg_239055 = color_232062.mem;
                CUdeviceptr kernel_arg_239056 = color_232063.mem;
                CUdeviceptr kernel_arg_239057 = color_232064.mem;
                CUdeviceptr kernel_arg_239058 = color_232065.mem;
                CUdeviceptr kernel_arg_239059 = color_232066.mem;
                CUdeviceptr kernel_arg_239060 = color_232067.mem;
                CUdeviceptr kernel_arg_239061 = color_232068.mem;
                
                if ((((((1 && num_groups_227257 != 0) && 1 != 0) && 1 != 0) &&
                      segmap_group_sizze_227256 != 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_227257;
                    grid[perm[1]] = 1;
                    grid[perm[2]] = 1;
                    
                    void *kernel_args_239050[] = {&ctx->global_failure,
                                                  &n_203490,
                                                  &partition_sizze_203577,
                                                  &i_203670, &iters_206665,
                                                  &num_groups_227257,
                                                  &num_threads_232227,
                                                  &kernel_arg_239053,
                                                  &kernel_arg_239054,
                                                  &kernel_arg_239055,
                                                  &kernel_arg_239056,
                                                  &kernel_arg_239057,
                                                  &kernel_arg_239058,
                                                  &kernel_arg_239059,
                                                  &kernel_arg_239060,
                                                  &kernel_arg_239061};
                    int64_t time_start_239051 = 0, time_end_239052 = 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_227261", (long) num_groups_227257,
                                (long) 1, (long) 1,
                                (long) segmap_group_sizze_227256, (long) 1,
                                (long) 1, (int) 0);
                        time_start_239051 = get_wall_time();
                    }
                    
                    cudaEvent_t *pevents = NULL;
                    
                    if (ctx->profiling && !ctx->profiling_paused) {
                        pevents = cuda_get_events(&ctx->cuda,
                                                  &ctx->mainzisegmap_227261_runs,
                                                  &ctx->mainzisegmap_227261_total_runtime);
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                    }
                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_227261,
                                                          grid[0], grid[1],
                                                          grid[2],
                                                          segmap_group_sizze_227256,
                                                          1, 1, 0, NULL,
                                                          kernel_args_239050,
                                                          NULL));
                    if (pevents != NULL)
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                    if (ctx->debugging) {
                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                        time_end_239052 = get_wall_time();
                        fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                "main.segmap_227261", time_end_239052 -
                                time_start_239051);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_unref_device(ctx, &mem_231564, "mem_231564") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232062, "color_232062") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232063, "color_232063") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232064, "color_232064") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232065, "color_232065") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232066, "color_232066") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232067, "color_232067") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232068, "color_232068") !=
                    0)
                    return 1;
                
                struct memblock_device mem_231809;
                
                mem_231809.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231809, bytes_229177,
                                          "mem_231809")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhgpu_map_transpose_f64(ctx, mem_231809,
                                                          (int64_t) 0,
                                                          mem_231674,
                                                          (int64_t) 0,
                                                          (int64_t) 1,
                                                          partition_sizze_203577,
                                                          n_203490) != 0) {
                    if (memblock_unref_device(ctx, &mem_231809, "mem_231809") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232068,
                                              "color_232068") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232067,
                                              "color_232067") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232066,
                                              "color_232066") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232065,
                                              "color_232065") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232064,
                                              "color_232064") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232063,
                                              "color_232063") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232062,
                                              "color_232062") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_231674, "mem_231674") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_231564, "mem_231564") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231816,
                                              "ext_mem_231816") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231560,
                                              "ext_mem_231560") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231561,
                                              "ext_mem_231561") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231852,
                                              "ext_mem_231852") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229515,
                                              "mem_param_229515") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229507,
                                              "mem_param_229507") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231517,
                                              "ext_mem_231517") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231518,
                                              "ext_mem_231518") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229493,
                                              "mem_param_229493") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229485,
                                              "mem_param_229485") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229477,
                                              "mem_param_229477") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231860,
                                              "ext_mem_231860") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231861,
                                              "ext_mem_231861") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231862,
                                              "ext_mem_231862") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230551, "mem_230551") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230534, "mem_230534") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230517, "mem_230517") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230500, "mem_230500") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229531, "mem_229531") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229526, "mem_229526") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229520, "mem_229520") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229469, "mem_229469") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229465, "mem_229465") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229460,
                                              "ext_mem_229460") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229461,
                                              "ext_mem_229461") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229411,
                                              "ext_mem_229411") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229412,
                                              "ext_mem_229412") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229362,
                                              "ext_mem_229362") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229363,
                                              "ext_mem_229363") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229264,
                                              "ext_mem_229264") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229265,
                                              "ext_mem_229265") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229206, "mem_229206") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229200, "mem_229200") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229196,
                                              "ext_mem_229196") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229197,
                                              "ext_mem_229197") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229164, "mem_229164") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229161, "mem_229161") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229157, "mem_229157") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229155, "mem_229155") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229152, "mem_229152") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229148, "mem_229148") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232249,
                                              "mem_out_232249") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232248,
                                              "mem_out_232248") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232247,
                                              "mem_out_232247") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                if (memblock_unref_device(ctx, &mem_231674, "mem_231674") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_231816, &mem_231809,
                                        "mem_231809") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231809, "mem_231809") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232068, "color_232068") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232067, "color_232067") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232066, "color_232066") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232065, "color_232065") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232064, "color_232064") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232063, "color_232063") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232062, "color_232062") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231674, "mem_231674") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231564, "mem_231564") != 0)
                    return 1;
            } else {
                struct memblock_device ext_mem_231798;
                
                ext_mem_231798.references = NULL;
                
                int32_t local_memory_capacity_236954;
                
                local_memory_capacity_236954 = ctx->cuda.max_shared_memory;
                if (sle64(bytes_229169 + srem64((int64_t) 8 -
                                                srem64(bytes_229169,
                                                       (int64_t) 8),
                                                (int64_t) 8) + (bytes_231590 +
                                                                srem64((int64_t) 8 -
                                                                       srem64(bytes_231590,
                                                                              (int64_t) 8),
                                                                       (int64_t) 8)) +
                          (bytes_229169 + srem64((int64_t) 8 -
                                                 srem64(bytes_229169,
                                                        (int64_t) 8),
                                                 (int64_t) 8)) + (bytes_229169 +
                                                                  srem64((int64_t) 8 -
                                                                         srem64(bytes_229169,
                                                                                (int64_t) 8),
                                                                         (int64_t) 8)) +
                          (bytes_229169 + srem64((int64_t) 8 -
                                                 srem64(bytes_229169,
                                                        (int64_t) 8),
                                                 (int64_t) 8)) + (bytes_229169 +
                                                                  srem64((int64_t) 8 -
                                                                         srem64(bytes_229169,
                                                                                (int64_t) 8),
                                                                         (int64_t) 8)),
                          sext_i32_i64(local_memory_capacity_236954)) &&
                    intra_suff_and_fits_227356) {
                    struct memblock_device mem_231721;
                    
                    mem_231721.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_231721, bytes_229177,
                                              "mem_231721")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device color_232069;
                    
                    color_232069.references = NULL;
                    if (memblock_alloc_device(ctx, &color_232069,
                                              total_sizze_232236,
                                              "color_232069")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device color_232070;
                    
                    color_232070.references = NULL;
                    if (memblock_alloc_device(ctx, &color_232070,
                                              total_sizze_232237,
                                              "color_232070")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                    
                    unsigned int shared_sizze_239065 = bytes_229169;
                    unsigned int shared_sizze_239067 = bytes_229169;
                    unsigned int shared_sizze_239069 = bytes_229169;
                    unsigned int shared_sizze_239071 = bytes_229169;
                    unsigned int shared_sizze_239073 = bytes_231590;
                    unsigned int shared_sizze_239075 = bytes_229169;
                    CUdeviceptr kernel_arg_239077 = ext_mem_231561.mem;
                    CUdeviceptr kernel_arg_239078 = mem_231721.mem;
                    CUdeviceptr kernel_arg_239079 = color_232069.mem;
                    CUdeviceptr kernel_arg_239080 = color_232070.mem;
                    unsigned int shared_offset_239066 = 0;
                    unsigned int shared_offset_239068 = 0 +
                                 (shared_sizze_239065 + (8 -
                                                         shared_sizze_239065 %
                                                         8) % 8);
                    unsigned int shared_offset_239070 = 0 +
                                 (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_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_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_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 && partition_sizze_203577 != 0) && 1 != 0) &&
                           1 != 0) && n_203490 != 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_203577;
                        grid[perm[1]] = 1;
                        grid[perm[2]] = 1;
                        
                        void *kernel_args_239062[] = {&ctx->global_failure,
                                                      &shared_offset_239066,
                                                      &shared_offset_239068,
                                                      &shared_offset_239070,
                                                      &shared_offset_239072,
                                                      &shared_offset_239074,
                                                      &shared_offset_239076,
                                                      &n_203490,
                                                      &partition_sizze_203577,
                                                      &i_203670, &iters_206665,
                                                      &kernel_arg_239077,
                                                      &kernel_arg_239078,
                                                      &kernel_arg_239079,
                                                      &kernel_arg_239080};
                        int64_t time_start_239063 = 0, time_end_239064 = 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_227359",
                                    (long) partition_sizze_203577, (long) 1,
                                    (long) 1, (long) n_203490, (long) 1,
                                    (long) 1, (int) (0 + (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_239063 = get_wall_time();
                        }
                        
                        cudaEvent_t *pevents = NULL;
                        
                        if (ctx->profiling && !ctx->profiling_paused) {
                            pevents = cuda_get_events(&ctx->cuda,
                                                      &ctx->mainzisegmap_intragroup_227359_runs,
                                                      &ctx->mainzisegmap_intragroup_227359_total_runtime);
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                        }
                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_intragroup_227359,
                                                              grid[0], grid[1],
                                                              grid[2], n_203490,
                                                              1, 1, 0 +
                                                              (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_239062,
                                                              NULL));
                        if (pevents != NULL)
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                        if (ctx->debugging) {
                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                            time_end_239064 = get_wall_time();
                            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                    "main.segmap_intragroup_227359",
                                    time_end_239064 - time_start_239063);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    if (memblock_unref_device(ctx, &color_232069,
                                              "color_232069") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232070,
                                              "color_232070") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_231798, &mem_231721,
                                            "mem_231721") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232070,
                                              "color_232070") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232069,
                                              "color_232069") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_231721, "mem_231721") !=
                        0)
                        return 1;
                } else {
                    struct memblock_device mem_231725;
                    
                    mem_231725.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_231725, bytes_229177,
                                              "mem_231725")) {
                        err = 1;
                        goto cleanup;
                    }
                    {
                        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_231725.mem +
                                                        (int64_t) 0,
                                                        ext_mem_231561.mem +
                                                        (int64_t) 0,
                                                        partition_sizze_203577 *
                                                        n_203490 *
                                                        (int64_t) 8));
                        if (pevents != NULL)
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                    }
                    
                    struct memblock_device ext_mem_231790;
                    
                    ext_mem_231790.references = NULL;
                    
                    struct memblock_device mem_param_231733;
                    
                    mem_param_231733.references = NULL;
                    if (memblock_set_device(ctx, &mem_param_231733, &mem_231725,
                                            "mem_231725") != 0)
                        return 1;
                    for (int32_t i_227796 = 0; i_227796 < iters_206665;
                         i_227796++) {
                        struct memblock_device mem_231739;
                        
                        mem_231739.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231739,
                                                  bytes_229177, "mem_231739")) {
                            err = 1;
                            goto cleanup;
                        }
                        {
                            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_231739.mem +
                                                            (int64_t) 0,
                                                            mem_param_231733.mem +
                                                            (int64_t) 0,
                                                            partition_sizze_203577 *
                                                            n_203490 *
                                                            (int64_t) 8));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                        }
                        
                        int32_t defunc_2_radix_sort_step_arg_227799 = mul32(2,
                                                                            i_227796);
                        int32_t defunc_0_get_bit_arg_227800 = add32(1,
                                                                    defunc_2_radix_sort_step_arg_227799);
                        bool cond_f_res_227801 = defunc_0_get_bit_arg_227800 ==
                             63;
                        bool cond_f_res_227802 =
                             defunc_2_radix_sort_step_arg_227799 == 63;
                        int64_t unsign_arg_227803 =
                                zext_i32_i64(defunc_0_get_bit_arg_227800);
                        int64_t unsign_arg_227804 =
                                zext_i32_i64(defunc_2_radix_sort_step_arg_227799);
                        struct memblock_device ext_mem_231787;
                        
                        ext_mem_231787.references = NULL;
                        
                        int32_t local_memory_capacity_236953;
                        
                        local_memory_capacity_236953 =
                            ctx->cuda.max_shared_memory;
                        if (sle64(bytes_231590 + srem64((int64_t) 8 -
                                                        srem64(bytes_231590,
                                                               (int64_t) 8),
                                                        (int64_t) 8) +
                                  (bytes_229169 + srem64((int64_t) 8 -
                                                         srem64(bytes_229169,
                                                                (int64_t) 8),
                                                         (int64_t) 8)) +
                                  (bytes_229169 + srem64((int64_t) 8 -
                                                         srem64(bytes_229169,
                                                                (int64_t) 8),
                                                         (int64_t) 8)) +
                                  (bytes_229169 + srem64((int64_t) 8 -
                                                         srem64(bytes_229169,
                                                                (int64_t) 8),
                                                         (int64_t) 8)) +
                                  (bytes_229169 + srem64((int64_t) 8 -
                                                         srem64(bytes_229169,
                                                                (int64_t) 8),
                                                         (int64_t) 8)) +
                                  (bytes_229169 + srem64((int64_t) 8 -
                                                         srem64(bytes_229169,
                                                                (int64_t) 8),
                                                         (int64_t) 8)),
                                  sext_i32_i64(local_memory_capacity_236953)) &&
                            intra_suff_and_fits_227811) {
                            struct memblock_device mem_231764;
                            
                            mem_231764.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231764,
                                                      bytes_229177,
                                                      "mem_231764")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            
                            unsigned int shared_sizze_239084 = bytes_229169;
                            unsigned int shared_sizze_239086 = bytes_229169;
                            unsigned int shared_sizze_239088 = bytes_229169;
                            unsigned int shared_sizze_239090 = bytes_229169;
                            unsigned int shared_sizze_239092 = bytes_229169;
                            unsigned int shared_sizze_239094 = bytes_231590;
                            CUdeviceptr kernel_arg_239096 =
                                        mem_param_231733.mem;
                            CUdeviceptr kernel_arg_239097 = mem_231764.mem;
                            unsigned int shared_offset_239085 = 0;
                            unsigned int shared_offset_239087 = 0 +
                                         (shared_sizze_239084 + (8 -
                                                                 shared_sizze_239084 %
                                                                 8) % 8);
                            unsigned int shared_offset_239089 = 0 +
                                         (shared_sizze_239084 + (8 -
                                                                 shared_sizze_239084 %
                                                                 8) % 8) +
                                         (shared_sizze_239086 + (8 -
                                                                 shared_sizze_239086 %
                                                                 8) % 8);
                            unsigned int shared_offset_239091 = 0 +
                                         (shared_sizze_239084 + (8 -
                                                                 shared_sizze_239084 %
                                                                 8) % 8) +
                                         (shared_sizze_239086 + (8 -
                                                                 shared_sizze_239086 %
                                                                 8) % 8) +
                                         (shared_sizze_239088 + (8 -
                                                                 shared_sizze_239088 %
                                                                 8) % 8);
                            unsigned int shared_offset_239093 = 0 +
                                         (shared_sizze_239084 + (8 -
                                                                 shared_sizze_239084 %
                                                                 8) % 8) +
                                         (shared_sizze_239086 + (8 -
                                                                 shared_sizze_239086 %
                                                                 8) % 8) +
                                         (shared_sizze_239088 + (8 -
                                                                 shared_sizze_239088 %
                                                                 8) % 8) +
                                         (shared_sizze_239090 + (8 -
                                                                 shared_sizze_239090 %
                                                                 8) % 8);
                            unsigned int shared_offset_239095 = 0 +
                                         (shared_sizze_239084 + (8 -
                                                                 shared_sizze_239084 %
                                                                 8) % 8) +
                                         (shared_sizze_239086 + (8 -
                                                                 shared_sizze_239086 %
                                                                 8) % 8) +
                                         (shared_sizze_239088 + (8 -
                                                                 shared_sizze_239088 %
                                                                 8) % 8) +
                                         (shared_sizze_239090 + (8 -
                                                                 shared_sizze_239090 %
                                                                 8) % 8) +
                                         (shared_sizze_239092 + (8 -
                                                                 shared_sizze_239092 %
                                                                 8) % 8);
                            
                            if ((((((1 && partition_sizze_203577 != 0) && 1 !=
                                    0) && 1 != 0) && n_203490 != 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_203577;
                                grid[perm[1]] = 1;
                                grid[perm[2]] = 1;
                                
                                void *kernel_args_239081[] =
                                     {&ctx->global_failure,
                                      &shared_offset_239085,
                                      &shared_offset_239087,
                                      &shared_offset_239089,
                                      &shared_offset_239091,
                                      &shared_offset_239093,
                                      &shared_offset_239095, &n_203490,
                                      &partition_sizze_203577, &i_203670,
                                      &cond_f_res_227801, &cond_f_res_227802,
                                      &unsign_arg_227803, &unsign_arg_227804,
                                      &kernel_arg_239096, &kernel_arg_239097};
                                int64_t time_start_239082 = 0, time_end_239083 =
                                        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_227815",
                                            (long) partition_sizze_203577,
                                            (long) 1, (long) 1, (long) n_203490,
                                            (long) 1, (long) 1, (int) (0 +
                                                                       (shared_sizze_239084 +
                                                                        (8 -
                                                                         shared_sizze_239084 %
                                                                         8) %
                                                                        8) +
                                                                       (shared_sizze_239086 +
                                                                        (8 -
                                                                         shared_sizze_239086 %
                                                                         8) %
                                                                        8) +
                                                                       (shared_sizze_239088 +
                                                                        (8 -
                                                                         shared_sizze_239088 %
                                                                         8) %
                                                                        8) +
                                                                       (shared_sizze_239090 +
                                                                        (8 -
                                                                         shared_sizze_239090 %
                                                                         8) %
                                                                        8) +
                                                                       (shared_sizze_239092 +
                                                                        (8 -
                                                                         shared_sizze_239092 %
                                                                         8) %
                                                                        8) +
                                                                       (shared_sizze_239094 +
                                                                        (8 -
                                                                         shared_sizze_239094 %
                                                                         8) %
                                                                        8)));
                                    time_start_239082 = get_wall_time();
                                }
                                
                                cudaEvent_t *pevents = NULL;
                                
                                if (ctx->profiling && !ctx->profiling_paused) {
                                    pevents = cuda_get_events(&ctx->cuda,
                                                              &ctx->mainzisegmap_intragroup_227815_runs,
                                                              &ctx->mainzisegmap_intragroup_227815_total_runtime);
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                       0));
                                }
                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_intragroup_227815,
                                                                      grid[0],
                                                                      grid[1],
                                                                      grid[2],
                                                                      n_203490,
                                                                      1, 1, 0 +
                                                                      (shared_sizze_239084 +
                                                                       (8 -
                                                                        shared_sizze_239084 %
                                                                        8) %
                                                                       8) +
                                                                      (shared_sizze_239086 +
                                                                       (8 -
                                                                        shared_sizze_239086 %
                                                                        8) %
                                                                       8) +
                                                                      (shared_sizze_239088 +
                                                                       (8 -
                                                                        shared_sizze_239088 %
                                                                        8) %
                                                                       8) +
                                                                      (shared_sizze_239090 +
                                                                       (8 -
                                                                        shared_sizze_239090 %
                                                                        8) %
                                                                       8) +
                                                                      (shared_sizze_239092 +
                                                                       (8 -
                                                                        shared_sizze_239092 %
                                                                        8) %
                                                                       8) +
                                                                      (shared_sizze_239094 +
                                                                       (8 -
                                                                        shared_sizze_239094 %
                                                                        8) % 8),
                                                                      NULL,
                                                                      kernel_args_239081,
                                                                      NULL));
                                if (pevents != NULL)
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                       0));
                                if (ctx->debugging) {
                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                    time_end_239083 = get_wall_time();
                                    fprintf(ctx->log,
                                            "Kernel %s runtime: %ldus\n",
                                            "main.segmap_intragroup_227815",
                                            time_end_239083 -
                                            time_start_239082);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_set_device(ctx, &ext_mem_231787,
                                                    &mem_231764,
                                                    "mem_231764") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231764,
                                                      "mem_231764") != 0)
                                return 1;
                        } else {
                            struct memblock_device mem_231769;
                            
                            mem_231769.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231769,
                                                      bytes_229177,
                                                      "mem_231769")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231773;
                            
                            mem_231773.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231773,
                                                      bytes_229177,
                                                      "mem_231773")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231777;
                            
                            mem_231777.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231777,
                                                      bytes_229177,
                                                      "mem_231777")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231781;
                            
                            mem_231781.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231781,
                                                      bytes_229177,
                                                      "mem_231781")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231785;
                            
                            mem_231785.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231785,
                                                      bytes_231784,
                                                      "mem_231785")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (slt64((int64_t) 0, partition_sizze_203577 *
                                      n_203490)) {
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "\n# SegScan");
                                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_236684 =
                                        sdiv_up64(partition_sizze_203577 *
                                                  n_203490,
                                                  segscan_group_sizze_227905 *
                                                  (int64_t) 3) *
                                        segscan_group_sizze_227905;
                                int64_t numGroups_236685 =
                                        sdiv_up64(partition_sizze_203577 *
                                                  n_203490,
                                                  segscan_group_sizze_227905 *
                                                  (int64_t) 3);
                                struct memblock_device
                                mainziid_counter_mem_236686 =
                                ctx->mainziid_counter_mem_236686;
                                struct memblock_device status_flags_mem_236688;
                                
                                status_flags_mem_236688.references = NULL;
                                if (memblock_alloc_device(ctx,
                                                          &status_flags_mem_236688,
                                                          numGroups_236685,
                                                          "status_flags_mem_236688")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device aggregates_mem_236690;
                                
                                aggregates_mem_236690.references = NULL;
                                if (memblock_alloc_device(ctx,
                                                          &aggregates_mem_236690,
                                                          (int64_t) 8 *
                                                          numGroups_236685,
                                                          "aggregates_mem_236690")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device incprefixes_mem_236692;
                                
                                incprefixes_mem_236692.references = NULL;
                                if (memblock_alloc_device(ctx,
                                                          &incprefixes_mem_236692,
                                                          (int64_t) 8 *
                                                          numGroups_236685,
                                                          "incprefixes_mem_236692")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device aggregates_mem_236694;
                                
                                aggregates_mem_236694.references = NULL;
                                if (memblock_alloc_device(ctx,
                                                          &aggregates_mem_236694,
                                                          (int64_t) 8 *
                                                          numGroups_236685,
                                                          "aggregates_mem_236694")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device incprefixes_mem_236696;
                                
                                incprefixes_mem_236696.references = NULL;
                                if (memblock_alloc_device(ctx,
                                                          &incprefixes_mem_236696,
                                                          (int64_t) 8 *
                                                          numGroups_236685,
                                                          "incprefixes_mem_236696")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device aggregates_mem_236698;
                                
                                aggregates_mem_236698.references = NULL;
                                if (memblock_alloc_device(ctx,
                                                          &aggregates_mem_236698,
                                                          (int64_t) 8 *
                                                          numGroups_236685,
                                                          "aggregates_mem_236698")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device incprefixes_mem_236700;
                                
                                incprefixes_mem_236700.references = NULL;
                                if (memblock_alloc_device(ctx,
                                                          &incprefixes_mem_236700,
                                                          (int64_t) 8 *
                                                          numGroups_236685,
                                                          "incprefixes_mem_236700")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device aggregates_mem_236702;
                                
                                aggregates_mem_236702.references = NULL;
                                if (memblock_alloc_device(ctx,
                                                          &aggregates_mem_236702,
                                                          (int64_t) 8 *
                                                          numGroups_236685,
                                                          "aggregates_mem_236702")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device incprefixes_mem_236704;
                                
                                incprefixes_mem_236704.references = NULL;
                                if (memblock_alloc_device(ctx,
                                                          &incprefixes_mem_236704,
                                                          (int64_t) 8 *
                                                          numGroups_236685,
                                                          "incprefixes_mem_236704")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhreplicate_i8(ctx,
                                                                 status_flags_mem_236688,
                                                                 numGroups_236685,
                                                                 (int8_t) 0) !=
                                    0) {
                                    if (memblock_unref_device(ctx,
                                                              &incprefixes_mem_236704,
                                                              "incprefixes_mem_236704") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &aggregates_mem_236702,
                                                              "aggregates_mem_236702") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &incprefixes_mem_236700,
                                                              "incprefixes_mem_236700") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &aggregates_mem_236698,
                                                              "aggregates_mem_236698") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &incprefixes_mem_236696,
                                                              "incprefixes_mem_236696") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &aggregates_mem_236694,
                                                              "aggregates_mem_236694") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &incprefixes_mem_236692,
                                                              "incprefixes_mem_236692") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &aggregates_mem_236690,
                                                              "aggregates_mem_236690") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &status_flags_mem_236688,
                                                              "status_flags_mem_236688") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_231785,
                                                              "mem_231785") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_231781,
                                                              "mem_231781") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_231777,
                                                              "mem_231777") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_231773,
                                                              "mem_231773") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_231769,
                                                              "mem_231769") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231787,
                                                              "ext_mem_231787") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_231739,
                                                              "mem_231739") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_231733,
                                                              "mem_param_231733") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231790,
                                                              "ext_mem_231790") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_231725,
                                                              "mem_231725") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231798,
                                                              "ext_mem_231798") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231816,
                                                              "ext_mem_231816") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231560,
                                                              "ext_mem_231560") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231561,
                                                              "ext_mem_231561") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231852,
                                                              "ext_mem_231852") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229515,
                                                              "mem_param_229515") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229507,
                                                              "mem_param_229507") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231517,
                                                              "ext_mem_231517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231518,
                                                              "ext_mem_231518") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229493,
                                                              "mem_param_229493") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229485,
                                                              "mem_param_229485") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229477,
                                                              "mem_param_229477") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231860,
                                                              "ext_mem_231860") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231861,
                                                              "ext_mem_231861") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231862,
                                                              "ext_mem_231862") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230551,
                                                              "mem_230551") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230534,
                                                              "mem_230534") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230517,
                                                              "mem_230517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230500,
                                                              "mem_230500") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229531,
                                                              "mem_229531") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229526,
                                                              "mem_229526") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229520,
                                                              "mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229469,
                                                              "mem_229469") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229465,
                                                              "mem_229465") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229460,
                                                              "ext_mem_229460") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229461,
                                                              "ext_mem_229461") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229411,
                                                              "ext_mem_229411") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229412,
                                                              "ext_mem_229412") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229362,
                                                              "ext_mem_229362") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229363,
                                                              "ext_mem_229363") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229264,
                                                              "ext_mem_229264") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229265,
                                                              "ext_mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229206,
                                                              "mem_229206") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229200,
                                                              "mem_229200") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229196,
                                                              "ext_mem_229196") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229197,
                                                              "ext_mem_229197") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229164,
                                                              "mem_229164") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229161,
                                                              "mem_229161") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229157,
                                                              "mem_229157") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229155,
                                                              "mem_229155") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229152,
                                                              "mem_229152") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229148,
                                                              "mem_229148") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232249,
                                                              "mem_out_232249") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232248,
                                                              "mem_out_232248") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232247,
                                                              "mem_out_232247") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                unsigned int shared_sizze_239102 =
                                             smax64(smax64((int64_t) 1056,
                                                           sdiv_up64(sdiv_up64(sdiv_up64((int64_t) 8 *
                                                                                         segscan_group_sizze_227905,
                                                                                         (int64_t) 8) *
                                                                               (int64_t) 8 +
                                                                               (int64_t) 8 *
                                                                               segscan_group_sizze_227905,
                                                                               (int64_t) 8) *
                                                                     (int64_t) 8 +
                                                                     (int64_t) 8 *
                                                                     segscan_group_sizze_227905,
                                                                     (int64_t) 8) *
                                                           (int64_t) 8 +
                                                           (int64_t) 8 *
                                                           segscan_group_sizze_227905),
                                                    smax64(smax64(smax64((int64_t) 3 *
                                                                         segscan_group_sizze_227905 *
                                                                         (int64_t) 8,
                                                                         (int64_t) 3 *
                                                                         segscan_group_sizze_227905 *
                                                                         (int64_t) 8),
                                                                  (int64_t) 3 *
                                                                  segscan_group_sizze_227905 *
                                                                  (int64_t) 8),
                                                           (int64_t) 3 *
                                                           segscan_group_sizze_227905 *
                                                           (int64_t) 8));
                                CUdeviceptr kernel_arg_239104 =
                                            mem_param_231733.mem;
                                CUdeviceptr kernel_arg_239105 = mem_231769.mem;
                                CUdeviceptr kernel_arg_239106 = mem_231773.mem;
                                CUdeviceptr kernel_arg_239107 = mem_231777.mem;
                                CUdeviceptr kernel_arg_239108 = mem_231781.mem;
                                CUdeviceptr kernel_arg_239109 = mem_231785.mem;
                                CUdeviceptr kernel_arg_239110 =
                                            mainziid_counter_mem_236686.mem;
                                CUdeviceptr kernel_arg_239111 =
                                            status_flags_mem_236688.mem;
                                CUdeviceptr kernel_arg_239112 =
                                            aggregates_mem_236690.mem;
                                CUdeviceptr kernel_arg_239113 =
                                            incprefixes_mem_236692.mem;
                                CUdeviceptr kernel_arg_239114 =
                                            aggregates_mem_236694.mem;
                                CUdeviceptr kernel_arg_239115 =
                                            incprefixes_mem_236696.mem;
                                CUdeviceptr kernel_arg_239116 =
                                            aggregates_mem_236698.mem;
                                CUdeviceptr kernel_arg_239117 =
                                            incprefixes_mem_236700.mem;
                                CUdeviceptr kernel_arg_239118 =
                                            aggregates_mem_236702.mem;
                                CUdeviceptr kernel_arg_239119 =
                                            incprefixes_mem_236704.mem;
                                unsigned int shared_offset_239103 = 0;
                                
                                if ((((((1 && sdiv_up64(partition_sizze_203577 *
                                                        n_203490,
                                                        segscan_group_sizze_227905 *
                                                        (int64_t) 3) != 0) &&
                                        1 != 0) && 1 != 0) &&
                                      segscan_group_sizze_227905 != 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_203577 *
                                                  n_203490,
                                                  segscan_group_sizze_227905 *
                                                  (int64_t) 3);
                                    grid[perm[1]] = 1;
                                    grid[perm[2]] = 1;
                                    
                                    void *kernel_args_239099[] =
                                         {&ctx->global_failure,
                                          &shared_offset_239103, &n_203490,
                                          &partition_sizze_203577,
                                          &cond_f_res_227801,
                                          &cond_f_res_227802,
                                          &unsign_arg_227803,
                                          &unsign_arg_227804,
                                          &kernel_arg_239104,
                                          &kernel_arg_239105,
                                          &kernel_arg_239106,
                                          &kernel_arg_239107,
                                          &kernel_arg_239108,
                                          &kernel_arg_239109,
                                          &kernel_arg_239110,
                                          &kernel_arg_239111,
                                          &kernel_arg_239112,
                                          &kernel_arg_239113,
                                          &kernel_arg_239114,
                                          &kernel_arg_239115,
                                          &kernel_arg_239116,
                                          &kernel_arg_239117,
                                          &kernel_arg_239118,
                                          &kernel_arg_239119};
                                    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.segscan_227915",
                                                (long) sdiv_up64(partition_sizze_203577 *
                                                                 n_203490,
                                                                 segscan_group_sizze_227905 *
                                                                 (int64_t) 3),
                                                (long) 1, (long) 1,
                                                (long) segscan_group_sizze_227905,
                                                (long) 1, (long) 1, (int) (0 +
                                                                           (shared_sizze_239102 +
                                                                            (8 -
                                                                             shared_sizze_239102 %
                                                                             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->mainzisegscan_227915_runs,
                                                                  &ctx->mainzisegscan_227915_total_runtime);
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                           0));
                                    }
                                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegscan_227915,
                                                                          grid[0],
                                                                          grid[1],
                                                                          grid[2],
                                                                          segscan_group_sizze_227905,
                                                                          1, 1,
                                                                          0 +
                                                                          (shared_sizze_239102 +
                                                                           (8 -
                                                                            shared_sizze_239102 %
                                                                            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.segscan_227915",
                                                time_end_239101 -
                                                time_start_239100);
                                    }
                                }
                                if (memblock_unref_device(ctx,
                                                          &incprefixes_mem_236704,
                                                          "incprefixes_mem_236704") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &aggregates_mem_236702,
                                                          "aggregates_mem_236702") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &incprefixes_mem_236700,
                                                          "incprefixes_mem_236700") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &aggregates_mem_236698,
                                                          "aggregates_mem_236698") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &incprefixes_mem_236696,
                                                          "incprefixes_mem_236696") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &aggregates_mem_236694,
                                                          "aggregates_mem_236694") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &incprefixes_mem_236692,
                                                          "incprefixes_mem_236692") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &aggregates_mem_236690,
                                                          "aggregates_mem_236690") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &status_flags_mem_236688,
                                                          "status_flags_mem_236688") !=
                                    0)
                                    return 1;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            
                            CUdeviceptr kernel_arg_239123 =
                                        mem_param_231733.mem;
                            CUdeviceptr kernel_arg_239124 = mem_231739.mem;
                            CUdeviceptr kernel_arg_239125 = mem_231769.mem;
                            CUdeviceptr kernel_arg_239126 = mem_231773.mem;
                            CUdeviceptr kernel_arg_239127 = mem_231777.mem;
                            CUdeviceptr kernel_arg_239128 = mem_231781.mem;
                            CUdeviceptr kernel_arg_239129 = mem_231785.mem;
                            
                            if ((((((1 && segmap_usable_groups_227982 != 0) &&
                                    1 != 0) && 1 != 0) &&
                                  segmap_group_sizze_227981 != 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_227982;
                                grid[perm[1]] = 1;
                                grid[perm[2]] = 1;
                                
                                void *kernel_args_239120[] =
                                     {&ctx->global_failure, &n_203490,
                                      &partition_sizze_203577, &i_203670,
                                      &kernel_arg_239123, &kernel_arg_239124,
                                      &kernel_arg_239125, &kernel_arg_239126,
                                      &kernel_arg_239127, &kernel_arg_239128,
                                      &kernel_arg_239129};
                                int64_t time_start_239121 = 0, time_end_239122 =
                                        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_227986",
                                            (long) segmap_usable_groups_227982,
                                            (long) 1, (long) 1,
                                            (long) segmap_group_sizze_227981,
                                            (long) 1, (long) 1, (int) 0);
                                    time_start_239121 = get_wall_time();
                                }
                                
                                cudaEvent_t *pevents = NULL;
                                
                                if (ctx->profiling && !ctx->profiling_paused) {
                                    pevents = cuda_get_events(&ctx->cuda,
                                                              &ctx->mainzisegmap_227986_runs,
                                                              &ctx->mainzisegmap_227986_total_runtime);
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                       0));
                                }
                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_227986,
                                                                      grid[0],
                                                                      grid[1],
                                                                      grid[2],
                                                                      segmap_group_sizze_227981,
                                                                      1, 1, 0,
                                                                      NULL,
                                                                      kernel_args_239120,
                                                                      NULL));
                                if (pevents != NULL)
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                       0));
                                if (ctx->debugging) {
                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                    time_end_239122 = get_wall_time();
                                    fprintf(ctx->log,
                                            "Kernel %s runtime: %ldus\n",
                                            "main.segmap_227986",
                                            time_end_239122 -
                                            time_start_239121);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx, &mem_231769,
                                                      "mem_231769") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231773,
                                                      "mem_231773") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231777,
                                                      "mem_231777") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231781,
                                                      "mem_231781") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231785,
                                                      "mem_231785") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_231787,
                                                    &mem_231739,
                                                    "mem_231739") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231785,
                                                      "mem_231785") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231781,
                                                      "mem_231781") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231777,
                                                      "mem_231777") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231773,
                                                      "mem_231773") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231769,
                                                      "mem_231769") != 0)
                                return 1;
                        }
                        if (memblock_unref_device(ctx, &mem_231739,
                                                  "mem_231739") != 0)
                            return 1;
                        
                        struct memblock_device mem_param_tmp_236644;
                        
                        mem_param_tmp_236644.references = NULL;
                        if (memblock_set_device(ctx, &mem_param_tmp_236644,
                                                &ext_mem_231787,
                                                "ext_mem_231787") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &mem_param_231733,
                                                &mem_param_tmp_236644,
                                                "mem_param_tmp_236644") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_tmp_236644,
                                                  "mem_param_tmp_236644") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231787,
                                                  "ext_mem_231787") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231739,
                                                  "mem_231739") != 0)
                            return 1;
                    }
                    if (memblock_set_device(ctx, &ext_mem_231790,
                                            &mem_param_231733,
                                            "mem_param_231733") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_231725, "mem_231725") !=
                        0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_231798,
                                            &ext_mem_231790,
                                            "ext_mem_231790") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_231733,
                                              "mem_param_231733") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231790,
                                              "ext_mem_231790") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_231725, "mem_231725") !=
                        0)
                        return 1;
                }
                
                struct memblock_device mem_231814;
                
                mem_231814.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231814, bytes_229177,
                                          "mem_231814")) {
                    err = 1;
                    goto cleanup;
                }
                {
                    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_231814.mem +
                                                    (int64_t) 0,
                                                    ext_mem_231798.mem +
                                                    (int64_t) 0,
                                                    partition_sizze_203577 *
                                                    n_203490 * (int64_t) 8));
                    if (pevents != NULL)
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                }
                if (memblock_unref_device(ctx, &ext_mem_231798,
                                          "ext_mem_231798") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_231816, &mem_231814,
                                        "mem_231814") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231814, "mem_231814") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231798,
                                          "ext_mem_231798") != 0)
                    return 1;
            }
            if (memblock_unref_device(ctx, &ext_mem_231561, "ext_mem_231561") !=
                0)
                return 1;
            
            bool empty_slice_206791 = j_m_i_204133 == (int64_t) 0;
            int64_t m_206792 = sub64(j_m_i_204133, (int64_t) 1);
            int64_t i_p_m_t_s_206793 = add64(stl_res_203664, m_206792);
            bool zzero_leq_i_p_m_t_s_206794 = sle64((int64_t) 0,
                                                    i_p_m_t_s_206793);
            bool i_p_m_t_s_leq_w_206795 = slt64(i_p_m_t_s_206793, n_203490);
            bool zzero_lte_i_206796 = sle64((int64_t) 0, stl_res_203664);
            bool i_lte_j_206797 = sle64(stl_res_203664, stl_res_203665);
            bool y_206798 = i_p_m_t_s_leq_w_206795 && zzero_lte_i_206796;
            bool y_206799 = zzero_leq_i_p_m_t_s_206794 && y_206798;
            bool y_206800 = i_lte_j_206797 && y_206799;
            bool forwards_ok_206801 = zzero_lte_i_206796 && y_206800;
            bool ok_or_empty_206802 = empty_slice_206791 || forwards_ok_206801;
            bool index_certs_206803;
            
            if (!ok_or_empty_206802) {
                ctx->error =
                    msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                              "Index [", (long long) stl_res_203664, ":",
                              (long long) stl_res_203665,
                              "] out of bounds for array of shape [",
                              (long long) n_203490, "].",
                              "-> #0  stl.fut:344:33-51\n   #1  stl.fut:342:13-349:28\n   #2  stl.fut:415:61-429:75\n   #3  stl.fut:455:3-469:34\n   #4  stl.fut:439:1-469:34\n");
                if (memblock_unref_device(ctx, &ext_mem_231816,
                                          "ext_mem_231816") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231560,
                                          "ext_mem_231560") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231561,
                                          "ext_mem_231561") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231852,
                                          "ext_mem_231852") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_param_229515,
                                          "mem_param_229515") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_param_229507,
                                          "mem_param_229507") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231517,
                                          "ext_mem_231517") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231518,
                                          "ext_mem_231518") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_param_229493,
                                          "mem_param_229493") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_param_229485,
                                          "mem_param_229485") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_param_229477,
                                          "mem_param_229477") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231860,
                                          "ext_mem_231860") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231861,
                                          "ext_mem_231861") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231862,
                                          "ext_mem_231862") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230551, "mem_230551") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230534, "mem_230534") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230517, "mem_230517") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230500, "mem_230500") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229531, "mem_229531") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229526, "mem_229526") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229520, "mem_229520") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229469, "mem_229469") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229465, "mem_229465") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229460,
                                          "ext_mem_229460") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229461,
                                          "ext_mem_229461") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229411,
                                          "ext_mem_229411") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229412,
                                          "ext_mem_229412") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229362,
                                          "ext_mem_229362") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229363,
                                          "ext_mem_229363") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229264,
                                          "ext_mem_229264") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229265,
                                          "ext_mem_229265") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229206, "mem_229206") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229200, "mem_229200") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229196,
                                          "ext_mem_229196") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229197,
                                          "ext_mem_229197") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_out_232249,
                                          "mem_out_232249") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_out_232248,
                                          "mem_out_232248") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_out_232247,
                                          "mem_out_232247") != 0)
                    return 1;
                err = 1;
                goto cleanup;
            }
            
            bool suff_outer_par_228016;
            
            suff_outer_par_228016 =
                *ctx->tuning_params.mainzisuff_outer_par_38 <=
                partition_sizze_203577;
            if (ctx->logging)
                fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                        "main.suff_outer_par_38", (long) partition_sizze_203577,
                        suff_outer_par_228016 ? "true" : "false");
            
            int64_t segmap_group_sizze_228035;
            
            segmap_group_sizze_228035 =
                *ctx->tuning_params.mainzisegmap_group_sizze_228020;
            
            int64_t nest_sizze_228083 = partition_sizze_203577 * j_m_i_204133;
            int64_t segred_group_sizze_228084;
            
            segred_group_sizze_228084 =
                *ctx->tuning_params.mainzisegred_group_sizze_228067;
            
            int64_t num_groups_228085;
            int32_t max_num_groups_236956;
            
            max_num_groups_236956 =
                *ctx->tuning_params.mainzisegred_num_groups_228069;
            num_groups_228085 = sext_i64_i32(smax64((int64_t) 1,
                                                    smin64(sdiv_up64(nest_sizze_228083,
                                                                     segred_group_sizze_228084),
                                                           sext_i32_i64(max_num_groups_236956))));
            
            int64_t segmap_group_sizze_228097;
            
            segmap_group_sizze_228097 =
                *ctx->tuning_params.mainzisegmap_group_sizze_228055;
            
            struct memblock_device ext_mem_231846;
            
            ext_mem_231846.references = NULL;
            
            struct memblock_device ext_mem_231845;
            
            ext_mem_231845.references = NULL;
            
            struct memblock_device ext_mem_231844;
            
            ext_mem_231844.references = NULL;
            
            int32_t local_memory_capacity_237042;
            
            local_memory_capacity_237042 = ctx->cuda.max_shared_memory;
            if (sle64((int64_t) 0,
                      sext_i32_i64(local_memory_capacity_237042)) &&
                suff_outer_par_228016) {
                int64_t segmap_usable_groups_228036 =
                        sdiv_up64(partition_sizze_203577,
                                  segmap_group_sizze_228035);
                struct memblock_device mem_231819;
                
                mem_231819.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231819, binop_y_229176,
                                          "mem_231819")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhgpu_map_transpose_f64(ctx, mem_231819,
                                                          (int64_t) 0,
                                                          ext_mem_231816,
                                                          (int64_t) 0,
                                                          (int64_t) 1, n_203490,
                                                          partition_sizze_203577) !=
                    0) {
                    if (memblock_unref_device(ctx, &mem_231819, "mem_231819") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231844,
                                              "ext_mem_231844") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231845,
                                              "ext_mem_231845") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231846,
                                              "ext_mem_231846") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231816,
                                              "ext_mem_231816") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231560,
                                              "ext_mem_231560") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231561,
                                              "ext_mem_231561") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231852,
                                              "ext_mem_231852") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229515,
                                              "mem_param_229515") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229507,
                                              "mem_param_229507") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231517,
                                              "ext_mem_231517") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231518,
                                              "ext_mem_231518") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229493,
                                              "mem_param_229493") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229485,
                                              "mem_param_229485") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229477,
                                              "mem_param_229477") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231860,
                                              "ext_mem_231860") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231861,
                                              "ext_mem_231861") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231862,
                                              "ext_mem_231862") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230551, "mem_230551") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230534, "mem_230534") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230517, "mem_230517") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230500, "mem_230500") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229531, "mem_229531") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229526, "mem_229526") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229520, "mem_229520") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229469, "mem_229469") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229465, "mem_229465") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229460,
                                              "ext_mem_229460") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229461,
                                              "ext_mem_229461") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229411,
                                              "ext_mem_229411") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229412,
                                              "ext_mem_229412") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229362,
                                              "ext_mem_229362") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229363,
                                              "ext_mem_229363") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229264,
                                              "ext_mem_229264") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229265,
                                              "ext_mem_229265") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229206, "mem_229206") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229200, "mem_229200") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229196,
                                              "ext_mem_229196") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229197,
                                              "ext_mem_229197") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229164, "mem_229164") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229161, "mem_229161") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229157, "mem_229157") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229155, "mem_229155") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229152, "mem_229152") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229148, "mem_229148") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232249,
                                              "mem_out_232249") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232248,
                                              "mem_out_232248") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232247,
                                              "mem_out_232247") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_231823;
                
                mem_231823.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231823, bytes_229180,
                                          "mem_231823")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_231826;
                
                mem_231826.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231826, bytes_229180,
                                          "mem_231826")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_231829;
                
                mem_231829.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231829, bytes_229180,
                                          "mem_231829")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                
                CUdeviceptr kernel_arg_239133 = mem_231819.mem;
                CUdeviceptr kernel_arg_239134 = mem_231823.mem;
                CUdeviceptr kernel_arg_239135 = mem_231826.mem;
                CUdeviceptr kernel_arg_239136 = mem_231829.mem;
                
                if ((((((1 && segmap_usable_groups_228036 != 0) && 1 != 0) &&
                       1 != 0) && segmap_group_sizze_228035 != 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_228036;
                    grid[perm[1]] = 1;
                    grid[perm[2]] = 1;
                    
                    void *kernel_args_239130[] = {&ctx->global_failure,
                                                  &partition_sizze_203577,
                                                  &stl_res_203664,
                                                  &j_m_i_204133,
                                                  &kernel_arg_239133,
                                                  &kernel_arg_239134,
                                                  &kernel_arg_239135,
                                                  &kernel_arg_239136};
                    int64_t time_start_239131 = 0, time_end_239132 = 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_228041",
                                (long) segmap_usable_groups_228036, (long) 1,
                                (long) 1, (long) segmap_group_sizze_228035,
                                (long) 1, (long) 1, (int) 0);
                        time_start_239131 = get_wall_time();
                    }
                    
                    cudaEvent_t *pevents = NULL;
                    
                    if (ctx->profiling && !ctx->profiling_paused) {
                        pevents = cuda_get_events(&ctx->cuda,
                                                  &ctx->mainzisegmap_228041_runs,
                                                  &ctx->mainzisegmap_228041_total_runtime);
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                    }
                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_228041,
                                                          grid[0], grid[1],
                                                          grid[2],
                                                          segmap_group_sizze_228035,
                                                          1, 1, 0, NULL,
                                                          kernel_args_239130,
                                                          NULL));
                    if (pevents != NULL)
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                    if (ctx->debugging) {
                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                        time_end_239132 = get_wall_time();
                        fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                "main.segmap_228041", time_end_239132 -
                                time_start_239131);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_unref_device(ctx, &mem_231819, "mem_231819") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_231846, &mem_231823,
                                        "mem_231823") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_231845, &mem_231826,
                                        "mem_231826") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_231844, &mem_231829,
                                        "mem_231829") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231829, "mem_231829") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231826, "mem_231826") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231823, "mem_231823") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231819, "mem_231819") != 0)
                    return 1;
            } else {
                struct memblock_device mem_231833;
                
                mem_231833.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231833, bytes_229180,
                                          "mem_231833")) {
                    err = 1;
                    goto cleanup;
                }
                if (slt64(j_m_i_204133 * (int64_t) 2,
                          segred_group_sizze_228084)) {
                    int64_t segment_sizze_nonzzero_236966 = smax64((int64_t) 1,
                                                                   j_m_i_204133);
                    int64_t num_threads_236967 = num_groups_228085 *
                            segred_group_sizze_228084;
                    
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegRed-small");
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "num_segments",
                                (long long) partition_sizze_203577, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                (long long) j_m_i_204133, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "segments_per_group",
                                (long long) squot64(segred_group_sizze_228084,
                                                    segment_sizze_nonzzero_236966),
                                '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "required_groups",
                                (long long) sext_i64_i32(sdiv_up64(partition_sizze_203577,
                                                                   squot64(segred_group_sizze_228084,
                                                                           segment_sizze_nonzzero_236966))),
                                '\n');
                    
                    unsigned int shared_sizze_239140 = (int64_t) 8 *
                                 segred_group_sizze_228084;
                    CUdeviceptr kernel_arg_239142 = ext_mem_231816.mem;
                    CUdeviceptr kernel_arg_239143 = mem_231833.mem;
                    unsigned int shared_offset_239141 = 0;
                    
                    if ((((((1 && num_groups_228085 != 0) && 1 != 0) && 1 !=
                           0) && segred_group_sizze_228084 != 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_228085;
                        grid[perm[1]] = 1;
                        grid[perm[2]] = 1;
                        
                        void *kernel_args_239137[] = {&ctx->global_failure,
                                                      &shared_offset_239141,
                                                      &n_203490,
                                                      &partition_sizze_203577,
                                                      &stl_res_203664,
                                                      &j_m_i_204133,
                                                      &num_groups_228085,
                                                      &segment_sizze_nonzzero_236966,
                                                      &kernel_arg_239142,
                                                      &kernel_arg_239143};
                        int64_t time_start_239138 = 0, time_end_239139 = 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_228090",
                                    (long) num_groups_228085, (long) 1,
                                    (long) 1, (long) segred_group_sizze_228084,
                                    (long) 1, (long) 1, (int) (0 +
                                                               (shared_sizze_239140 +
                                                                (8 -
                                                                 shared_sizze_239140 %
                                                                 8) % 8)));
                            time_start_239138 = get_wall_time();
                        }
                        
                        cudaEvent_t *pevents = NULL;
                        
                        if (ctx->profiling && !ctx->profiling_paused) {
                            pevents = cuda_get_events(&ctx->cuda,
                                                      &ctx->mainzisegred_small_228090_runs,
                                                      &ctx->mainzisegred_small_228090_total_runtime);
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                        }
                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_small_228090,
                                                              grid[0], grid[1],
                                                              grid[2],
                                                              segred_group_sizze_228084,
                                                              1, 1, 0 +
                                                              (shared_sizze_239140 +
                                                               (8 -
                                                                shared_sizze_239140 %
                                                                8) % 8), NULL,
                                                              kernel_args_239137,
                                                              NULL));
                        if (pevents != NULL)
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                        if (ctx->debugging) {
                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                            time_end_239139 = get_wall_time();
                            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                    "main.segred_small_228090",
                                    time_end_239139 - time_start_239138);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                } else {
                    int64_t groups_per_segment_236993 =
                            sdiv_up64(num_groups_228085, smax64((int64_t) 1,
                                                                partition_sizze_203577));
                    int64_t elements_per_thread_236994 = sdiv_up64(j_m_i_204133,
                                                                   segred_group_sizze_228084 *
                                                                   groups_per_segment_236993);
                    int64_t virt_num_groups_236995 = groups_per_segment_236993 *
                            partition_sizze_203577;
                    int64_t num_threads_236996 = num_groups_228085 *
                            segred_group_sizze_228084;
                    int64_t threads_per_segment_236997 =
                            groups_per_segment_236993 *
                            segred_group_sizze_228084;
                    
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegRed-large");
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "num_segments",
                                (long long) partition_sizze_203577, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                (long long) j_m_i_204133, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "virt_num_groups",
                                (long long) virt_num_groups_236995, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "num_groups",
                                (long long) num_groups_228085, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "group_size",
                                (long long) segred_group_sizze_228084, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "elems_per_thread",
                                (long long) elements_per_thread_236994, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "groups_per_segment",
                                (long long) groups_per_segment_236993, '\n');
                    
                    struct memblock_device segred_tmp_mem_236998;
                    
                    segred_tmp_mem_236998.references = NULL;
                    if (memblock_alloc_device(ctx, &segred_tmp_mem_236998,
                                              (int64_t) 8 *
                                              virt_num_groups_236995,
                                              "segred_tmp_mem_236998")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mainzicounter_mem_237000 =
                                           ctx->mainzicounter_mem_237000;
                    unsigned int shared_sizze_239148 = 1;
                    unsigned int shared_sizze_239150 = (int64_t) 8 *
                                 segred_group_sizze_228084;
                    CUdeviceptr kernel_arg_239152 = ext_mem_231816.mem;
                    CUdeviceptr kernel_arg_239153 = mem_231833.mem;
                    CUdeviceptr kernel_arg_239154 = segred_tmp_mem_236998.mem;
                    CUdeviceptr kernel_arg_239155 =
                                mainzicounter_mem_237000.mem;
                    unsigned int shared_offset_239149 = 0;
                    unsigned int shared_offset_239151 = 0 +
                                 (shared_sizze_239148 + (8 -
                                                         shared_sizze_239148 %
                                                         8) % 8);
                    
                    if ((((((1 && num_groups_228085 != 0) && 1 != 0) && 1 !=
                           0) && segred_group_sizze_228084 != 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_228085;
                        grid[perm[1]] = 1;
                        grid[perm[2]] = 1;
                        
                        void *kernel_args_239145[] = {&ctx->global_failure,
                                                      &shared_offset_239149,
                                                      &shared_offset_239151,
                                                      &n_203490,
                                                      &partition_sizze_203577,
                                                      &stl_res_203664,
                                                      &j_m_i_204133,
                                                      &num_groups_228085,
                                                      &groups_per_segment_236993,
                                                      &elements_per_thread_236994,
                                                      &virt_num_groups_236995,
                                                      &threads_per_segment_236997,
                                                      &kernel_arg_239152,
                                                      &kernel_arg_239153,
                                                      &kernel_arg_239154,
                                                      &kernel_arg_239155};
                        int64_t time_start_239146 = 0, time_end_239147 = 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_228090",
                                    (long) num_groups_228085, (long) 1,
                                    (long) 1, (long) segred_group_sizze_228084,
                                    (long) 1, (long) 1, (int) (0 +
                                                               (shared_sizze_239148 +
                                                                (8 -
                                                                 shared_sizze_239148 %
                                                                 8) % 8) +
                                                               (shared_sizze_239150 +
                                                                (8 -
                                                                 shared_sizze_239150 %
                                                                 8) % 8)));
                            time_start_239146 = get_wall_time();
                        }
                        
                        cudaEvent_t *pevents = NULL;
                        
                        if (ctx->profiling && !ctx->profiling_paused) {
                            pevents = cuda_get_events(&ctx->cuda,
                                                      &ctx->mainzisegred_large_228090_runs,
                                                      &ctx->mainzisegred_large_228090_total_runtime);
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                        }
                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_large_228090,
                                                              grid[0], grid[1],
                                                              grid[2],
                                                              segred_group_sizze_228084,
                                                              1, 1, 0 +
                                                              (shared_sizze_239148 +
                                                               (8 -
                                                                shared_sizze_239148 %
                                                                8) % 8) +
                                                              (shared_sizze_239150 +
                                                               (8 -
                                                                shared_sizze_239150 %
                                                                8) % 8), NULL,
                                                              kernel_args_239145,
                                                              NULL));
                        if (pevents != NULL)
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                        if (ctx->debugging) {
                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                            time_end_239147 = get_wall_time();
                            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                    "main.segred_large_228090",
                                    time_end_239147 - time_start_239146);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    if (memblock_unref_device(ctx, &segred_tmp_mem_236998,
                                              "segred_tmp_mem_236998") != 0)
                        return 1;
                }
                
                int64_t segmap_usable_groups_228098 =
                        sdiv_up64(partition_sizze_203577,
                                  segmap_group_sizze_228097);
                struct memblock_device mem_231837;
                
                mem_231837.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231837, bytes_229180,
                                          "mem_231837")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_231840;
                
                mem_231840.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231840, bytes_229180,
                                          "mem_231840")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_231843;
                
                mem_231843.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231843, bytes_229180,
                                          "mem_231843")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                
                CUdeviceptr kernel_arg_239159 = mem_231833.mem;
                CUdeviceptr kernel_arg_239160 = mem_231837.mem;
                CUdeviceptr kernel_arg_239161 = mem_231840.mem;
                CUdeviceptr kernel_arg_239162 = mem_231843.mem;
                
                if ((((((1 && segmap_usable_groups_228098 != 0) && 1 != 0) &&
                       1 != 0) && segmap_group_sizze_228097 != 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_228098;
                    grid[perm[1]] = 1;
                    grid[perm[2]] = 1;
                    
                    void *kernel_args_239156[] = {&ctx->global_failure,
                                                  &partition_sizze_203577,
                                                  &kernel_arg_239159,
                                                  &kernel_arg_239160,
                                                  &kernel_arg_239161,
                                                  &kernel_arg_239162};
                    int64_t time_start_239157 = 0, time_end_239158 = 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_228103",
                                (long) segmap_usable_groups_228098, (long) 1,
                                (long) 1, (long) segmap_group_sizze_228097,
                                (long) 1, (long) 1, (int) 0);
                        time_start_239157 = get_wall_time();
                    }
                    
                    cudaEvent_t *pevents = NULL;
                    
                    if (ctx->profiling && !ctx->profiling_paused) {
                        pevents = cuda_get_events(&ctx->cuda,
                                                  &ctx->mainzisegmap_228103_runs,
                                                  &ctx->mainzisegmap_228103_total_runtime);
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                    }
                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_228103,
                                                          grid[0], grid[1],
                                                          grid[2],
                                                          segmap_group_sizze_228097,
                                                          1, 1, 0, NULL,
                                                          kernel_args_239156,
                                                          NULL));
                    if (pevents != NULL)
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                    if (ctx->debugging) {
                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                        time_end_239158 = get_wall_time();
                        fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                "main.segmap_228103", time_end_239158 -
                                time_start_239157);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_unref_device(ctx, &mem_231833, "mem_231833") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_231846, &mem_231837,
                                        "mem_231837") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_231845, &mem_231840,
                                        "mem_231840") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_231844, &mem_231843,
                                        "mem_231843") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231843, "mem_231843") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231840, "mem_231840") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231837, "mem_231837") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231833, "mem_231833") != 0)
                    return 1;
            }
            if (memblock_unref_device(ctx, &ext_mem_231816, "ext_mem_231816") !=
                0)
                return 1;
            
            int64_t segmap_group_sizze_228184;
            
            segmap_group_sizze_228184 =
                *ctx->tuning_params.mainzisegmap_group_sizze_228124;
            
            int64_t segmap_usable_groups_228185 = sdiv_up64(nest_sizze_207000,
                                                            segmap_group_sizze_228184);
            struct memblock_device mem_231851;
            
            mem_231851.references = NULL;
            if (memblock_alloc_device(ctx, &mem_231851, bytes_229177,
                                      "mem_231851")) {
                err = 1;
                goto cleanup;
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            
            CUdeviceptr kernel_arg_239166 = ext_mem_231560.mem;
            CUdeviceptr kernel_arg_239167 = ext_mem_231844.mem;
            CUdeviceptr kernel_arg_239168 = ext_mem_231845.mem;
            CUdeviceptr kernel_arg_239169 = ext_mem_231846.mem;
            CUdeviceptr kernel_arg_239170 = mem_231851.mem;
            
            if ((((((1 && segmap_usable_groups_228185 != 0) && 1 != 0) && 1 !=
                   0) && segmap_group_sizze_228184 != 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_228185;
                grid[perm[1]] = 1;
                grid[perm[2]] = 1;
                
                void *kernel_args_239163[] = {&ctx->global_failure, &n_203490,
                                              &partition_sizze_203577,
                                              &kernel_arg_239166,
                                              &kernel_arg_239167,
                                              &kernel_arg_239168,
                                              &kernel_arg_239169,
                                              &kernel_arg_239170};
                int64_t time_start_239164 = 0, time_end_239165 = 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_228189",
                            (long) segmap_usable_groups_228185, (long) 1,
                            (long) 1, (long) segmap_group_sizze_228184,
                            (long) 1, (long) 1, (int) 0);
                    time_start_239164 = get_wall_time();
                }
                
                cudaEvent_t *pevents = NULL;
                
                if (ctx->profiling && !ctx->profiling_paused) {
                    pevents = cuda_get_events(&ctx->cuda,
                                              &ctx->mainzisegmap_228189_runs,
                                              &ctx->mainzisegmap_228189_total_runtime);
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                }
                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_228189,
                                                      grid[0], grid[1], grid[2],
                                                      segmap_group_sizze_228184,
                                                      1, 1, 0, NULL,
                                                      kernel_args_239163,
                                                      NULL));
                if (pevents != NULL)
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                if (ctx->debugging) {
                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                    time_end_239165 = get_wall_time();
                    fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                            "main.segmap_228189", time_end_239165 -
                            time_start_239164);
                }
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            if (memblock_unref_device(ctx, &ext_mem_231560, "ext_mem_231560") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231844, "ext_mem_231844") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231845, "ext_mem_231845") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231846, "ext_mem_231846") !=
                0)
                return 1;
            if (memblock_set_device(ctx, &ext_mem_231852, &mem_231851,
                                    "mem_231851") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_231851, "mem_231851") != 0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231844, "ext_mem_231844") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231845, "ext_mem_231845") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231846, "ext_mem_231846") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231816, "ext_mem_231816") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231560, "ext_mem_231560") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231561, "ext_mem_231561") !=
                0)
                return 1;
        } else {
            if (memblock_set_device(ctx, &ext_mem_231852, &mem_param_229493,
                                    "mem_param_229493") != 0)
                return 1;
        }
        
        int64_t ctx_param_ext_tmp_232980 = ext_231524;
        int64_t ctx_param_ext_tmp_232981 = ext_231522;
        int64_t ctx_param_ext_tmp_232982 = ext_231857;
        int64_t ctx_param_ext_tmp_232983 = ext_231856;
        int64_t ctx_param_ext_tmp_232984 = ext_231853;
        int64_t ctx_param_ext_tmp_232985 = ext_231855;
        int64_t ctx_param_ext_tmp_232986 = ext_231859;
        int64_t ctx_param_ext_tmp_232987 = ext_231854;
        int64_t ctx_param_ext_tmp_232988 = ext_231858;
        struct memblock_device mem_param_tmp_232989;
        
        mem_param_tmp_232989.references = NULL;
        if (memblock_set_device(ctx, &mem_param_tmp_232989, &ext_mem_231518,
                                "ext_mem_231518") != 0)
            return 1;
        
        struct memblock_device mem_param_tmp_232990;
        
        mem_param_tmp_232990.references = NULL;
        if (memblock_set_device(ctx, &mem_param_tmp_232990, &ext_mem_231517,
                                "ext_mem_231517") != 0)
            return 1;
        
        struct memblock_device mem_param_tmp_232991;
        
        mem_param_tmp_232991.references = NULL;
        if (memblock_set_device(ctx, &mem_param_tmp_232991, &ext_mem_231852,
                                "ext_mem_231852") != 0)
            return 1;
        ctx_param_ext_229479 = ctx_param_ext_tmp_232980;
        ctx_param_ext_229481 = ctx_param_ext_tmp_232981;
        ctx_param_ext_229486 = ctx_param_ext_tmp_232982;
        ctx_param_ext_229487 = ctx_param_ext_tmp_232983;
        ctx_param_ext_229488 = ctx_param_ext_tmp_232984;
        ctx_param_ext_229489 = ctx_param_ext_tmp_232985;
        ctx_param_ext_229490 = ctx_param_ext_tmp_232986;
        ctx_param_ext_229491 = ctx_param_ext_tmp_232987;
        ctx_param_ext_229492 = ctx_param_ext_tmp_232988;
        if (memblock_set_device(ctx, &mem_param_229477, &mem_param_tmp_232989,
                                "mem_param_tmp_232989") != 0)
            return 1;
        if (memblock_set_device(ctx, &mem_param_229485, &mem_param_tmp_232990,
                                "mem_param_tmp_232990") != 0)
            return 1;
        if (memblock_set_device(ctx, &mem_param_229493, &mem_param_tmp_232991,
                                "mem_param_tmp_232991") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_tmp_232991,
                                  "mem_param_tmp_232991") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_tmp_232990,
                                  "mem_param_tmp_232990") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_tmp_232989,
                                  "mem_param_tmp_232989") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231852, "ext_mem_231852") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229515, "mem_param_229515") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229507, "mem_param_229507") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231517, "ext_mem_231517") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231518, "ext_mem_231518") != 0)
            return 1;
    }
    ext_231875 = ctx_param_ext_229479;
    ext_231873 = ctx_param_ext_229481;
    ext_231869 = ctx_param_ext_229486;
    ext_231868 = ctx_param_ext_229487;
    ext_231867 = ctx_param_ext_229488;
    ext_231866 = ctx_param_ext_229489;
    ext_231865 = ctx_param_ext_229490;
    ext_231864 = ctx_param_ext_229491;
    ext_231863 = ctx_param_ext_229492;
    if (memblock_set_device(ctx, &ext_mem_231862, &mem_param_229477,
                            "mem_param_229477") != 0)
        return 1;
    if (memblock_set_device(ctx, &ext_mem_231861, &mem_param_229485,
                            "mem_param_229485") != 0)
        return 1;
    if (memblock_set_device(ctx, &ext_mem_231860, &mem_param_229493,
                            "mem_param_229493") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229196, "ext_mem_229196") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229197, "ext_mem_229197") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229264, "ext_mem_229264") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229265, "ext_mem_229265") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229362, "ext_mem_229362") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229363, "ext_mem_229363") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229411, "ext_mem_229411") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229412, "ext_mem_229412") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229460, "ext_mem_229460") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229461, "ext_mem_229461") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229465, "mem_229465") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229469, "mem_229469") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229520, "mem_229520") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229526, "mem_229526") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229531, "mem_229531") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_230500, "mem_230500") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_230517, "mem_230517") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_230534, "mem_230534") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_230551, "mem_230551") != 0)
        return 1;
    
    struct memblock_device mem_231887;
    
    mem_231887.references = NULL;
    if (memblock_alloc_device(ctx, &mem_231887, bytes_229160, "mem_231887")) {
        err = 1;
        goto cleanup;
    }
    if (futrts_builtinzhreplicate_f64(ctx, mem_231887, m_203489 * n_203490,
                                      NAN) != 0) {
        if (memblock_unref_device(ctx, &mem_231887, "mem_231887") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229493, "mem_param_229493") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229485, "mem_param_229485") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229477, "mem_param_229477") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231860, "ext_mem_231860") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231861, "ext_mem_231861") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231862, "ext_mem_231862") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230551, "mem_230551") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230534, "mem_230534") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230517, "mem_230517") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230500, "mem_230500") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229531, "mem_229531") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229526, "mem_229526") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229520, "mem_229520") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229469, "mem_229469") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229465, "mem_229465") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229460, "ext_mem_229460") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229461, "ext_mem_229461") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229411, "ext_mem_229411") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229412, "ext_mem_229412") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229362, "ext_mem_229362") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229363, "ext_mem_229363") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229264, "ext_mem_229264") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229265, "ext_mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229206, "mem_229206") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229200, "mem_229200") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229196, "ext_mem_229196") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229197, "ext_mem_229197") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    struct memblock_device mem_231891;
    
    mem_231891.references = NULL;
    if (memblock_alloc_device(ctx, &mem_231891, bytes_229160, "mem_231891")) {
        err = 1;
        goto cleanup;
    }
    if (futrts_builtinzhreplicate_f64(ctx, mem_231891, m_203489 * n_203490,
                                      NAN) != 0) {
        if (memblock_unref_device(ctx, &mem_231891, "mem_231891") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_231887, "mem_231887") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229493, "mem_param_229493") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229485, "mem_param_229485") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229477, "mem_param_229477") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231860, "ext_mem_231860") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231861, "ext_mem_231861") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231862, "ext_mem_231862") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230551, "mem_230551") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230534, "mem_230534") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230517, "mem_230517") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230500, "mem_230500") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229531, "mem_229531") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229526, "mem_229526") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229520, "mem_229520") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229469, "mem_229469") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229465, "mem_229465") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229460, "ext_mem_229460") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229461, "ext_mem_229461") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229411, "ext_mem_229411") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229412, "ext_mem_229412") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229362, "ext_mem_229362") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229363, "ext_mem_229363") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229264, "ext_mem_229264") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229265, "ext_mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229206, "mem_229206") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229200, "mem_229200") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229196, "ext_mem_229196") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229197, "ext_mem_229197") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    struct memblock_device mem_231895;
    
    mem_231895.references = NULL;
    if (memblock_alloc_device(ctx, &mem_231895, bytes_229160, "mem_231895")) {
        err = 1;
        goto cleanup;
    }
    if (futrts_builtinzhreplicate_f64(ctx, mem_231895, m_203489 * n_203490,
                                      NAN) != 0) {
        if (memblock_unref_device(ctx, &mem_231895, "mem_231895") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_231891, "mem_231891") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_231887, "mem_231887") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229493, "mem_param_229493") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229485, "mem_param_229485") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229477, "mem_param_229477") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231860, "ext_mem_231860") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231861, "ext_mem_231861") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231862, "ext_mem_231862") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230551, "mem_230551") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230534, "mem_230534") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230517, "mem_230517") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230500, "mem_230500") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229531, "mem_229531") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229526, "mem_229526") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229520, "mem_229520") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229469, "mem_229469") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229465, "mem_229465") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229460, "ext_mem_229460") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229461, "ext_mem_229461") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229411, "ext_mem_229411") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229412, "ext_mem_229412") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229362, "ext_mem_229362") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229363, "ext_mem_229363") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229264, "ext_mem_229264") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229265, "ext_mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229206, "mem_229206") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229200, "mem_229200") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229196, "ext_mem_229196") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229197, "ext_mem_229197") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t segmap_group_sizze_228215;
    
    segmap_group_sizze_228215 =
        *ctx->tuning_params.mainzisegmap_group_sizze_228214;
    
    int64_t num_groups_228217;
    int32_t max_num_groups_237053;
    
    max_num_groups_237053 = *ctx->tuning_params.mainzisegmap_num_groups_228216;
    num_groups_228217 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(partition_sizze_203577,
                                                             segmap_group_sizze_228215),
                                                   sext_i32_i64(max_num_groups_237053))));
    
    struct memblock_device mem_231898;
    
    mem_231898.references = NULL;
    if (memblock_alloc_device(ctx, &mem_231898, binop_y_229176, "mem_231898")) {
        err = 1;
        goto cleanup;
    }
    if (futrts_builtinzhgpu_map_transpose_f64(ctx, mem_231898, (int64_t) 0,
                                              ext_mem_231862, (int64_t) 0,
                                              (int64_t) 1, n_203490,
                                              partition_sizze_203577) != 0) {
        if (memblock_unref_device(ctx, &mem_231898, "mem_231898") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_231895, "mem_231895") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_231891, "mem_231891") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_231887, "mem_231887") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229493, "mem_param_229493") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229485, "mem_param_229485") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229477, "mem_param_229477") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231860, "ext_mem_231860") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231861, "ext_mem_231861") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231862, "ext_mem_231862") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230551, "mem_230551") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230534, "mem_230534") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230517, "mem_230517") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230500, "mem_230500") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229531, "mem_229531") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229526, "mem_229526") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229520, "mem_229520") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229469, "mem_229469") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229465, "mem_229465") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229460, "ext_mem_229460") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229461, "ext_mem_229461") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229411, "ext_mem_229411") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229412, "ext_mem_229412") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229362, "ext_mem_229362") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229363, "ext_mem_229363") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229264, "ext_mem_229264") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229265, "ext_mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229206, "mem_229206") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229200, "mem_229200") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229196, "ext_mem_229196") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229197, "ext_mem_229197") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    if (memblock_unref_device(ctx, &ext_mem_231862, "ext_mem_231862") != 0)
        return 1;
    
    struct memblock_device mem_231901;
    
    mem_231901.references = NULL;
    if (memblock_alloc_device(ctx, &mem_231901, binop_y_229176, "mem_231901")) {
        err = 1;
        goto cleanup;
    }
    if (futrts_builtinzhgpu_map_transpose_f64(ctx, mem_231901, (int64_t) 0,
                                              ext_mem_231861, (int64_t) 0,
                                              (int64_t) 1, n_203490,
                                              partition_sizze_203577) != 0) {
        if (memblock_unref_device(ctx, &mem_231901, "mem_231901") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_231898, "mem_231898") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_231895, "mem_231895") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_231891, "mem_231891") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_231887, "mem_231887") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229493, "mem_param_229493") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229485, "mem_param_229485") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229477, "mem_param_229477") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231860, "ext_mem_231860") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231861, "ext_mem_231861") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231862, "ext_mem_231862") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230551, "mem_230551") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230534, "mem_230534") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230517, "mem_230517") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230500, "mem_230500") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229531, "mem_229531") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229526, "mem_229526") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229520, "mem_229520") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229469, "mem_229469") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229465, "mem_229465") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229460, "ext_mem_229460") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229461, "ext_mem_229461") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229411, "ext_mem_229411") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229412, "ext_mem_229412") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229362, "ext_mem_229362") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229363, "ext_mem_229363") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229264, "ext_mem_229264") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229265, "ext_mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229206, "mem_229206") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229200, "mem_229200") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229196, "ext_mem_229196") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229197, "ext_mem_229197") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    if (memblock_unref_device(ctx, &ext_mem_231861, "ext_mem_231861") != 0)
        return 1;
    
    int64_t num_threads_232245 = segmap_group_sizze_228215 * num_groups_228217;
    int64_t total_sizze_232246 = bytes_229169 * num_threads_232245;
    struct memblock_device color_232083;
    
    color_232083.references = NULL;
    if (memblock_alloc_device(ctx, &color_232083, total_sizze_232246,
                              "color_232083")) {
        err = 1;
        goto cleanup;
    }
    if (ctx->debugging)
        fprintf(ctx->log, "%s\n", "\n# SegMap");
    
    CUdeviceptr kernel_arg_239174 = mem_229161.mem;
    CUdeviceptr kernel_arg_239175 = mem_229164.mem;
    CUdeviceptr kernel_arg_239176 = mem_231887.mem;
    CUdeviceptr kernel_arg_239177 = mem_231891.mem;
    CUdeviceptr kernel_arg_239178 = mem_231895.mem;
    CUdeviceptr kernel_arg_239179 = mem_231898.mem;
    CUdeviceptr kernel_arg_239180 = mem_231901.mem;
    CUdeviceptr kernel_arg_239181 = color_232083.mem;
    
    if ((((((1 && num_groups_228217 != 0) && 1 != 0) && 1 != 0) &&
          segmap_group_sizze_228215 != 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_228217;
        grid[perm[1]] = 1;
        grid[perm[2]] = 1;
        
        void *kernel_args_239171[] = {&ctx->global_failure, &m_203489,
                                      &n_203490, &partition_sizze_203577,
                                      &num_groups_228217, &num_threads_232245,
                                      &kernel_arg_239174, &kernel_arg_239175,
                                      &kernel_arg_239176, &kernel_arg_239177,
                                      &kernel_arg_239178, &kernel_arg_239179,
                                      &kernel_arg_239180, &kernel_arg_239181};
        int64_t time_start_239172 = 0, time_end_239173 = 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_228212", (long) num_groups_228217, (long) 1,
                    (long) 1, (long) segmap_group_sizze_228215, (long) 1,
                    (long) 1, (int) 0);
            time_start_239172 = get_wall_time();
        }
        
        cudaEvent_t *pevents = NULL;
        
        if (ctx->profiling && !ctx->profiling_paused) {
            pevents = cuda_get_events(&ctx->cuda,
                                      &ctx->mainzisegmap_228212_runs,
                                      &ctx->mainzisegmap_228212_total_runtime);
            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
        }
        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_228212, grid[0],
                                              grid[1], grid[2],
                                              segmap_group_sizze_228215, 1, 1,
                                              0, NULL, kernel_args_239171,
                                              NULL));
        if (pevents != NULL)
            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
        if (ctx->debugging) {
            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
            time_end_239173 = get_wall_time();
            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                    "main.segmap_228212", time_end_239173 - time_start_239172);
        }
    }
    if (ctx->debugging)
        fprintf(ctx->log, "%s\n", "");
    if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_231898, "mem_231898") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_231901, "mem_231901") != 0)
        return 1;
    if (memblock_unref_device(ctx, &color_232083, "color_232083") != 0)
        return 1;
    if (memblock_set_device(ctx, &mem_out_232247, &mem_231887, "mem_231887") !=
        0)
        return 1;
    if (memblock_set_device(ctx, &mem_out_232248, &mem_231891, "mem_231891") !=
        0)
        return 1;
    if (memblock_set_device(ctx, &mem_out_232249, &mem_231895, "mem_231895") !=
        0)
        return 1;
    (*mem_out_p_237140).references = NULL;
    if (memblock_set_device(ctx, &*mem_out_p_237140, &mem_out_232247,
                            "mem_out_232247") != 0)
        return 1;
    (*mem_out_p_237141).references = NULL;
    if (memblock_set_device(ctx, &*mem_out_p_237141, &mem_out_232248,
                            "mem_out_232248") != 0)
        return 1;
    (*mem_out_p_237142).references = NULL;
    if (memblock_set_device(ctx, &*mem_out_p_237142, &mem_out_232249,
                            "mem_out_232249") != 0)
        return 1;
    if (memblock_unref_device(ctx, &color_232083, "color_232083") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_231901, "mem_231901") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_231898, "mem_231898") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_231895, "mem_231895") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_231891, "mem_231891") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_231887, "mem_231887") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_param_229493, "mem_param_229493") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_param_229485, "mem_param_229485") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_param_229477, "mem_param_229477") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_231860, "ext_mem_231860") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_231861, "ext_mem_231861") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_231862, "ext_mem_231862") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_230551, "mem_230551") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_230534, "mem_230534") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_230517, "mem_230517") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_230500, "mem_230500") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229531, "mem_229531") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229526, "mem_229526") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229520, "mem_229520") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229469, "mem_229469") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229465, "mem_229465") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229460, "ext_mem_229460") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229461, "ext_mem_229461") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229411, "ext_mem_229411") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229412, "ext_mem_229412") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229362, "ext_mem_229362") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229363, "ext_mem_229363") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229264, "ext_mem_229264") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229265, "ext_mem_229265") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229206, "mem_229206") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229200, "mem_229200") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229196, "ext_mem_229196") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229197, "ext_mem_229197") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
        return 1;
    
  cleanup:
    { }
    return err;
}

int futhark_entry_main(struct futhark_context *ctx,
                       struct futhark_f64_2d **out0,
                       struct futhark_f64_2d **out1,
                       struct futhark_f64_2d **out2, const
                       struct futhark_f64_2d *in0, const int64_t in1, const
                       int64_t in2, const int64_t in3, const int64_t in4, const
                       int64_t in5, const int64_t in6, const int64_t in7, const
                       int64_t in8, const int64_t in9, const int64_t in10, const
                       int64_t in11, const int64_t in12, const int64_t in13,
                       const int64_t in14)
{
    struct memblock_device Y_mem_229145;
    
    Y_mem_229145.references = NULL;
    
    int64_t m_203489;
    int64_t n_203490;
    int64_t n_p_203492;
    int64_t q_s_203493;
    int64_t q_t_203494;
    int64_t q_l_203495;
    int64_t d_s_203496;
    int64_t d_t_203497;
    int64_t d_l_203498;
    int64_t jump_s_203499;
    int64_t jump_t_203500;
    int64_t jump_l_203501;
    int64_t n_inner_203502;
    int64_t n_outer_203503;
    int64_t jump_threshold_203504;
    int64_t q_threshold_203505;
    struct memblock_device mem_out_232247;
    
    mem_out_232247.references = NULL;
    
    struct memblock_device mem_out_232248;
    
    mem_out_232248.references = NULL;
    
    struct memblock_device mem_out_232249;
    
    mem_out_232249.references = NULL;
    
    int ret = 0;
    
    lock_lock(&ctx->lock);
    CUDA_SUCCEED_FATAL(cuCtxPushCurrent(ctx->cuda.cu_ctx));
    Y_mem_229145 = in0->mem;
    m_203489 = in0->shape[0];
    n_203490 = in0->shape[1];
    n_p_203492 = in1;
    q_s_203493 = in2;
    q_t_203494 = in3;
    q_l_203495 = in4;
    d_s_203496 = in5;
    d_t_203497 = in6;
    d_l_203498 = in7;
    jump_s_203499 = in8;
    jump_t_203500 = in9;
    jump_l_203501 = in10;
    n_inner_203502 = in11;
    n_outer_203503 = in12;
    jump_threshold_203504 = in13;
    q_threshold_203505 = in14;
    if (!(m_203489 == in0->shape[0] && n_203490 == in0->shape[1])) {
        ret = 1;
        if (!ctx->error)
            ctx->error =
                msgprintf("Error: entry point arguments have invalid sizes.\n");
    }
    if (ret == 0) {
        ret = futrts_entry_main(ctx, &mem_out_232247, &mem_out_232248,
                                &mem_out_232249, Y_mem_229145, m_203489,
                                n_203490, n_p_203492, q_s_203493, q_t_203494,
                                q_l_203495, d_s_203496, d_t_203497, d_l_203498,
                                jump_s_203499, jump_t_203500, jump_l_203501,
                                n_inner_203502, n_outer_203503,
                                jump_threshold_203504, q_threshold_203505);
        if (ret == 0) {
            assert((*out0 =
                    (struct futhark_f64_2d *) malloc(sizeof(struct futhark_f64_2d))) !=
                NULL);
            (*out0)->mem = mem_out_232247;
            (*out0)->shape[0] = m_203489;
            (*out0)->shape[1] = n_203490;
            assert((*out1 =
                    (struct futhark_f64_2d *) malloc(sizeof(struct futhark_f64_2d))) !=
                NULL);
            (*out1)->mem = mem_out_232248;
            (*out1)->shape[0] = m_203489;
            (*out1)->shape[1] = n_203490;
            assert((*out2 =
                    (struct futhark_f64_2d *) malloc(sizeof(struct futhark_f64_2d))) !=
                NULL);
            (*out2)->mem = mem_out_232249;
            (*out2)->shape[0] = m_203489;
            (*out2)->shape[1] = n_203490;
        }
    }
    CUDA_SUCCEED_FATAL(cuCtxPopCurrent(&ctx->cuda.cu_ctx));
    lock_unlock(&ctx->lock);
    return ret;
}
  
